summaryrefslogtreecommitdiff
path: root/src/Test
diff options
context:
space:
mode:
Diffstat (limited to 'src/Test')
-rw-r--r--src/Test/DataTypes.hs68
1 files changed, 68 insertions, 0 deletions
diff --git a/src/Test/DataTypes.hs b/src/Test/DataTypes.hs
new file mode 100644
index 0000000..28db135
--- /dev/null
+++ b/src/Test/DataTypes.hs
@@ -0,0 +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
+
+
+