Hacker News new | ask | show | jobs
by natefaubion 5032 days ago
It meshes pretty well as is. If only I could get rid of the strings and redundant arguments.

  mymap = pattern {
    '_, []' : -> []
    'f, [x, xs...]' : (f, x, xs) -> 
      [f x].concat mymap(f, xs)
  }
It shares a lot of the same splat/rest/destructuring syntax.
1 comments

Check out LiveScript's implicit switch syntax:

http://gkz.github.com/LiveScript/#switch

That's along similar lines, but more like guards in Haskell: http://en.wikibooks.org/wiki/Haskell/Control_structures