Make stack flags customizable in GNUmakefile.
[haskell/symantic.git] / symantic-lib / Language / Symantic / Lib / Traversable.hs
index a195728eed4cdaa912e09cb30d13eb0d976825b9..20c89e9c6c5b88b19fca540ffcab3bb7220cfdce 100644 (file)
@@ -13,7 +13,7 @@ import Language.Symantic.Lib.Function (a0, b1)
 import Language.Symantic.Lib.Functor (f2)
 
 -- * Class 'Sym_Traversable'
-type instance Sym (Proxy Traversable) = Sym_Traversable
+type instance Sym Traversable = Sym_Traversable
 class Sym_Traversable term where
        traverse :: Traversable t => Applicative f => term (a -> f b) -> term (t a) -> term (f (t b))
        default traverse :: Sym_Traversable (UnT term) => Trans term => Traversable t => Applicative f => term (a -> f b) -> term (t a) -> term (f (t b))
@@ -31,14 +31,16 @@ instance (Sym_Traversable r1, Sym_Traversable r2) => Sym_Traversable (Dup r1 r2)
 instance (Sym_Traversable term, Sym_Lambda term) => Sym_Traversable (BetaT term)
 
 -- Typing
+instance NameTyOf Traversable where
+       nameTyOf _c = ["Traversable"] `Mod` "Traversable"
 instance FixityOf Traversable
 instance ClassInstancesFor Traversable
 instance TypeInstancesFor Traversable
 
 -- Compiling
 instance Gram_Term_AtomsFor src ss g Traversable
-instance (Source src, Inj_Sym ss Traversable) => Module src ss Traversable where
-       module_ _s = [] `moduleWhere`
+instance (Source src, SymInj ss Traversable) => ModuleFor src ss Traversable where
+       moduleFor = ["Traversable"] `moduleWhere`
         [ "traverse" := teTraversable_traverse
         ]
 
@@ -50,5 +52,5 @@ tyTraversable a = tyConstLen @(K Traversable) @Traversable (lenVars a) `tyApp` a
 teTraversable_traverse :: TermDef Traversable '[Proxy a, Proxy b, Proxy f, Proxy t] (Traversable t # Applicative f #> ((a -> f b) -> t a -> f (t b)))
 teTraversable_traverse = Term (tyTraversable t # tyApplicative f2) ((a0 ~> f2 `tyApp` b1) ~> t `tyApp` a0 ~> f2 `tyApp` (t `tyApp` b1)) $ teSym @Traversable $ lam2 traverse
        where
-       t :: Source src => Inj_Len vs => Inj_Kind (K t) => Type src (Proxy a ': Proxy b ': Proxy c ': Proxy t ': vs) t
+       t :: Source src => LenInj vs => KindInj (K t) => Type src (Proxy a ': Proxy b ': Proxy c ': Proxy t ': vs) t
        t = tyVar "t" $ VarS $ VarS $ VarS varZ