logoalt Hacker News

adamddev1 • today at 12:48 PM • 2 replies • view on HN

Gleam is really a delightful language with great ideas, but the lack of currying is a tragedy.

Missing currying feels a little to me like walking in FP land with one leg cut off.


Replies

kaoD • today at 1:04 PM

I never liked currying. It feels more theoretically elegant than practically useful.

IMO it is hard to read (unless you're very familiar with the functions at hand), produces type errors that are not easy to follow (oops, I forgot the last arg), and is too rigid (I often need to partially apply arguments in non left-to-right order).

I never understood why partial application via "slots" isn't more common though (I just made up the term, not sure if this has a name). Like Clojure's:

    #(f %2 "foo" %1 "bar")
    ;; same as
    (fn [a b] (f b "foo" a "bar"))
Does Gleam have something like that?
➕ show 1 reply
stiiv • today at 1:36 PM

A deal breaker, and just when I was starting to get excited!

Plenty of practical reasons for currying, but the biggest (imo) is for use with the pipe operator.

If they don't have partial application now, what are the odds they'll have it in the future?

➕ show 1 reply