Commit 9e53aed0 authored by Camil Staps's avatar Camil Staps
Browse files

Cleanup

parent e7dc1f07
......@@ -324,7 +324,7 @@ where
castLocFrth m = map (\(a,b,c,l) -> (a,b,c,castLoc m l))
castLoc :: String LocationInModule -> 'CDB'.Location
castLoc m l = 'CDB'.Location lib m dclpath l.dcl_line l.icl_line $ fromMaybe "" l.name // TODO
castLoc m l = 'CDB'.Location lib m dclpath l.dcl_line l.icl_line $ fromMaybe "" l.name
dclpath = mkdir mod +++ ".dcl"
mkdir :: String -> String
......
......@@ -57,9 +57,8 @@ addType t v tree=:(Node n vs children)
findUnifying :: !Type !(TypeTree v) -> [(Type,Unifier,[v])]
findUnifying t tree=:(Node n ls cs) = case unify t n of
Nothing -> trace_n ("NO\t" +++ toString n) []
Just tvas -> //if (not (isEmpty cs) && isGeneralisingUnifier tvas)
//(allValues tree) // TODO this fails for A.a: a, which incorrectly generalises 'a' and returns all types
trace_n ("YES\t" +++ toString n) [(n,finish_unification [] tvas,ls):concatMap (findUnifying t) cs]
Just tvas -> trace_n ("YES\t" +++ toString n)
[(n,finish_unification [] tvas,ls):concatMap (findUnifying t) cs]
allTypes :: (TypeTree v) -> [(Type,[v],[TypeTree v])]
allTypes (Node t vs cs) = [(t,vs,cs):concatMap allTypes cs]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment