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

(documentation: (/.Refined it)
  "A refined version of another type, using a predicate to select valid instances.")

(documentation: (/.Refiner it)
  "A selection mechanism for refined instances of a type.")

(documentation: /.refiner
  ""
  [(refiner predicate)])

(documentation: /.lifted
  (format "Yields a function that can work on refined values."
          \n "Respects the constraints of the refinement.")
  [(lifted transform)])

(documentation: /.only
  ""
  [(only refiner values)])

(documentation: /.partition
  "Separates refined values from the un-refined ones."
  [(partition refiner values)])

(documentation: /.type
  "The Refined type associated with a Refiner type."
  [(def: even
     (refiner even?))

   (def: Even
     Type
     (type even))

   (: (Maybe Even)
      (even 123))])

(.def: .public documentation
  (.List $.Module)
  ($.module /._
            ""
            [..Refined
             ..Refiner
             ..refiner
             ..lifted
             ..only
             ..partition
             ..type
             ($.default /.value)
             ($.default /.predicate)]
            []))
