... 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]]
    [collection
     ["[0]" list]]]]]
 [\\library
  ["[0]" /]]
 ["[0]" /
  ["[1][0]" free]])

(the .public documentation
  (List $.Documentation)
  (list.partial ($.module /._
                          "")
                ($.definition (/.CoMonad !)
                  (%.message "Co-monads are the opposite/complement to monads."
                             \n "Co-monadic structures are often infinite in size and built upon lazily-evaluated functions."))

                ($.definition /.be
                  "A co-monadic parallel to the 'do' macro."
                  ($.example (' (let [square (function (_ n) (* n n))]
                                  (be comonad
                                    [inputs (iterate ++ +2)]
                                    (square (out inputs)))))))

                /free.documentation))
