Skip to content

Instantly share code, notes, and snippets.

@Lysxia Lysxia/GFunctor.hs
Last active Sep 18, 2019

Embed
What would you like to do?
class GFunctor (p :: c -> c -> *) (q :: d -> d -> *) (f :: c -> Exp d)
where
gfmap :: p x y -> q (f @@ x) (f @@ y)
instance (GFunctor p q f, GFunctor q r g) => GFunctor p r (g . f) where
gfmap = gfmap @q @r @g . gfmap @p @q @f
data (.) :: (d -> Exp e) -> (c -> Exp d) -> (c -> Exp e)
type instance Eval ((f . g) x) = Eval (f (Eval (g x))
instance GFunctor (->) (->) (Pure1 (->)) where ...
instance GFunctor (->) (->) (Pure1 ((,) x))) where ...
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.