[Haskell-beginners] Functors in Haskell
defigueiredo at ucdavis.edu
Tue Apr 29 19:05:13 UTC 2014
Wow, this makes it very clear!
So, the object mapping is provided by the type constructor and the arrow
mapping by fmap.
Em 29/04/14 12:35, Rein Henrichs escreveu:
> Yes, this is reasonable, but it might be useful to be a bit more
> explicit about the categories involved.
> An instance of Functor is a functor which maps objects and arrows in
> the category of Hask (of Haskell types and functions) to... objects
> and arrows in the category of Hask. It is an endofunctor. The object
> mapping must map a type to a type and therefore must have the kind *
> -> *. This means that it is a type constructor, e.g., Maybe. The arrow
> mapping must map arrows to arrows, which means it must map functions
> to functions. fmap provides this mapping and the Functor laws in
> Haskell are of course equivalent to the laws from category theory.
> And while the inclusion of bottom is problematic for Hask, it is still
> possible to reason about it in a "morally correct" way
> Beginners mailing list
> Beginners at haskell.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Beginners