Commit graph

241 commits

Author SHA1 Message Date
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 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 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 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 ca24430bc9 Change Builtins.hs to use the ToNix/FromNix defined in Convert.hs 2018-04-14 22:58:50 -07:00
Ryan Trinkle 6366620542 Allow imports from strings 2018-04-13 23:30:21 -04:00
John Wiegley c5f001a7d4 For now, allow pathExists to accept a string 2018-04-13 18:35:51 -07:00
John Wiegley 6c9cbf241a Rewrite ToNix/FromNix, although Builtins.hs is not using it yet 2018-04-13 18:09:12 -07:00
John Wiegley 7f6a64da04 More corrections to the search path logic
Fixes #112
2018-04-13 16:37:11 -07:00
John Wiegley caa897af4a Introduce new helper function Exec.foldNixPath 2018-04-13 10:38:57 -07:00
John Wiegley c9c2db5cb8 Correct the behavior of baseNameOf 2018-04-13 01:20:33 -07:00
John Wiegley b6b3c61176 Add the __nixPath builtin 2018-04-13 01:20:24 -07:00
John Wiegley e9299dce7b Implement builtins.fetchTarball at the moment by calling nix-instantiate 2018-04-11 13:56:18 -07:00
John Wiegley ffa8d85dd2 Move handling of with statements into MonadEval 2018-04-11 11:53:30 -07:00
Doug Beardsley 714b78cbdc Fix remaining split test failure 2018-04-11 02:06:47 -04:00
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 74de14dc7d Restore the linter, to some degree, at least for the language tests 2018-04-10 21:02:01 -07:00
Doug Beardsley 9ab6455bfc Fix bug in builtins.split for multiple matches 2018-04-10 12:33:31 -07:00
Doug Beardsley 13fc5bcd6d Add builtins.split
Finishes issue #113
2018-04-10 12:33:31 -07:00
John Wiegley a7e7e84795 Drop dependency on insert-ordered-containers
Fixes #161
2018-04-10 11:58:08 -07:00
John Wiegley 49d73fa767 Restore code in Builtins.hs 2018-04-10 09:02:17 -07:00
John Wiegley 4f9dec43cd More work on the megaparsec parser 2018-04-10 00:40:11 -07:00
John Wiegley 8f37f37986 Down to 16 basic test failures with megaparsec 2018-04-09 21:35:46 -07:00
John Wiegley 9d7f25d368 All is building with Megaparsec now, but many parsing tests fail 2018-04-09 17:12:16 -07:00
John Wiegley 9beb9364e0 The Megaparsec version of Parser.hs is at least compiling 2018-04-09 16:11:31 -07:00
John Wiegley 4c2eebbe40 Refactor evaluation using a type class 2018-04-09 00:52:10 -07:00
John Wiegley f6eb4c1353 Store a closure in NVClosure, instead of passing the scope 2018-04-07 22:46:05 -07:00
Ryan Trinkle 7c3b7d9482 When the user calls import on a directory, automatically append default.nix 2018-04-07 20:33:36 -04:00
John Wiegley 39e859fab5 Make use of Nix.Normal, move some more code to Nix.Value 2018-04-07 17:24:22 -07:00
John Wiegley 31e6aa8fb9 Implement __curPos as a primitive action during evaluation 2018-04-07 16:35:11 -07:00
Ryan Trinkle 33ae62534b Make map builtin lazier 2018-04-07 19:06:01 -04:00
Ryan Trinkle 628697d63b Merge branch 'master' of github.com:jwiegley/hnix
# Conflicts:
#	src/Nix/Monad.hs
#	src/Nix/Monad/Instance.hs
2018-04-07 18:39:57 -04:00
Ryan Trinkle 8b0de962b0 Add derivation builtin 2018-04-07 18:34:54 -04: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 aaaa82820f Don't distinguish between literal and env paths in values, just exprs 2018-04-07 14:52:24 -07:00
John Wiegley ea6a98f602 Implement builtins.tryEval 2018-04-07 14:33:15 -07:00
John Wiegley a704bb045f Commit the src/ directory 2018-04-07 12:02:50 -07:00