[Haskell-beginners] functor declaration
Michael Mossey
mpm at alumni.caltech.edu
Thu Jul 1 18:52:47 EDT 2010
in the declaration of Functor:
class Functor f where
fmap :: (a -> b) -> f a -> f b
does the compiler infer that f is a type constructor (not a type) because
of the appearance of "f a" and "f b"?
What I'm thinking is that some classes are classes of types, not type
constructors. Like
class CanMakeInt a where
makeInt :: a -> Int
In this case a is a type, not a type constructor. But there is no
difference in the form of the first line of the class declaration.
Thanks,
Mike
More information about the Beginners
mailing list