Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
{-# 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
You can’t perform that action at this time.