Skip to content

Instantly share code, notes, and snippets.

@jacob414
Last active December 21, 2015 04:28
Show Gist options
  • Save jacob414/6249202 to your computer and use it in GitHub Desktop.
Save jacob414/6249202 to your computer and use it in GitHub Desktop.
_ = require 'underscore'
any = @any = (x) -> x
none = @none = (x) -> false
gt = @gt = (n) -> (x) -> x > n
eq = @eq = (p) -> (x) -> p == x
ne = @ne = (p) -> (x) -> x != p
match = @match = (P, L) ->
if P.length != L.length then false
else
_.every [pred(cand) for [pred, cand] in _.zip P, L][0], any
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment