
1 Jul
2010
1 Jul
'10
10:52 p.m.
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