diff options
author | Jed Barber <jjbarber@y7mail.com> | 2016-12-15 14:28:31 +1100 |
---|---|---|
committer | Jed Barber <jjbarber@y7mail.com> | 2016-12-15 14:28:31 +1100 |
commit | 5395287cc2f758d94bec8befe8956ba2dcc3940c (patch) | |
tree | fca41713cd7f8a27d41ba0d186adc1e616cf447b /src/Test | |
parent | 2fc745bef05860e16a2e89e465a30dc59b5ec2e5 (diff) |
Old uncommitted changes
Diffstat (limited to 'src/Test')
-rw-r--r-- | src/Test/DataTypes.hs | 136 |
1 files changed, 68 insertions, 68 deletions
diff --git a/src/Test/DataTypes.hs b/src/Test/DataTypes.hs index 28db135..76713fe 100644 --- a/src/Test/DataTypes.hs +++ b/src/Test/DataTypes.hs @@ -1,68 +1,68 @@ -module Test.DataTypes( - stdName, - stdType, - stdConst, - stdConstTerm, - stdTypeVarName, - altTypeVarName, - stdTypeVar, - altTypeVar, - stdVar, - stdVarTerm, - altVar, - altVarTerm, - stdAbsTerm, - stdAppTerm - ) where - - - -import Library.TypeVar -import Library.Term - - - -stdName :: String -> Name -stdName s = Name [] s - -stdType :: Type -stdType = AType [] (TypeOp (stdName "atype")) - -stdConst :: Const -stdConst = Const (stdName "const") - -stdConstTerm :: Term -stdConstTerm = TConst stdConst stdType - -stdTypeVarName :: Name -stdTypeVarName = stdName "typevar" - -altTypeVarName :: Name -altTypeVarName = stdName "alttypevar" - -stdTypeVar :: Type -stdTypeVar = TypeVar stdTypeVarName - -altTypeVar :: Type -altTypeVar = TypeVar altTypeVarName - -stdVar :: String -> Var -stdVar s = Var (stdName s) stdTypeVar - -stdVarTerm :: String -> Term -stdVarTerm s = TVar (stdVar s) - -altVar :: String -> Var -altVar s = Var (stdName s) altTypeVar - -altVarTerm :: String -> Term -altVarTerm s = TVar (altVar s) - -stdAbsTerm :: String -> Term -stdAbsTerm s = TAbs (stdVarTerm s) stdConstTerm - -stdAppTerm :: String -> Term -stdAppTerm s = TApp (stdAbsTerm s) stdConstTerm - - - +module Test.DataTypes(
+ stdName,
+ stdType,
+ stdConst,
+ stdConstTerm,
+ stdTypeVarName,
+ altTypeVarName,
+ stdTypeVar,
+ altTypeVar,
+ stdVar,
+ stdVarTerm,
+ altVar,
+ altVarTerm,
+ stdAbsTerm,
+ stdAppTerm
+ ) where
+
+
+
+import Library.TypeVar
+import Library.Term
+
+
+
+stdName :: String -> Name
+stdName s = Name [] s
+
+stdType :: Type
+stdType = AType [] (TypeOp (stdName "atype"))
+
+stdConst :: Const
+stdConst = Const (stdName "const")
+
+stdConstTerm :: Term
+stdConstTerm = TConst stdConst stdType
+
+stdTypeVarName :: Name
+stdTypeVarName = stdName "typevar"
+
+altTypeVarName :: Name
+altTypeVarName = stdName "alttypevar"
+
+stdTypeVar :: Type
+stdTypeVar = TypeVar stdTypeVarName
+
+altTypeVar :: Type
+altTypeVar = TypeVar altTypeVarName
+
+stdVar :: String -> Var
+stdVar s = Var (stdName s) stdTypeVar
+
+stdVarTerm :: String -> Term
+stdVarTerm s = TVar (stdVar s)
+
+altVar :: String -> Var
+altVar s = Var (stdName s) altTypeVar
+
+altVarTerm :: String -> Term
+altVarTerm s = TVar (altVar s)
+
+stdAbsTerm :: String -> Term
+stdAbsTerm s = TAbs (stdVarTerm s) stdConstTerm
+
+stdAppTerm :: String -> Term
+stdAppTerm s = TApp (stdAbsTerm s) stdConstTerm
+
+
+
|