diff options
Diffstat (limited to 'src/Parser/Core.hs')
| -rw-r--r-- | src/Parser/Core.hs | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/Parser/Core.hs b/src/Parser/Core.hs index 1b049c8..c317067 100644 --- a/src/Parser/Core.hs +++ b/src/Parser/Core.hs @@ -207,6 +207,14 @@ unifyExpr off pa expr = if -> return expr | DynVariable stype sline name <- expr + , ExprTypeForall qvar itype <- stype + -> do + tvar <- newTypeVar + _ <- unify off (ExprTypePrim (Proxy :: Proxy a)) $ renameVarInType qvar tvar itype + rtype <- M.lookup tvar <$> gets testTypeUnif + return $ TypeApp (Variable sline name) $ fromMaybe (ExprTypeVar tvar) rtype + + | DynVariable stype sline name <- expr -> do _ <- unify off (ExprTypePrim (Proxy :: Proxy a)) stype return $ Variable sline name @@ -215,12 +223,7 @@ unifyExpr off pa expr = if -> do unifyExpr off pa expr' - | TypeQuant qvar expr' <- expr - -> do - tvar <- newTypeVar - unifyExpr off pa $ renameTypeVar qvar tvar expr' - - | TypeLambda t tvar f <- expr + | TypeLambda tvar t f <- expr -> do _ <- unify off (ExprTypePrim (Proxy :: Proxy a)) t Just (ExprTypePrim pt) <- M.lookup tvar <$> gets testTypeUnif |