diff options
| author | Roman Smrž <roman.smrz@seznam.cz> | 2026-05-01 20:25:20 +0200 |
|---|---|---|
| committer | Roman Smrž <roman.smrz@seznam.cz> | 2026-05-02 20:54:00 +0200 |
| commit | 0905fe68591a3dad83f87d5ac805b674c0b88c76 (patch) | |
| tree | 3463598b6e4fb2f3d639ddca92c90146495d19a0 /src/Parser/Core.hs | |
| parent | 62b65e16f5ef4e59dcfbdc10ae2b3cd419d79d7a (diff) | |
Diffstat (limited to 'src/Parser/Core.hs')
| -rw-r--r-- | src/Parser/Core.hs | 11 |
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 $ |