From 3ea6bacad9fd7b14d5454d6ea109f5de724fd690 Mon Sep 17 00:00:00 2001 From: Jed Barber Date: Tue, 22 May 2012 09:22:33 +1000 Subject: Split the Object wrapping from the actual computation in the article commands --- Term.hs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'Term.hs') diff --git a/Term.hs b/Term.hs index 20c70ce..23fc5c5 100644 --- a/Term.hs +++ b/Term.hs @@ -1,5 +1,8 @@ module Term ( Term(..), + Substitution, + + nullTerm, alphaEquiv, alphaConvert, @@ -31,7 +34,8 @@ data Term = TVar { tVar :: Var } | TApp { tAppLeft :: Term , tAppRight :: Term } | TAbs { tAbsVar :: Term - , tAbsTerm :: Term } deriving (Ord) + , tAbsTerm :: Term } + | TNull deriving (Ord) type Substitution = ( [(Name,Type)], [(Var,Term)] ) @@ -50,6 +54,10 @@ instance Eq Term where +nullTerm :: Term +nullTerm = TNull + + alphaEquiv :: Term -> Term -> Bool alphaEquiv a b = let equiv = \term1 term2 varmap1 varmap2 depth -> -- cgit