Created
February 26, 2019 15:51
-
-
Save chessai/4d636210edeb4b01cd568a736d7dcae0 to your computer and use it in GitHub Desktop.
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
combine :: Monoid e | |
=> (a -> Either e r1) | |
-> (b -> Either e r2) | |
-> (a,b) | |
-> Either (Either e1 (e1,e2)) (r1,r2) | |
combine fa fb (a,b) = | |
let faa = fa a | |
fbb = fb b | |
in case faa of | |
Left e1 -> Left (Left e1) | |
Right r1 -> case fbb of | |
Left e2 -> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment