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

(def .public documentation
  (.List $.Documentation)
  (list ($.module /._
                  "The actor model of concurrency.")

        ($.definition /.poisoned)
        ($.definition /.dead)
        ($.definition /.alive?)
        ($.definition /.obituary')

        ($.definition (/.Actor state)
          "An entity that can react to messages (mail) sent to it concurrently.")

        ($.definition (/.Mail state)
          "A one-way message sent to an actor, without expecting a reply.")

        ($.definition (/.Obituary state)
          "Details on the death of an actor.")

        ($.definition (/.Behavior state)
          "An actor's behavior when mail is received.")

        ($.definition /.spawn!
          "Given a behavior and initial state, spawns an actor and returns it.")

        ($.definition /.obituary
          "Await for an actor to stop working.")

        ($.definition /.mail!
          "Send mail to an actor.")

        ($.definition (/.Message state output)
          "A two-way message sent to an actor, expecting a reply.")

        ($.definition /.tell!
          "Communicate with an actor through message-passing.")

        ($.definition /.default
          "Default actor behavior.")

        ($.definition /.poison!
          (format "Kills the actor by sending mail that will kill it upon processing,"
                  \n "but allows the actor to handle previous mail."))

        ($.definition /.Stop
          "A signal to stop an actor from observing a channel.")

        ($.definition /.observe!
          (format "Use an actor to observe a channel by transforming each datum"
                  \n "flowing through the channel into mail the actor can process."
                  \n "Can stop observing the channel by executing the Stop value."))
        ))
