summaryrefslogtreecommitdiff
path: root/src/Parser/Core.hs
diff options
context:
space:
mode:
authorRoman Smrž <roman.smrz@seznam.cz>2026-05-01 20:25:20 +0200
committerRoman Smrž <roman.smrz@seznam.cz>2026-05-02 20:54:00 +0200
commit0905fe68591a3dad83f87d5ac805b674c0b88c76 (patch)
tree3463598b6e4fb2f3d639ddca92c90146495d19a0 /src/Parser/Core.hs
parent62b65e16f5ef4e59dcfbdc10ae2b3cd419d79d7a (diff)
Arbitrary type expression as function argumentsHEADmaster
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 $