... This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
... If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.

(.require
 [library
  [lux (.except)
   ["$" documentation]
   [data
    [text (.only \n)
     ["%" \\injection]]]]]
 [\\library
  ["[0]" /]])

(the .public documentation
  (List $.Documentation)
  (list ($.module /._
                  "")

        ($.definition /.head)
        ($.definition /.tail)
        ($.definition /.functor)
        ($.definition /.comonad)
        ($.definition /.while)
        ($.definition /.until)
        ($.definition /.first)
        ($.definition /.after)
        ($.definition /.split_when)
        ($.definition /.split_at)

        ($.definition (/.Stream it)
          "An infinite sequence of values.")

        ($.definition /.iterations
          "A stateful way of infinitely calculating the values of a stream."
          ($.example (' (iterations step init))))

        ($.definition /.repeated
          "Repeat a value forever."
          ($.example (' (repeated x))))

        ($.definition /.cycle
          "Go over the elements of a list forever."
          ($.example (' (cycle [start next]))))

        ($.definition /.item
          ""
          ($.example (' (item idx stream))))

        ($.definition /.only
          "A new stream only with items that satisfy the predicate."
          ($.example (' (only predicate stream))))

        ($.definition /.partition
          (%.message "Split a stream in two based on a predicate."
                     \n "The left side contains all entries for which the predicate is #1."
                     \n "The right side contains all entries for which the predicate is #0.")
          ($.example (' (partition left? xs))))

        ($.definition /.pattern
          (%.message "Allows destructuring of streams in pattern-matching expressions."
                     \n "Caveat emptor: Only use it for destructuring, and not for testing values within the streams.")
          ($.example (' (let [(pattern x y z _tail) (some_stream_func +1 +2 +3)]
                          (func x y z)))))
        ))
