[Haskell-cafe] Modifying a product type generically

Michael Orlitzky michael at orlitzky.com
Fri Jan 2 21:12:40 UTC 2015


On 01/02/2015 04:03 PM, Aleksey Khudyakov wrote:
> 
>> import qualified Data.Vector.HFixed.Cont as H (ContVec)
>> asCont :: H.ContVec a -> H.ContVec a
>> asCont = id
> 
> *Main> (H.cons "A" . asCont . H.tail) (BigFoo "Hello" 1 2) :: BigFoo
> BigFoo "A" 1 2
> 
> This function is not in the library but I'm going to add it. It is usefult for
> combining functions
> 

Ha ha! It works! I have deleted so much code today.

I will also be sending you a pull request with millions of tuple
instances =)



More information about the Haskell-Cafe mailing list