diff options
author | Roman Smrž <roman.smrz@seznam.cz> | 2024-12-06 21:09:01 +0100 |
---|---|---|
committer | Roman Smrž <roman.smrz@seznam.cz> | 2024-12-07 09:16:28 +0100 |
commit | 2664fe5010189e4afdc52608a793910331330376 (patch) | |
tree | d6231fbe310de3461ce70060d867ff13f0cddf4b /src/Parser.hs | |
parent | 51d78df83fc69df8e54cb72212a91576da8bf5b0 (diff) |
Functions returning arbitrary types
Diffstat (limited to 'src/Parser.hs')
-rw-r--r-- | src/Parser.hs | 5 |
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 |