summaryrefslogtreecommitdiff
path: root/Test
diff options
context:
space:
mode:
authorJed Barber <jjbarber@y7mail.com>2012-09-14 07:41:49 +1000
committerJed Barber <jjbarber@y7mail.com>2012-09-14 07:41:49 +1000
commit84f2ee4a7653b47c4ddefd87c4482729d0272e6b (patch)
treeaf79aa943349b5ad64f01c7294eff1f1d70cf1f6 /Test
parentea3f1f7736c57747e743a5106b917d2853c62f57 (diff)
Testing package
Diffstat (limited to 'Test')
-rw-r--r--Test/DataTypes.hs59
1 files changed, 59 insertions, 0 deletions
diff --git a/Test/DataTypes.hs b/Test/DataTypes.hs
new file mode 100644
index 0000000..d0fbfde
--- /dev/null
+++ b/Test/DataTypes.hs
@@ -0,0 +1,59 @@
+module Test.DataTypes(
+ stdName,
+ stdType,
+ stdConst,
+ stdConstTerm,
+ stdTypeVarName,
+ altTypeVarName,
+ stdTypeVar,
+ altTypeVar,
+ stdVar,
+ stdVarTerm,
+ altVar,
+ altVarTerm
+ ) 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)
+
+