summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJed Barber <jjbarber@y7mail.com>2012-05-10 17:28:07 +1000
committerJed Barber <jjbarber@y7mail.com>2012-05-10 17:28:07 +1000
commit99b83cf6f47112cf8b6c50fed441036b0e1f7098 (patch)
treeda5cb0769c74d08cd70448dc8af4382eba18ebab
parent839c1dd879534952f253bbcd5a4405abd1287f6a (diff)
Improved display of types and type operators
-rw-r--r--Semantic.hs17
1 files changed, 12 insertions, 5 deletions
diff --git a/Semantic.hs b/Semantic.hs
index b734a02..eb1f6f6 100644
--- a/Semantic.hs
+++ b/Semantic.hs
@@ -21,11 +21,11 @@ data Name = Name { nameSpace :: [String]
type List = [Object]
-data TypeOp = TypeOp { tyOp :: Name } deriving (Eq, Show)
+data TypeOp = TypeOp { tyOp :: Name } deriving (Eq)
data Type = TypeVar { typeVar :: Name }
| AType { aType :: [Type]
- , aTypeOp :: TypeOp } deriving (Eq, Show)
+ , aTypeOp :: TypeOp } deriving (Eq)
data Const = Const { constName :: Name } deriving (Eq)
@@ -56,6 +56,16 @@ instance Show Object where
show (ObjThm a) = show a
show (ObjSub a) = show a
+instance Show Name where
+ show a = intercalate "." (nameSpace a ++ [nameId a])
+
+instance Show TypeOp where
+ show a = "typeOp " ++ (show $ tyOp a)
+
+instance Show Type where
+ show (TypeVar tyVar) = "typeVar " ++ (show tyVar)
+ show (AType list typeOp) = "type " ++ (show $ tyOp typeOp) ++ " " ++ (show list)
+
instance Show Const where
show (Const a) = show a
@@ -73,9 +83,6 @@ instance Show Term where
instance Show Theorem where
show a = (show . thmHyp $ a) ++ " |- " ++ (show . thmCon $ a)
-instance Show Name where
- show a = intercalate "." (nameSpace a ++ [nameId a])
-
instance Eq Term where
a == b = a `alphaEquiv` b