b61b5791bb
Currently, the environment is passed as a `NValue m`, but is assumed to be a set every single time it is used. This commit changes it `Map Text (NValue m)`. Since this is used a lot, it defines a new type alias: ``` type ValueSet m = Map.Map Text (NValue m) ``` This has multiples benefits: - Simplify some code by removing all the checks that the env is indeed a set - Simplify the usage of the module by making clear that we need a set as the environment. (I especially like this, since it took me a while to figure out what that argument was supposed to be the first time). - Make it simple to inject functions in the environment (for example to have builtins) since now the function definition doesn't need to unwrap the set. |
||
---|---|---|
.. | ||
EvalTests.hs | ||
Main.hs | ||
ParserTests.hs | ||
PrettyTests.hs | ||
ShorthandTests.hs |