Method C: Define fmap in terms of bind
instance Monad m => Functor (Iteratee el m) where
fmap = liftM
Now you need to do the inspection of Iteratee only once: in the
definition of the bind. However, to use liftM as implementation of fmap
the superclass constraint of the Functor instance ha
+1
On Sunday, July 18, 2010, Ian Lynagh wrote:
>
> Hi all,
>
> H98 and H2010 allow a context to be given for datatypes, e.g. the
> "Eq a" in
>
> data Eq a => Foo a = Constr a
>
> I have made a proposal to remove support for that context (ticket #139).
> More details are on the proposal wiki p
Ian Lynagh wrote:
I have a feeling I'm in the minority, but I find record punning an ugly
feature.
Given
data T = C { f :: Int }
we implicitly get
f :: T -> Int
which punning shadows with
f :: Int
whereas I generally avoid shadowing completely.
I agree with Ian.
Groetjes,
Martijn