
8 Oct
2008
8 Oct
'08
7:22 a.m.
Ryan Ingram
[...]
Here's another possible solution:
newtype AsFunctor s a = AF { fstream :: (s a) } instance (Stream f) => Functor (AsFunctor f) where fmap f (AF s) = AF (fmapStreamDefault f s)
Now to use fmap you wrap in AF and unwrap with fstream.
None of the existing solutions are really satisfactory, unfortunately.
Bulat Ziganshin
http://haskell.org/haskellwiki/OOP_vs_type_classes may be useful
Many thanks to you both for the clarification and pointers. cheers, Roly