summaryrefslogtreecommitdiff
path: root/src/Parser/Core.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Parser/Core.hs')
-rw-r--r--src/Parser/Core.hs11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/Parser/Core.hs b/src/Parser/Core.hs
index e1a4035..c12afdd 100644
--- a/src/Parser/Core.hs
+++ b/src/Parser/Core.hs
@@ -273,6 +273,17 @@ unifySomeExpr off stype sexpr@(SomeExpr expr)
_ <- unify off (ExprTypeVar tvar) (someExprType sexpr)
return sexpr
+ | ExprTypeFunction args res <- stype
+ = case someExprType sexpr of
+ ExprTypeFunction args' res' -> do
+ _ <- unify off args args'
+ _ <- unify off res res'
+ return sexpr
+ _ -> do
+ _ <- unify off args (ExprTypeArguments mempty)
+ SomeExpr expr' <- unifySomeExpr off res sexpr
+ return $ SomeExpr $ FunctionAbstraction expr'
+
| otherwise
= do
parseError $ FancyError off $ S.singleton $ ErrorFail $ T.unpack $