Add tar GNUmakefile target.
[haskell/symantic.git] / symantic-lib / Language / Symantic / Lib / Alternative.hs
index 57a879aacc6737b3f5143c8a57528df7eed08300..8338b49f3a4722530374480713c1fd22f786f6a1 100644 (file)
@@ -12,7 +12,7 @@ import Language.Symantic.Lib.Functor (Sym_Functor(..), f1)
 import Language.Symantic.Lib.Function (a0)
 
 -- * Class 'Sym_Alternative'
-type instance Sym (Proxy Alternative) = Sym_Alternative
+type instance Sym Alternative = Sym_Alternative
 class Sym_Functor term => Sym_Alternative term where
        empty :: Alternative f => term (f a)
        (<|>) :: Alternative f => term (f a) -> term (f a) -> term (f a)
@@ -35,15 +35,20 @@ instance (Sym_Alternative r1, Sym_Alternative r2) => Sym_Alternative (Dup r1 r2)
        empty = dup0 @Sym_Alternative empty
        (<|>) = dup2 @Sym_Alternative (<|>)
 
+-- Transforming
+instance (Sym_Lambda term, Sym_Alternative term) => Sym_Alternative (BetaT term)
+
 -- Typing
+instance NameTyOf Alternative where
+       nameTyOf _c = ["Alternative"] `Mod` "Alternative"
 instance FixityOf Alternative
 instance ClassInstancesFor Alternative
 instance TypeInstancesFor Alternative
 
 -- Compiling
 instance Gram_Term_AtomsFor src ss g Alternative
-instance (Source src, Inj_Sym ss Alternative) => Module src ss Alternative where
-       module_ _s = [] `moduleWhere`
+instance (Source src, SymInj ss Alternative) => ModuleFor src ss Alternative where
+       moduleFor = ["Alternative"] `moduleWhere`
         [ "empty" := teAlternative_empty
         , "<|>" `withInfixL` 3 := teAlternative_alt
         ]