(.using
  [library
   [lux {"-" if loop}
    ["$" documentation {"+" documentation:}]
    [data
     [text {"+" \n}
      ["%" format {"+" format}]]]
    [macro
     ["[0]" template]]]]
  [\\library
   ["[0]" /]])

(documentation: /.pre
  (format "Pre-conditions."
          \n "Given a test and an expression to run, only runs the expression if the test passes."
          \n "Otherwise, an error is raised.")
  [(pre (i.= +4 (i.+ +2 +2))
        (foo +123 +456 +789))])

(documentation: /.post
  (format "Post-conditions."
          \n "Given a predicate and an expression to run, evaluates the expression and then tests the output with the predicate."
          \n "If the predicate returns #1, returns the value of the expression."
          \n "Otherwise, an error is raised.")
  [(post i.even?
         (i.+ +2 +2))])

(.def: .public documentation
  (.List $.Module)
  ($.module /._
            ""
            [..pre
             ..post
             ($.default /.pre_condition_failed)
             ($.default /.post_condition_failed)]
            []))
