Skip to content

Instantly share code, notes, and snippets.

@missingfaktor
Created February 9, 2012 18:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save missingfaktor/1781624 to your computer and use it in GitHub Desktop.
Save missingfaktor/1781624 to your computer and use it in GitHub Desktop.
-- Ref: http://goo.gl/L8Fzi
ghci> let keep2 f a b = (f a b, a, b)
ghci> let if' cond x y = if cond then x else y
ghci> let compose2 f g = (f .) . g
ghci> let uncurry3 f = \(a, b, c) -> f a b c
ghci> (uncurry3 if' `compose2` keep2 ((<) `on` length)) [1, 2] [2, 4, 5]
[1,2]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment