Skip to content

Instantly share code, notes, and snippets.

@fumieval
Created February 22, 2015 10:34
Show Gist options
  • Save fumieval/3b894b3bea867594b8d7 to your computer and use it in GitHub Desktop.
Save fumieval/3b894b3bea867594b8d7 to your computer and use it in GitHub Desktop.
import Control.Object
echo' :: Object f (Coyoneda f)
echo' = Object $ Coyoneda (\x -> (x, echo'))
(@>>>@) :: Object f (Coyoneda g) -> Object g (Coyoneda h) -> Object f (Coyoneda h)
Object m @>>>@ Object n = Object $ \f -> case m f of
Coyoneda k g -> case n g of
Coyoneda l h -> Coyoneda (\x -> case l x of (y, ogh) -> case k y of (z, ofg) -> (z, ofg @>>>@ ogh)) h
infixr 1 @>>>@
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment