fTy <- instantiateCall =<< zonk (nameTyp f)
actual <- mapM lintExp args
res <- freshTy "b"
unify loc fTy $ TArrow actual res
return res
but the code for checking Call looks like
fTy <- zonk (nameTyp f)
actual <- forM args $ \arg -> case arg of
CAExp e -> CAExp <$> lintExp e
CAComp c -> CAComp <$> lintComp c
res <- freshCTy "b"
unify loc fTy $ CTArrow actual res
return res
with no call to instantiate(C)Call. This means that we do not support polymorphism in computation functions, which is a bit surprising. I haven't changed this right now because if we do change this we should also add some tests for it (and anyway it's an orthogonal concern involving a single changed line).
Note that ctComp already supports polymorphic computation functions.
Currently the code for checking
ECall
looks likebut the code for checking
Call
looks likewith no call to
instantiate(C)Call
. This means that we do not support polymorphism in computation functions, which is a bit surprising. I haven't changed this right now because if we do change this we should also add some tests for it (and anyway it's an orthogonal concern involving a single changed line).Note that
ctComp
already supports polymorphic computation functions.