
24 Dec
2009
24 Dec
'09
5:21 p.m.
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. -Jonathan