
4 May
2011
4 May
'11
11:39 a.m.
On Wed, May 4, 2011 at 2:51 AM, Chaddaï Fouché
Writing this function given your intention (doing different thing depending on the type) is equivalent to writing an instance of Foldable for your (MultiMap k). If the underlying structure of your multimaps is always foldable, it doesn't make sense to make a function like this, the multimaps themselves should be Foldable. This is not hard to do, refer to the doc ( http://www.haskell.org/ghc/docs/7.0-latest/html/libraries/base-4.3.1.0/Data-... ) to see how to write a minimal instance of Foldable.
I second this. I don't see how an instance of Foldable (MultiMap k) is different of what the OP wants. Much easier and nicer. Cheers, -- Felipe.