import Language.Symantic.Lib.Function (a0, b1)
-- * Class 'Sym_Functor'
-type instance Sym (Proxy Functor) = Sym_Functor
+type instance Sym Functor = Sym_Functor
class Sym_Functor term where
fmap :: Functor f => term (a -> b) -> term (f a) -> term (f b)
default fmap :: Sym_Functor (UnT term) => Trans term => Functor f => term (a -> b) -> term (f a) -> term (f b)
(<$) = trans2 (<$)
-- Typing
+instance NameTyOf Functor where
+ nameTyOf _c = ["Functor"] `Mod` "Functor"
instance FixityOf Functor
instance ClassInstancesFor Functor
instance TypeInstancesFor Functor
-- Compiling
instance Gram_Term_AtomsFor src ss g Functor
-instance (Source src, Inj_Sym ss Functor) => ModuleFor src ss Functor where
- moduleFor _s = ["Functor"] `moduleWhere`
+instance (Source src, SymInj ss Functor) => ModuleFor src ss Functor where
+ moduleFor = ["Functor"] `moduleWhere`
[ "fmap" := teFunctor_fmap
, "<$" `withInfixL` 4 := teFunctor_const
, "<$>" `withInfixL` 4 := teFunctor_fmap_infix
tyFunctor :: Source src => Type src vs a -> Type src vs (Functor a)
tyFunctor a = tyConstLen @(K Functor) @Functor (lenVars a) `tyApp` a
-f1 :: Source src => Inj_Len vs => Inj_Kind (K f) =>
+f1 :: Source src => LenInj vs => KindInj (K f) =>
Type src (a ': Proxy f ': vs) f
f1 = tyVar "f" $ VarS varZ
-f2 :: Source src => Inj_Len vs => Inj_Kind (K f) =>
+f2 :: Source src => LenInj vs => KindInj (K f) =>
Type src (a ': b ': Proxy f ': vs) f
f2 = tyVar "f" $ VarS $ VarS varZ