[small change of equality between ForallT, Context is compared, too
martin.hofmann@uni-bamberg.de**20090714023844] hunk ./src/Syntax/Types.hs 20
-import Data.List (union, nub)
+import Data.List (union, nub, intersect, intersectBy)
hunk ./src/Syntax/Types.hs 38
+--------------------------------------------------------------------------------
+-- Inspecting Types
+--------------------------------------------------------------------------------
+
+isFunT :: Type -> Bool
+isFunT =  (>1) . length . unArrowT
+
+hasFunT :: (Typed t) => t -> Bool
+hasFunT = isFunT . typeOf
+
+isHOT :: Type -> Bool
+isHOT = (any isFunT) . unArrowT 
+
+hasHOT :: (Typed t) => t -> Bool
+hasHOT = isHOT . typeOf
+--------------------------------------------------------------------------------
+-- Comparing Types
+--------------------------------------------------------------------------------
+
hunk ./src/Syntax/Types.hs 64
+-- | returns True if both Types are semantically equal, w.r.t. to different 
+-- representations for tuple and list types
hunk ./src/Syntax/Types.hs 79
-equalTys (ForallT n1 c1 t1) (ForallT n2 c2 t2)  = -- TODO how to compare contexts
-    all (uncurry equalTys) (zip c1 c2) && equalTys t1 t2
+equalTys (ForallT n1 c1 t1) (ForallT n2 c2 t2)  = 
+    (n1 == (n1 `intersect` n2)) &&
+    (equalTys t1 t2) &&
+    (c1 == (intersectBy equalTys c1 c2))
hunk ./src/Syntax/Types.hs 101
+