length test in overload

This commit is contained in:
aarne
2006-12-21 10:38:26 +00:00
parent fd90fe0791
commit ed46bb1364

View File

@@ -617,8 +617,9 @@ getOverload env@gr mt t = case appForm t of
---- TODO: use a trie
lookupOverloadInstance tys typs =
[(mkFunType rest val, t) |
(ty,(val,t)) <- typs,
let (pre,rest) = splitAt (length tys) ty,
let lt = length tys,
(ty,(val,t)) <- typs, length ty >= lt,
let (pre,rest) = splitAt lt ty,
pre == tys
]