Created
July 29, 2019 14:41
-
-
Save Lysxia/9c11a9102a1539b0c3d53212856ce7bc to your computer and use it in GitHub Desktop.
This file contains 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
{-# Language KindSignatures, RankNTypes, DerivingVia #-} | |
newtype Foo i o m r = Foo (Await i m r -> Yield o m r -> m r) | |
newtype Pipe i o m a = Pipe (forall xx. (a -> Await i m xx -> Yield o m xx -> m xx) -> (Await i m xx -> Yield o m xx -> m xx)) | |
deriving (Functor, Applicative, Monad) | |
via Codensity (Foo i o m) | |
-- Fluff -- | |
data Await i (m :: * -> *) r | |
data Yield i (m :: * -> *) r | |
instance Functor (Codensity m) | |
instance Applicative (Codensity m) | |
instance Monad (Codensity m) | |
newtype Codensity m a = CD (forall r. (a -> m r) -> m r) | |
main = main |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment