伟大的范畴理论

A Category C is defined by:

• Objects ob(C),
• Morphisms hom(C),
• a Composition law (∘)

Functor : (ob->ob)

Functor : (hom->hom)

Endofunctors:

Categories and functors form a category: Cat

• ob(Cat) are categories
• hom(Cat) are functors
• ∘ is functor composition

A Haskell Functor is a type F :: * -> * which belong to the type class Functor ; thus instantiate fmap :: (a -> b) -> (F a -> F b).

fmap id x = x