John Wiegley
bf08deed58
Handle "pathed" rec set attrs by desugaring binds to nested rec sets
2018-04-17 11:53:35 -07:00
John Wiegley
f4fbbe7903
Make NKeyName and NString instances of Hashable
2018-04-17 11:33:20 -07:00
John Wiegley
895921bca4
Fix typo
2018-04-16 22:35:21 -07:00
John Wiegley
4fa20eac49
Change README.md back to 'cabal', since we install cabal-install in the nix-shell
2018-04-16 22:24:06 -07:00
John Wiegley
1e7079414e
Small whitespace change in default.nix
2018-04-16 21:57:27 -07:00
John Wiegley
11d074a355
Simplify more functions in Builtins.hs
...
Specifically, reduce the number of explicit calls to 'force'.
2018-04-16 21:47:45 -07:00
John Wiegley
c9158273a4
Change all builtins to go from m (NValue m) -> m (NValue m)
...
This avoids a needless thunk encapsulation.
2018-04-16 21:39:41 -07:00
John Wiegley
79affd4835
Merge pull request #182 from hSloan/shortenBuiltins
...
use fromValue in more places in builtins
2018-04-16 20:41:47 -07:00
hsloan
eef5b3fb30
use fromValue in more places in builtins
...
do this to avoid pattern matching and throwing errors explicitly
2018-04-16 23:18:06 -04:00
John Wiegley
8c4b134622
A minor simplification in the parser
2018-04-16 18:45:28 -07:00
John Wiegley
136708ae8a
Simplify some things in default.nix
2018-04-16 15:10:47 -07:00
John Wiegley
ea0942a86e
Minor code simplification
2018-04-16 15:02:04 -07:00
John Wiegley
2409e4dd8d
Some minor changes in default.nix
2018-04-16 11:37:45 -07:00
John Wiegley
3901a32e15
Remove MText abstraction, which also duplicated effort in Nix.Convert
2018-04-16 10:56:29 -07:00
John Wiegley
df9092b4d2
Allow implicit coercion from paths to strings via FromValue/FromNix
2018-04-16 10:55:57 -07:00
John Wiegley
c7ad39b151
Fix error reporting due to failed conversions
2018-04-16 10:54:55 -07:00
John Wiegley
18337535ca
Allow coercion from floats to integers
2018-04-16 10:12:29 -07:00
John Wiegley
5711f96743
Add a missing Path coercion
2018-04-16 10:12:15 -07:00
John Wiegley
9d378d61d1
Provide a default implementation that can be used for evalWith
2018-04-16 10:10:47 -07:00
John Wiegley
b1f6a99dbc
Simplify more functions in Builtins using Nix.Convert
2018-04-15 23:01:22 -07:00
John Wiegley
ddb125aea9
Add new instances in Nix.Convert
2018-04-15 23:00:09 -07:00
John Wiegley
6f7f642b15
Disable warnings in Lint.hs for now
2018-04-15 23:00:02 -07:00
John Wiegley
a0372918dd
More minor cleanups in Builtins.hs
2018-04-15 22:01:01 -07:00
John Wiegley
a5139cece6
Add a comment in Lint.hs, to explain some instances without bodies
2018-04-15 21:08:29 -07:00
John Wiegley
dc23fb71fe
Some further simplifications in Builtins.hs
2018-04-15 21:03:43 -07:00
John Wiegley
dacd0ca0db
Restore the "normal form recursive" ToNix/FromNix type classes
...
This allows for very easily written Builtins
2018-04-15 20:43:04 -07:00
John Wiegley
230eb99ade
Rename fromNixMay -> fromValueMay
2018-04-15 20:22:24 -07:00
John Wiegley
fb6191c949
Rename the internal version of ToNix/FromNix to ToValue/FromValue
2018-04-15 19:05:44 -07:00
John Wiegley
ef82d5e9f2
Make ToNix monadic, to avoid making any assumptions about its use
2018-04-15 16:21:47 -07:00
John Wiegley
451ccf7c60
Fix test eval-okay-autoargs
2018-04-15 02:22:33 -07:00
John Wiegley
cce65fb106
Add argument processing for the tests; test still not working yet
2018-04-15 02:16:06 -07:00
John Wiegley
42c0503de8
Move more code into Nix.Entry, to better support the tests
2018-04-15 02:02:26 -07:00
John Wiegley
88fba61ddb
Add a comment to Convert.hs
2018-04-15 01:46:08 -07:00
John Wiegley
5ce5ac8791
Get rid of ConvertValue in favor of Nix.Context
...
There remains some simplification work to be done, still, as there is much
duplication in Builtins.hs as things stand now. At least for now only one type
class-based, automatic conversion mechanism exists.
2018-04-15 01:43:01 -07:00
John Wiegley
a6b004d04b
Make some uses of Nix.Convert with forcing more explicit
2018-04-15 00:51:50 -07:00
John Wiegley
7f9a7c5ce8
Remove posFromSourcePos, it is no longer needed
2018-04-14 23:55:37 -07:00
John Wiegley
16e02088d8
More changes in Builtins.hs to use Nix.Convert
2018-04-14 23:53:59 -07:00
John Wiegley
ca0ab497a1
Resolve some warnings in Builtins.hs
2018-04-14 23:53:31 -07:00
John Wiegley
13233e1ee4
Add more instances to Nix.Convert
2018-04-14 23:52:21 -07:00
John Wiegley
dab90ab290
Whitespace fix
2018-04-14 23:51:56 -07:00
John Wiegley
ca24430bc9
Change Builtins.hs to use the ToNix/FromNix defined in Convert.hs
2018-04-14 22:58:50 -07:00
John Wiegley
36a59cb8c5
Drop some unused code from Nix.Atoms; see Nix.Convert instead
2018-04-14 09:47:35 -07:00
John Wiegley
4f17250d11
More simplifying of imports
2018-04-14 09:44:55 -07:00
John Wiegley
169a2140dd
Add to the imports listed in Nix.hs
2018-04-14 09:39:03 -07:00
John Wiegley
eadf714036
If MATCHING_TESTS=yes (default for Travis), compare eval tests to Nix
2018-04-13 22:34:24 -07:00
John Wiegley
b0561da940
Minor simplification to attrSetAlter
2018-04-13 22:24:17 -07:00
Ryan Trinkle
7889e2a9e8
Add a couple of tests for inherit
scoping
2018-04-14 00:14:26 -04:00
Ryan Trinkle
6366620542
Allow imports from strings
2018-04-13 23:30:21 -04:00
John Wiegley
274e28deb0
Use the scoping mechanism rather than a direct lookup
...
This is just done to ensure consistency of behavior.
2018-04-13 20:29:14 -07:00
Ryan Trinkle
470a548454
Fix scoping of inherit
2018-04-13 23:22:06 -04:00