John Wiegley
3233c9cb31
Restore the pretty show instance for NValue m (orphaned in Pretty for now)
2018-04-10 21:11:46 -07:00
John Wiegley
58345c29f9
Mark ind-string-14.nix as broken, since I have no answer for it now
2018-04-10 18:20:58 -07:00
John Wiegley
2a6ba86ad5
Capitalize a test category name
2018-04-10 17:15:23 -07:00
John Wiegley
dcd081d899
Add directory dependency for the tests
2018-04-10 12:38:14 -07:00
Doug Beardsley
13fc5bcd6d
Add builtins.split
...
Finishes issue #113
2018-04-10 12:33:31 -07:00
John Wiegley
9d7f25d368
All is building with Megaparsec now, but many parsing tests fail
2018-04-09 17:12:16 -07:00
Doug Beardsley
1b7dac071d
Test to catch a bug in builtins.match
...
Also added infrastructure for comparing against current nix behavior,
not just current nix tests.
2018-04-07 15:07:09 -07:00
John Wiegley
d9047cc216
Factor out some code into new module Nix.Value
2018-04-07 11:38:12 -07:00
Ryan Trinkle
49a5b613d1
Use non-tracing evaluator in tests
2018-04-04 02:00:15 -04:00
Ryan Trinkle
c506464d99
Fix default_value_in_atpattern
...
Default values are *not* added to @-bound variables in Nix (checked with nix-repl)
2018-04-03 22:21:19 -04:00
John Wiegley
973d6d873b
Add an evaluation test for issue #108
2018-04-03 14:43:40 -07:00
John Wiegley
c3eb7a94b9
Add basic support for quasi-quotation of Nix expressions in Haskell
2018-04-03 14:21:33 -07:00
John Wiegley
ffb97610db
Generalize the thunking mechanism, so it can be used over Symbolics
2018-04-01 23:48:07 -07:00
John Wiegley
d7228c6a75
Move language feature pragmas into each Haskell file, not .cabal
2018-04-01 22:49:12 -07:00
John Wiegley
d08ca26da0
Add informative backtraces on evaluation failure
2018-03-30 23:10:44 -07:00
John Wiegley
74cc1a2ad5
Split MonadNix into evaluation and environmental effects
2018-03-30 14:25:03 -07:00
John Wiegley
9f6c2ba948
Move a lot of code around into new modules
2018-03-30 14:08:38 -07:00
John Wiegley
8e944cc223
Fix the tests
2018-03-30 02:00:36 -07:00
John Wiegley
4e698d76fa
More fixes to lazy evaluation and scoping
2018-03-30 01:11:27 -07:00
John Wiegley
8f24c7b645
Implement laziness, although without support for concurrency
2018-03-29 15:35:12 -07:00
John Wiegley
84918aa1d3
Remove the MonadFix requirement, it was not needed; fix NRecSet
2018-03-28 23:52:07 -07:00
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