[Haskell-cafe] Functor and Haskell

Daryoush Mehrtash dmehrtash at gmail.com
Wed Apr 22 18:14:03 EDT 2009

Here F is the identity functor, and G is the list functor. And yes, C=D=
category of (a subset of) Haskell types.

Are you saying the function that goes from list functor to singleton funtor
is a natural transformation?

But aren't they functors to different subset of Haskell Types?

The Haskell Wikibooks also
same thing:

> Functors in Haskell are from *Hask* to *func*, where *func* is the
> subcategory of *Hask* defined on just that functor's types. E.g. the list
> functor goes from *Hask* to *Lst*, where *Lst* is the category containing
> only *list types*, that is, [T] for any type T. The morphisms in *Lst* are
> functions defined on list types, that is, functions [T] -> [U] for types T,
> U.
So in your example there is C that is Hask.  But there are two D's,  D1 that
is all List types, and D2 all singleton types.  In this example I guess,
the  Singleton types are subset of List types which are subset of Hask.
Is that related to natural transformation or unrelated?


On Wed, Apr 22, 2009 at 12:18 AM, Kim-Ee Yeoh <a.biurvOir4 at asuhan.com>wrote:

> Daryoush Mehrtash-2 wrote:
> >
> > I am not sure I follow how the endofunctor gave me the 2nd functor.
> >
> > As I read the transformation there are two catagories C and D and two
> > functors F and G between the same two catagories.  My problem is that I
> > only
> > have one functor between the Hask and List catagories.  So where does the
> > 2nd functor come into picture that also maps between the same C and D
> > catagories?
> >
> Consider
> singleton :: a -> [a]
> singleton x = [x]
> Here F is the identity functor, and G is the list functor. And yes, C=D=
> category of (a subset of) Haskell types.
> --
> View this message in context:
> http://www.nabble.com/Functor-and-Haskell-tp23166441p23170956.html
> Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com.
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe


Weblog:  http://perlustration.blogspot.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20090422/ceb46bcc/attachment-0001.htm

More information about the Haskell-Cafe mailing list