Last active
September 18, 2019 01:48
-
-
Save Lysxia/96c9dd35601f41bf385309dffb1bbfec 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
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