diff options
| author | Roman Smrž <roman.smrz@seznam.cz> | 2026-08-26 21:29:08 +0200 |
|---|---|---|
| committer | Roman Smrž <roman.smrz@seznam.cz> | 2026-08-27 23:04:38 +0200 |
| commit | 4145e966859dccc5bf7fac1f1c74b3efd8b6b7e9 (patch) | |
| tree | ea18363a09f6bc6c014437ad8a9569a431ddf203 /src/Parser/Expr.hs | |
| parent | a9d6eacb3aaa0e7acc5abc931061e07549f1c20e (diff) | |
Use closure instead of failing with ambiguous type for argument types with free variables
Diffstat (limited to 'src/Parser/Expr.hs')
| -rw-r--r-- | src/Parser/Expr.hs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Parser/Expr.hs b/src/Parser/Expr.hs index 6b458c4..ec5e2b4 100644 --- a/src/Parser/Expr.hs +++ b/src/Parser/Expr.hs @@ -523,9 +523,9 @@ applyFunctionArguments args sexpr@(SomeExpr (expr :: Expr a)) unexpectedArguments unexpectedArgs t <- fromMaybe (ExprTypeVar tvar) . M.lookup tvar <$> gets testTypeUnif resolveKnownTypeVars res' >>= \case - res''@(ExprTypePrim (Proxy :: Proxy r)) -> + ( res''@(ExprTypePrim (Proxy :: Proxy r)), _ ) -> return $ SomeExpr (ArgsApp used (ExposeFunType args' (TypeApp res'' t expr) :: Expr (FunctionType r))) - r -> + ( r, _ ) -> return $ SomeExpr (ArgsApp used (ExposeFunType args' (TypeApp r t expr) :: Expr (FunctionType DynamicType))) _ -> do unexpectedArguments args @@ -537,7 +537,7 @@ applyFunctionArguments args sexpr@(SomeExpr (expr :: Expr a)) ( used, ( _, unexpectedArgs ) ) <- unifyArguments args' args unexpectedArguments unexpectedArgs resolveKnownTypeVars res' >>= \case - ExprTypePrim (Proxy :: Proxy r) + ( ExprTypePrim (Proxy :: Proxy r), _ ) | Just (Refl :: a :~: FunctionType r) <- eqT -> return $ SomeExpr (ArgsApp used expr) _ |