(.require
 [library
  [lux (.except)
   ["$" documentation]
   [data
    ["[0]" text (.only \n)
     ["%" \\format (.only format)]]]]]
 [\\library
  ["[0]" /]])

(def .public documentation
  (List $.Documentation)
  (list ($.module /._
                  "")

        ($.definition /.infix
          (format "Infix math syntax."
                  \n "The rules for infix syntax are simple."
                  \n "If you want your binary function to work well with it."
                  \n "Then take the argument to the right (y) as your first argument,"
                  \n "and take the argument to the left (x) as your second argument.")
          ["Binary functions"
           (infix [x * +10])
           "=>"
           (* +10 x)]
          ["Nested infix"
           (infix [[x + y] * [x - y]])
           "=>"
           (* (- y x) (+ y x))]
          ["Unary functions"
           (infix [sin [x + y]])
           "=>"
           (sin (+ y x))]
          ["Also works with logic"
           (infix [[x < y] and [y < z]])
           "=>"
           (and (< z y)
                (< y x))]
          ["Forms are left as-is"
           (infix [(* 3 9) gcd 450])
           "=>"
           (gcd 450 (* 3 9))])
        ))
