(.using
  [library
   [lux "*"
    ["$" documentation {"+" documentation:}]
    ["[0]" debug]
    [control
     ["<>" parser
      ["<[0]>" code]]]
    [data
     [text
      ["%" format {"+" format}]]
     [collection
      ["[0]" sequence]]]
    [macro
     ["[0]" template]]
    ["@" target
     ["[0]" jvm]]
    [tool
     [compiler
      ["[0]" phase]
      [language
       [lux
        [phase
         ["[0]" directive]]]]]]]]
  [\\library
   ["[0]" /]])

(documentation: /.analysis:
  "Mechanism for defining extensions to Lux's analysis/type-checking infrastructure."
  [(analysis: ("my analysis" self phase archive [pass_through <code>.any])
     (phase archive pass_through))])

(documentation: /.synthesis:
  "Mechanism for defining extensions to Lux's synthesis/optimization infrastructure."
  [(synthesis: ("my synthesis" self phase archive [pass_through <analysis>.any])
     (phase archive pass_through))])

(documentation: /.generation:
  ""
  [(generation: ("my generation" self phase archive [pass_through <synthesis>.any])
     (for [@.jvm
           (# phase.monad each (|>> {jvm.#Embedded}
                                    sequence.sequence)
              (phase archive pass_through))]
          (phase archive pass_through)))])

(documentation: /.directive:
  ""
  [(directive: ("my directive" self phase archive [parameters (<>.some <code>.any)])
     (do phase.monad
       [.let [_ (debug.log! (format "Successfully installed directive " (%.text self) "!"))]]
       (in directive.no_requirements)))])

(.def: .public documentation
  (.List $.Module)
  ($.module /._
            ""
            [..analysis:
             ..synthesis:
             ..generation:
             ..directive:]
            []))
