summaryrefslogtreecommitdiff
path: root/src/Parser
diff options
context:
space:
mode:
authorRoman Smrž <roman.smrz@seznam.cz>2026-04-25 13:10:13 +0200
committerRoman Smrž <roman.smrz@seznam.cz>2026-04-25 15:22:59 +0200
commita84c4722a3774bb64e3e3616c16264d09c991378 (patch)
treea9702f327b624e7be746f71fd3daf44b3e11cd35 /src/Parser
parent81d6d9f99ce8ea56df2c926156a3e3600a1a4117 (diff)
Keep type info in HideType to support non-primitive types
Diffstat (limited to 'src/Parser')
-rw-r--r--src/Parser/Core.hs3
-rw-r--r--src/Parser/Expr.hs2
2 files changed, 3 insertions, 2 deletions
diff --git a/src/Parser/Core.hs b/src/Parser/Core.hs
index 4c49ead..e1a4035 100644
--- a/src/Parser/Core.hs
+++ b/src/Parser/Core.hs
@@ -219,7 +219,8 @@ unifyExpr off pa expr = if
_ <- unify off (ExprTypePrim (Proxy :: Proxy a)) stype
return $ Variable sline name
- | HideType expr' <- expr
+ | HideType (ExprTypePrim (_ :: Proxy b'')) (expr' :: Expr b') <- expr
+ , Just (Refl :: b'' :~: b') <- eqT
-> do
unifyExpr off pa expr'
diff --git a/src/Parser/Expr.hs b/src/Parser/Expr.hs
index 8d1fe03..3716c80 100644
--- a/src/Parser/Expr.hs
+++ b/src/Parser/Expr.hs
@@ -194,7 +194,7 @@ list = label "list" $ do
return $ SomeExpr $
TypeLambda tvar (ExprTypeApp (ExprTypeConstr1 (Proxy :: Proxy [])) [ ExprTypeVar tvar ]) $
\case
- (ExprTypePrim (Proxy :: Proxy a)) -> HideType $ Pure ([] :: [ a ])
+ (ExprTypePrim (Proxy :: Proxy a)) -> HideType (ExprTypePrim (Proxy @[ a ])) $ Pure ([] :: [ a ])
_ -> Undefined "incomplete type"
,do SomeExpr x <- someExpr