Created
December 15, 2017 00:55
-
-
Save k0001/c1f15404dedd78d2ec0f5b765342a4ec 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
> (||) <$> (putStrLn "x" >> pure True) <*> (putStrLn "y" >> pure False) | |
x | |
y | |
True | |
> let mor = \ma mb -> ma >>= \a -> if a then pure True else mb | |
> :t mor | |
mor :: Monad m => m Bool -> m Bool -> m Bool | |
> mor (putStrLn "x" >> pure True) (putStrLn "y" >> pure False) | |
x | |
True |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment