News for hackers. Stuff that matters.
Re:The Beauty of Clojure by VladimirGolovin on Wednesday August 26, 2015 @08:31AM (#10122439)
I'm new to Clojure and I'm trying to parse this line:

  (reduce + (map (comp inc inc) (range 10)))
Is the following a correct Haskell equivalent?

  foldr1 (+) (map (succ.succ) [1..10])
Re:The Beauty of Clojure by vzcx on Wednesday August 26, 2015 @08:41AM (#10122472)
Mostly, but I'm pretty sure Clojure's range gives the integers from 0 to 9.
Re:The Beauty of Clojure by platz on Wednesday August 26, 2015 @12:09PM (#10123903)
pretty much almost all folds in strict languages can be assumed to be left folds.
Re:The Beauty of Clojure by tel on Wednesday August 26, 2015 @08:37AM (#10122459)
Yep!