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

(def .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."
          [(iterations step init)])

        ($.definition /.repeated
          "Repeat a value forever."
          [(repeated x)])

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

        ($.definition /.item
          ""
          [(item idx stream)])

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

        ($.definition /.partition
          (format "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.")
          [(partition left? xs)])

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