summaryrefslogtreecommitdiff
path: root/src/Parser.hs
diff options
context:
space:
mode:
authorRoman Smrž <roman.smrz@seznam.cz>2024-12-06 21:09:01 +0100
committerRoman Smrž <roman.smrz@seznam.cz>2024-12-07 09:16:28 +0100
commit2664fe5010189e4afdc52608a793910331330376 (patch)
treed6231fbe310de3461ce70060d867ff13f0cddf4b /src/Parser.hs
parent51d78df83fc69df8e54cb72212a91576da8bf5b0 (diff)
Functions returning arbitrary types
Diffstat (limited to 'src/Parser.hs')
-rw-r--r--src/Parser.hs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/Parser.hs b/src/Parser.hs
index 940bd60..1339ec8 100644
--- a/src/Parser.hs
+++ b/src/Parser.hs
@@ -54,6 +54,11 @@ parseDefinition = label "symbol definition" $ toplevel ToplevelDefinition $ do
atypes' <- getInferredTypes atypes
( name, ) . SomeExpr . ArgsReq atypes' . FunctionAbstraction <$> replaceDynArgs (mconcat steps)
return $ L.IndentSome Nothing finish testStep
+ , do
+ osymbol "="
+ SomeExpr (expr :: Expr e) <- someExpr
+ atypes' <- getInferredTypes atypes
+ L.IndentNone . ( name, ) . SomeExpr . ArgsReq atypes' . FunctionAbstraction <$> replaceDynArgs expr
]
modify $ \s -> s { testVars = fmap someExprType def : testVars s }
return def