Arc Forumnew | comments | leaders | submitlogin
7 points by almkglor 5893 days ago | link | parent

Done. On the arc-wiki.git, as lib/bracket-curry.arc


5 points by raymyers 5892 days ago | link

I was skeptical, but I tried it out.

    (map [+ 1] li) ; does the same as the Haskell
     map (+ 1) li
But this has the added bonus of being able to sensibly curry variadic functions like + and map.

    (map [+ 1] '(1 2 3 4) '(1 2 3 4))  =>  (3 5 7 9)
    (apply [map +] '((1 2) (1 2) (1 2)))  =>  (3 6)
I'm sold :)

-----

2 points by almkglor 5892 days ago | link

([apply [map +]] '((1 2) (1 2) (1 2)))

-----

2 points by cchooper 5893 days ago | link

Genius

-----