Created
April 24, 2015 12:56
-
-
Save raindev/62dbdf643d38b474e287 to your computer and use it in GitHub Desktop.
Haskell ternary-operator-like function with custom predicate
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ifp :: (a -> Bool) -> a -> a -> a | |
ifp p x y | |
| p x = x | |
| otherwise = y |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment