Commit graph

14 commits

Author SHA1 Message Date
John Wiegley 39f772ef3c Restore monadic abstraction (to support importFile), fix attribute sets 2018-03-28 14:45:10 -07:00
John Wiegley 124530c9a9 Fix at-right patterns 2018-03-27 22:53:52 -07:00
John Wiegley 3a29249e43 Normalize import statements, add option parsing 2018-03-27 21:59:27 -07:00
John Wiegley 1e0e47d064 Remove monadic context from evalExpr: we weren't using it! 2018-03-27 19:07:08 -07:00
John Wiegley 278916a9ab Further work on argument evaluation 2018-03-27 18:42:31 -07:00
John Wiegley ecd18e3da3 Merge branch 'master' into fix-recursive-argument-set 2018-03-27 14:34:28 -07:00
Georges Dubus 2e26bd75a5 Fix a bug where defaultargs are absent from the atpattern argument 2018-03-11 12:15:33 +01:00
Georges Dubus 0f7332636e Add support for variadic parameters
Everything was already in place, but not used for variadic parameters.

On the other hand fixed parameters sets are currently bugged, as they don't
reject extra arguments (they act like variadic parameters set). This commit adds
a TODO mentionning that.
2018-03-09 14:09:43 +01:00
Georges Dubus 6a8ae208b4 Use environment in evaluation of function definitions 2018-03-01 20:04:54 +01:00
Georges Dubus e73fc5d196 More WIP 2018-02-13 15:49:46 +01:00
Georges Dubus 7b651303e2 WIP fix recursive default args 2018-01-29 19:56:58 +01:00
Georges Dubus b61b5791bb Change the environment in evaluation to be a Map Text (NValue m)
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.
2018-01-28 23:27:33 +01:00
Allen Nelson 50a3d0d0db make tests pass 2016-01-23 15:51:34 -06:00
Anders Papitto 00d7f06dd0 add some evaluation tests and fix bug 2015-12-20 22:17:34 -08:00