(.using
  [library
   [lux {"-" and}
    ["$" documentation {"+" documentation:}]
    [control
     ["<>" parser
      ["<[0]>" code]]]
    [data
     ["[0]" text {"+" \n}
      ["%" format {"+" format}]]]
    [macro
     ["[0]" template]]]]
  [\\library
   ["[0]" /]]
  ["[0]" / "_"
   ["[1][0]" date]
   ["[1][0]" day]
   ["[1][0]" duration]
   ["[1][0]" instant]
   ["[1][0]" month]
   ["[1][0]" year]])

(template [<name> <doc>]
  [(documentation: <name>
     <doc>)]

  [/.milli_seconds "Number of milli-seconds in a second."]
  [/.seconds "Number of seconds in a minute."]
  [/.minutes "Number of minutes in an hour."]
  [/.hours "Number of hours in an day."]
  )

(documentation: /.Time
  "Time is defined as milliseconds since the start of the day (00:00:00.000).")

(documentation: /.midnight
  "The instant corresponding to the start of the day: 00:00:00.000")

(documentation: /.of_millis
  ""
  [(of_millis milli_seconds)])

(documentation: /.Clock
  "A clock marking the specific hour, minute, second, and milli-second in a day.")

(documentation: /.clock
  ""
  [(clock time)])

(documentation: /.time
  ""
  [(time clock)])

(documentation: /.codec
  (format "Based on ISO 8601."
          \n "For example: 21:14:51.827"))

(.def: .public documentation
  (.List $.Module)
  ($.module /._
            ""
            [..milli_seconds
             ..seconds
             ..minutes
             ..hours
             ..Time
             ..midnight
             ..of_millis
             ..Clock
             ..clock
             ..time
             ..codec
             ($.default /.time_exceeds_a_day)
             ($.default /.invalid_hour)
             ($.default /.invalid_minute)
             ($.default /.invalid_second)
             ($.default /.millis)
             ($.default /.equivalence)
             ($.default /.order)
             ($.default /.enum)
             ($.default /.parser)]
            [/date.documentation
             /day.documentation
             /duration.documentation
             /instant.documentation
             /month.documentation
             /year.documentation]))
