From ea8a03d7cb0fd7524b50df4e13ce310c8f3fc371 Mon Sep 17 00:00:00 2001
From: ocelot-inc <pgulutzan@ocelot.ca>
Date: Fri, 10 Apr 2015 20:10:05 -0600
Subject: [PATCH] change console, add fun

---
 doc/sphinx/reference/console.rst | 17 ++++++++--------
 doc/sphinx/reference/fun.rst     | 35 ++++++++++++++++++++++++++++++++
 doc/sphinx/reference/index.rst   |  1 +
 3 files changed, 44 insertions(+), 9 deletions(-)
 create mode 100644 doc/sphinx/reference/fun.rst

diff --git a/doc/sphinx/reference/console.rst b/doc/sphinx/reference/console.rst
index 9b5da77a8a..697ba4d7a2 100644
--- a/doc/sphinx/reference/console.rst
+++ b/doc/sphinx/reference/console.rst
@@ -50,23 +50,22 @@ host/port.
         ...
         198.18.44.44:3301> -- prompt is telling us that server is remote
 
-.. function:: listen(host, port)
+.. function:: listen(URI)
 
-    Listen on host:port. The primary way of listening for incoming requests
-    is via the host and port, or :ref:`URI`, specified in ``box.cfg{listen=...}``.
-    The alternative way of listening is via the host and port, or URI,
+    Listen on URI. The primary way of listening for incoming requests
+    is via the connection-information string, or :ref:`URI`, specified in ``box.cfg{listen=...}``.
+    The alternative way of listening is via the URI
     specified in ``console.listen(...)``. This alternative way is called
     "administrative" or simply "admin port".
     The listening is usually over a local host with a Unix socket,
-    specified as host = 'unix/', port = 'path/to/something.sock'.
+    specified with host = 'unix/', port = 'path/to/something.sock'.
 
-    :param string host:
-    :param number port:
+    :param string uri:
 
-    The "admin" address is the port or :ref:`URI` to listen on for administrative
+    The "admin" address is the :ref:`URI` to listen on for administrative
     connections. It has no default value, so it must be specified if
     connections will occur via telnet. It is not used unless assigned a
-    value. The parameters may be expressed with :ref:`URI` = Universal Resource
+    value. The parameters are expressed with :ref:`URI` = Universal Resource
     Identifier format, for example "unix://unix_domain_socket", or as a
     numeric TCP port. Connections are often made with telnet.
     A typical port value is 3313.
diff --git a/doc/sphinx/reference/fun.rst b/doc/sphinx/reference/fun.rst
new file mode 100644
index 0000000000..6fbbd21b6f
--- /dev/null
+++ b/doc/sphinx/reference/fun.rst
@@ -0,0 +1,35 @@
+-------------------------------------------------------------------------------
+                                Package `fun`
+-------------------------------------------------------------------------------
+
+Lua fun, also known as the Lua Functional Library, takes advantage
+of the features of LuaJIT to help users create complex functions.
+Inside the package are "sequence processors" such as
+map, filter, reduce, zip -- they take a user-written function as
+an argument and run it against every element in a sequence, which
+can be faster or more convenient than a user-written loop.
+Inside the package are "generators" such as range, tabulate, and
+rands -- they return a bounded or boundless series of values.
+Within the package are "reducers", "filters", "composers" ...
+or, in short, all the important features found in languages like
+Standard ML, Haskell, or Erlang.
+
+The full documentation is `On the luafun section of github`_.
+However, the first chapter can be skipped because installation
+is already done, it's inside Tarantool. All that is needed is the usual require request.
+After that, all the operations described in the
+Lua fun manual will work, provided they are preceded by the
+name returned by the require request.
+For example:
+
+.. code-block:: lua
+
+    localhost> fun = require('fun')
+    localhost> for _k, a in fun.range(3) do print(a) end
+    1
+    2
+    3
+    ---
+    ...
+
+.. _On the luafun section of github: http://rtsisyk.github.io/luafun
diff --git a/doc/sphinx/reference/index.rst b/doc/sphinx/reference/index.rst
index 51d438df2b..e35d0cacec 100644
--- a/doc/sphinx/reference/index.rst
+++ b/doc/sphinx/reference/index.rst
@@ -19,6 +19,7 @@
     console
     log
     tap
+    fun
     pickle
     other
     expirationd
-- 
GitLab