Add tar GNUmakefile target.
[haskell/symantic.git] / symantic-lib / Language / Symantic / Lib / Functor.hs
index afa9c15d72ea411de633a79bf4a8b90398683fc5..ea45384e6556a36c4f45ef51033b1a7e1895a5c2 100644 (file)
@@ -13,7 +13,7 @@ import Language.Symantic
 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)
@@ -44,14 +44,16 @@ instance (Sym_Functor term, Sym_Lambda term) => Sym_Functor (BetaT term) where
        (<$)  = 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
@@ -61,11 +63,11 @@ instance (Source src, Inj_Sym ss Functor) => ModuleFor src ss Functor where
 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