News for hackers. Stuff that matters.
Re:Ask HN: Functional Programming Differences by loup-vaillant on Monday March 08, 2010 @03:35AM (#1174997)
Plus, first class functions can be shown with mere high school mathematics. Lambda are really easy: the

    f: R  -> R
       x |-> blah(x)
you find in high school would be

    f : (float -> float)
      = fun x  -> blah x
In Ocaml (and probably F#).

The composition operator can easily be seen as a function with two arguments, which show "first class" functions:

    o : (R->R), (R->R)  -> (R  -> R      )
        (f    , g    ) |-> (x |-> f(g(x)))
And poof, you can introduce currying:

    o : ((R->R), (R->R) , R)  -> R
        (f     , g      , x) |-> f(g(x)))

There are no comments on this comment yet.