John Wiegley
718b6e4220
Also coerce URIs to paths
2018-04-17 21:43:57 -07:00
John Wiegley
25f1e02966
Coerce URIs to strings
2018-04-17 21:41:26 -07:00
John Wiegley
f7d4374da5
Sets can coerce to strings if they contain an "outPath" key
2018-04-17 19:10:36 -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
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
ddb125aea9
Add new instances in Nix.Convert
2018-04-15 23:00:09 -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
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
13233e1ee4
Add more instances to Nix.Convert
2018-04-14 23:52:21 -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
58b65d2ce1
Don't evaluate to normal form by default in the top level evaluators
2018-04-13 19:29:18 -07:00
John Wiegley
6c9cbf241a
Rewrite ToNix/FromNix, although Builtins.hs is not using it yet
2018-04-13 18:09:12 -07:00