Last active
November 4, 2016 17:52
-
-
Save toastal/e524790e45715ae42cac9c2d3a0604a8 to your computer and use it in GitHub Desktop.
This file contains 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
module OnFail exposing (onFail) | |
onFail : (a -> Maybe b) -> (a -> b) -> a -> b | |
onFail f g x = | |
case f x of | |
Just y -> | |
y | |
Nothing -> | |
g x | |
infixl 2 ?> | |
(?>) : (a -> Maybe b) -> (a -> b) -> a -> b | |
(?>) = | |
onFail |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment