[Haskell-beginners] Functors in Haskell
Dimitri DeFigueiredo
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.
Thanks :-)
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
> (http://www.cse.chalmers.se/~nad/publications/danielsson-et-al-popl2006.pdf
> <http://www.cse.chalmers.se/%7Enad/publications/danielsson-et-al-popl2006.pdf>).
>
>
> _______________________________________________
> Beginners mailing list
> Beginners at haskell.org
> http://www.haskell.org/mailman/listinfo/beginners
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/beginners/attachments/20140429/f7ca1654/attachment.html>
More information about the Beginners
mailing list