about summary refs log tree commit diff
path: root/doc/manual
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2014-07-04T11·34+0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2014-07-04T11·34+0200
commitbeaf3e90aff14664b98f2c7ab7387c9fa4354fd1 (patch)
treecc1bab6524c7e616697efbae788e4b997a3213c4 /doc/manual
parente82951fe23daa961ef18b0c5cc9ba1f5d8906186 (diff)
Add builtin function ‘fromJSON’
Fixes #294.
Diffstat (limited to 'doc/manual')
-rw-r--r--doc/manual/builtins.xml17
1 files changed, 17 insertions, 0 deletions
diff --git a/doc/manual/builtins.xml b/doc/manual/builtins.xml
index 6a472291c363..b289c6f0ed4b 100644
--- a/doc/manual/builtins.xml
+++ b/doc/manual/builtins.xml
@@ -257,6 +257,22 @@ stdenv.mkDerivation {
   </varlistentry>
 
 
+  <varlistentry><term><function>builtins.fromJSON</function> <replaceable>e</replaceable></term>
+
+    <listitem><para>Convert a JSON string to a Nix
+    value. For example,
+
+<programlisting>
+builtins.fromJSON ''{"x": [1, 2, 3], "y": null}''
+</programlisting>
+
+    returns the value <literal>{ x = [ 1 2 3 ]; y = null;
+    }</literal>. Floating point numbers are not
+    supported.</para></listitem>
+
+  </varlistentry>
+
+
   <varlistentry><term><function>builtins.getAttr</function>
   <replaceable>s</replaceable> <replaceable>set</replaceable></term>
 
@@ -762,6 +778,7 @@ in foo</programlisting>
 
   </varlistentry>
 
+
   <varlistentry><term><function>builtins.toPath</function> <replaceable>s</replaceable></term>
 
     <listitem><para>Convert the string value