Last active
August 29, 2015 14:03
-
-
Save khibino/f21c01c0410ec08ef555 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
| data (:|:) f g a = L (f a) | |
| | R (g a) | |
| instance (Functor f, Functor g) => Functor (f :|: g) where | |
| fmap = undefined | |
| instance (Monad f, Monad g) => Monad (f :|: g) where | |
| return = undefined | |
| (>>=) = undefined | |
| class (Functor f, Functor e) => Liftable f e where | |
| liftEff :: f a -> e a | |
| class (Monad f, Monad e) => LiftableM f e where | |
| liftEffM :: f a -> e a | |
| data Foo a = Foo a deriving Functor | |
| data Bar a = Bar a deriving Functor | |
| data Baz a = Baz a deriving Functor | |
| type MyEff = Foo :|: Bar :|: Baz | |
| instance Liftable Foo MyEff where | |
| instance Liftable Bar MyEff where | |
| instance Liftable Baz MyEff where |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment