Arrows in JavaScript

Arrows in JavaScript.

Arrows generalise computation schemes from the sequential version provided by monads, and are thus hard to bend one’s head around. It’s interesting to see them in JS.

3 Responses to “Arrows in JavaScript”

  1. pwb
    October 23rd, 2008 | 8:10 pm

    I keep thinking arrows should be called categories, since an arrow type just specifies the arrows in some category. For example (->) specifies the Haskell category (did you know that ((->) a) is a monad for any a? In fact return is K and bind is (an arg-munged version of) S) and Kleisli m specifies the Kleisli category of a monad m.

    Sheesh, I should give up trying to do semantics and just do category theory, I love it.

  2. October 25th, 2008 | 5:33 pm

    Word. But as JVT said, these days in Computer Science, category theory is like pop music: it’s everywhere and you can’t avoid it.

    return and bind are just K and S? I hadn’t spotted that… :-)

  3. October 18th, 2009 | 4:36 am

    Update: turns out Arrow is really categories with products and an embedding from the ambient category, since obviously arbitrary categories don’t have pure, (&&&) etc. In fact recent GHC has a Category class, which is a superclass of Arrow.