Skip to content

Instantly share code, notes, and snippets.

@roboguy13
Created July 30, 2015 06:30
Show Gist options
  • Save roboguy13/165f2430c9a48d28df57 to your computer and use it in GitHub Desktop.
Save roboguy13/165f2430c9a48d28df57 to your computer and use it in GitHub Desktop.
{-# 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