Skip to content

Comment on Stupid Languagesparent

Comments

Here's what I use:

  # Adapted from http://autotelicum.github.com/Smooth-CoffeeScript/literate/partial.html
  F.partial = (func, a...) -> (b...) ->
    func (for arg in a then arg ?= b.shift())..., b...
For example, do `parseInt10 = F.partial(parseInt, undefined, 10)`, then `[].map(parseInt10)` does the right thing.
AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.