News for hackers. Stuff that matters.
Re:Combinator Recipes for Working With Objects in JavaScript by nadaviv on Sunday December 16, 2012 @12:05AM (#4927399)
I find higher-order function to be really beautiful with CoffeeScript:

  partial = (fn, a...) -> (b...) -> fn.apply this, [a..., b...]
  compose = (fns...) -> (a) -> a = fn a for fn in fns; a
  
  splat = (fn) -> (arr) -> arr.map fn
  get = (attr) -> (obj) -> obj[attr]
  
  maybe = (fn) -> (args...) ->
    return unless args.length
    return arg for arg in args when not arg?
    fn.apply this, args
Re:Combinator Recipes for Working With Objects in JavaScript by wonderzombie on Sunday December 16, 2012 @01:59PM (#4929154)
Beauty is, of course, subjective, but the use of 'this' stands out to me as unusual for these particular patterns. Call it a slightly leaky abstraction, I suppose.

That said, at least the function declaration syntax looks a lot like Haskell's type signatures. So maybe they're doing something right. :)