(.using
  [library
   [lux {"-" nat int rev list type or and symbol}
    ["$" documentation {"+" documentation:}]
    [data
     [text {"+" \n}
      ["%" format {"+" format}]]]
    [macro
     ["[0]" template]]]]
  [\\library
   ["[0]" /]])

(documentation: /.Mutation
  "A mutation of binary data, tracking where in the data to transform.")

(documentation: /.Specification
  "A description of how to transform binary data.")

(documentation: /.no_op
  "A specification for empty binary data.")

(documentation: /.instance
  "Given a specification of how to construct binary data, yields a binary blob that matches it.")

(documentation: (/.Writer it)
  "An operation that knows how to write information into a binary blob.")

(documentation: /.result
  "Yields a binary blob with all the information written to it."
  [(result writer value)])

(documentation: /.or
  ""
  [(or left right)])

(documentation: /.and
  ""
  [(and pre post)])

(documentation: /.rec
  "A combinator for recursive writers."
  [(rec body)])

(documentation: /.segment
  "Writes at most 'size' bytes of an input binary blob."
  [(segment size)])

(.def: .public documentation
  (.List $.Module)
  ($.module /._
            ""
            [..Mutation
             ..Specification
             ..no_op
             ..instance
             ..Writer
             ..result
             ..or
             ..and
             ..rec
             ..segment
             ($.default /.monoid)
             ($.default /.bits/8)
             ($.default /.bits/16)
             ($.default /.bits/32)
             ($.default /.bits/64)
             ($.default /.any)
             ($.default /.bit)
             ($.default /.nat)
             ($.default /.int)
             ($.default /.rev)
             ($.default /.frac)
             ($.default /.binary/8)
             ($.default /.binary/16)
             ($.default /.binary/32)
             ($.default /.binary/64)
             ($.default /.utf8/8)
             ($.default /.utf8/16)
             ($.default /.utf8/32)
             ($.default /.utf8/64)
             ($.default /.text)
             ($.default /.sequence/8)
             ($.default /.sequence/16)
             ($.default /.sequence/32)
             ($.default /.sequence/64)
             ($.default /.maybe)
             ($.default /.list)
             ($.default /.set)
             ($.default /.symbol)
             ($.default /.type)
             ($.default /.location)
             ($.default /.code)]
            []))
