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

(documentation: /.Year
  (format "A year in the gregorian calendar."
          \n "Both negative (< 0) and positive (> 0) values are valid, but not 0."
          \n "This is because the first year of the gregorian calendar was year 1."))

(documentation: /.year
  "A valid year in the gregorian calendar, if possible."
  [(year value)])

(documentation: /.days
  "The amount of days in a typical year.")

(documentation: /.Period
  "An amount of years.")

(documentation: /.leaps
  "The number of leap years in a period of years."
  [(leaps year)])

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

(.def: .public documentation
  (.List $.Module)
  ($.module /._
            ""
            [..Year
             ..year
             ..days
             ..Period
             ..leaps
             ..codec
             ($.default /.there_is_no_year_0)
             ($.default /.value)
             ($.default /.epoch)
             ($.default /.leap)
             ($.default /.century)
             ($.default /.era)
             ($.default /.leap?)
             ($.default /.parser)
             ($.default /.equivalence)
             ($.default /.order)]
            []))
