Guest User

Untitled

a guest
Dec 17th, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. > (||) <$> (putStrLn "x" >> pure True) <*> (putStrLn "y" >> pure False)
  2. x
  3. y
  4. True
  5.  
  6. > let mor = \ma mb -> ma >>= \a -> if a then pure True else mb
  7.  
  8. > :t mor
  9. mor :: Monad m => m Bool -> m Bool -> m Bool
  10.  
  11. > mor (putStrLn "x" >> pure True) (putStrLn "y" >> pure False)
  12. x
  13. True
Add Comment
Please, Sign In to add comment