[Haskell-beginners] Making sense of currying in the context of the Hask Category

Lyndon Maydwell maydwell at gmail.com
Fri Sep 28 07:03:52 CEST 2012


I think you just have to remember that Haskell's currying is a side
effect (haha) of all functions only actually taking one argument.

I may be off base with this since I only just started looking at
category theory, but it made sense when I sketched it out:

http://i.imgur.com/QriQm.png

Let me know if I've made any silly mistakes as I'm still learning too :-)



On Fri, Sep 28, 2012 at 10:07 AM, Lino Rosa <lino.aguiar.rosa at gmail.com> wrote:
> Hi,
>
> I'm a Haskell newbie and I couldn't quite make sense of how currying
> maps to the the Hask Category.
> How would I map, for instance (+) to a Hask 'arrow'?
>
> If objects are types on Hask, then would a -> a -> a be the first
> object on this chain?
>
> In that case, for the first arrow, would I have as many arrows as
> there are possible partial applications on this type? In other words,
> would I have (+) 1, (+) 2, (+) 3 ... all those transitioning to the
> second object ( a -> a )
> Or, do I have ONE arrow only, like (+) a ?
>
> In either case, what happens after 'm left with the object a -> a?
> What function (arrow) mutates it to the final value 'a'? That's the
> function resulting from the previous partial application of (+), but
> that fuction only exists at run time, after you apply the first one. I
> guess the question is, if you'd have to write a diagram for this, what
> would you write beside each object and beside each arrow?
>
> _______________________________________________
> Beginners mailing list
> Beginners at haskell.org
> http://www.haskell.org/mailman/listinfo/beginners



More information about the Beginners mailing list