[Haskell-beginners] Design Question: fmap with two lists

jonathanGfischoff at gmail.com jonathanGfischoff at gmail.com
Thu Dec 24 17:21:56 EST 2009

I have a class that is basically:

data TwoLists = TL {doubleList :: [Double], intList :: [Int]}

Almost all of the operations of this type map, fold, etc on one of the  
lists or the other, and then return a new instance of the type. So I am  
implementing to functions dFmap, and iFmap. I actually would like all of  
the list functions, but I don't want to reimplement them.

So my question is, what is the haskell way of handling a type like this. Is  
there some sort of TwoTypeTraversable I should be deriving from? Essential  
is there a Haskell idiom for this situation.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/beginners/attachments/20091224/3a3bc1d9/attachment.html

More information about the Beginners mailing list