Created
July 30, 2015 06:30
-
-
Save roboguy13/165f2430c9a48d28df57 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 RankNTypes #-} | |
{-# LANGUAGE FlexibleInstances #-} | |
{-# LANGUAGE MultiParamTypeClasses #-} | |
import Control.Transformation | |
import Data.Functor.Yoneda | |
import Data.Functor.Coyoneda | |
instance Transformation ((->) a) g (Yoneda g a) where | |
Yoneda y # a = y a | |
instance Functor g => Transformation ((->) a) g (Coyoneda g a) where | |
Coyoneda f fb # x = fmap (x . f) fb | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment