(.using
  [library
   [lux {"-" let symbol}
    ["$" documentation {"+" documentation:}]
    [data
     [text {"+" \n}
      ["%" format {"+" format}]]
     [collection
      ["[0]" list]]]]]
  [\\library
   ["[0]" /]])

(documentation: /.spliced
  ""
  [(spliced [a b c d])
   "=>"
   a
   b
   c
   d])

(documentation: /.amount
  ""
  [(amount [a b c d])
   "=>"
   4])

(documentation: /.with_locals
  "Creates names for local bindings aliased by the names you choose."
  [(with_locals [my_var]
     (let [my_var 123]
       (text [my_var])))
   "=>"
   "__gensym__my_var506"])

(documentation: /.text
  "A text literal made by concatenating pieces of code."
  [(text [#0 123 +456 +789.0 "abc" .def ..ghi])
   "=>"
   "#0123+456+789.0abcdefghi"])

(documentation: /.symbol
  (format "An symbol made by concatenating pieces of code."
          \n "The (optional) module part and the short part are specified independently.")
  [(symbol ["abc" .def ..ghi])
   "=>"
   abcdefghi]
  [(symbol [.def] ["abc" .def ..ghi])
   "=>"
   .abcdefghi])

(documentation: /.let
  "Lexically-bound templates."
  [(let [(!square <root>)
         [(* <root> <root>)]]
     (def: (square root)
       (-> Nat Nat)
       (!square root)))])

(.def: .public documentation
  (.List $.Module)
  ($.module /._
            "Utilities commonly used while templating."
            [..spliced
             ..amount
             ..with_locals
             ..text
             ..symbol
             ..let
             ($.default /.irregular_arguments)]
            []))
