Created
October 11, 2015 07:05
-
-
Save forficate/d38492bf8ebdcab5b7b9 to your computer and use it in GitHub Desktop.
elm-lang Task snippers
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
-- Allow both the left / right values of a task to be promted in to a successful Task of c | |
fold : (a -> c) -> (b -> c) -> Task a b -> Task y c | |
fold f1 f2 t = | |
Task.map f2 t `Task.onError` (\x -> Task.succeed(f1 x)) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment