Skip to content

Instantly share code, notes, and snippets.

@manishtomar
Last active August 29, 2015 14:11
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 manishtomar/dd5006ddbc5f6be8f5e9 to your computer and use it in GitHub Desktop.
Save manishtomar/dd5006ddbc5f6be8f5e9 to your computer and use it in GitHub Desktop.
Combining predicates
all_preds :: [a -> Bool] -> a -> Bool
all_preds ps = \x -> and $ map (\p -> p x) ps
any_preds :: [a -> Bool] -> a -> Bool
any_preds ps = \x -> or $ map (\p -> p x) ps
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment