Skip to content

Instantly share code, notes, and snippets.

@khibino
Last active August 29, 2015 14:03
Show Gist options
  • Save khibino/f21c01c0410ec08ef555 to your computer and use it in GitHub Desktop.
Save khibino/f21c01c0410ec08ef555 to your computer and use it in GitHub Desktop.
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