gt22

Untitled

Nov 6th, 2020
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.20 KB | None | 0 0
  1. instance Functor (E l) where
  2.  
  3. _ `fmap` (L x) = L x
  4. f `fmap` (R x) = R (f x)
  5.  
  6. instance Applicative (E l) where
  7.  
  8. pure = R
  9.  
  10. (L f) <*> _ = L f
  11. (R f) <*> x = f `fmap` x
Advertisement
Add Comment
Please, Sign In to add comment