Advertisement
Guest User

Untitled

a guest
Aug 1st, 2019
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -- oppeators for haskell...
  2. import Control.Arrow
  3. import Data.Function ((&))
  4.  
  5. infixl 2 $>
  6. ($>) = (>>>)
  7.  
  8. infixl 1 $>=
  9. -- ($>=) converts from monad so that $> = flip (.) can be used
  10.  
  11. infixl 1 <>=
  12. infixl 1 =$>
  13. -- ( $>= , >>= ) infixes to ( =$> , <>= )
  14.  
  15. (<>=) f b a = f a >>= b      -- monad,arrow
  16. ($>=) a b = a >>= return . b -- fmap,monad
  17. (=$>) a b = a <>= (return . b) -- monad,fmap,arrow
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement