kmandpjlynch at verizon.net
Wed Mar 2 15:03:00 CET 2011
In Learn You a Haskell for Great Good!, the author Miran Lipovaca indicates that to understand Monads you need to know Functors...
So, I noticed the following:
class Functor f where
fmap::(a->b)->f a->f b
instance Functor  where
fmap = map
if  is substituted for f in the class definition of Functor the following is obtained
class Functor  where
my questions are:
1. is this substitution ok?
2. is a = [a]?
3. is b = [b]?
if 2. and 3. are valid then the following is obtained:
which is the same as map type and therefore: fmap = map. QED.
Can you please answer questions 2 and 3 above?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Beginners