added debug info
This commit is contained in:
parent
23c174607b
commit
b4cae11c0d
2 changed files with 31 additions and 24 deletions
|
|
@ -129,7 +129,7 @@ checkBind err@(Bind name args e) = do
|
|||
sub <- bindErr (unify t lambdaT) err
|
||||
let newT = apply sub t
|
||||
insertSig (coerce name) (Just newT)
|
||||
return $ T.Bind (coerce name, newT) (map coerce args) e
|
||||
return $ T.Bind (apply sub (coerce name, newT)) (map coerce args) e
|
||||
_ -> do
|
||||
insertSig (coerce name) (Just lambdaT)
|
||||
return (T.Bind (coerce name, lambdaT) (map coerce args) e) -- (apply s e)
|
||||
|
|
@ -481,6 +481,9 @@ instance SubstType T.Pattern where
|
|||
instance SubstType a => SubstType [a] where
|
||||
apply s = map (apply s)
|
||||
|
||||
instance SubstType T.Id where
|
||||
apply s (name, t) = (name, apply s t)
|
||||
|
||||
-- | Apply substitutions to the environment.
|
||||
applySt :: Subst -> Infer a -> Infer a
|
||||
applySt s = local (\st -> st{vars = apply s (vars st)})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue