(.using
  [library
   [lux {"-" if loop}
    ["$" documentation {"+" documentation:}]
    [data
     [text {"+" \n}
      ["%" format {"+" format}]]]
    [macro
     ["[0]" template]]]]
  [\\library
   ["[0]" /]])

(documentation: /.open
  "Memoization where the memoized results can be re-used accross invocations."
  [(open memo)])

(documentation: /.closed
  (format "Memoization confined to a single invocation to the function (not counting any subsequent recursive invocations)."
          \n "Memoized results will be re-used during recursive invocations, but cannot be accessed after the main invocation has ended.")
  [(closed hash memo)])

(documentation: /.none
  (format "No memoization at all."
          \n "This is useful as a test control when measuring the effect of using memoization.")
  [(none hash memo)])

(.def: .public documentation
  (.List $.Module)
  ($.module /._
            ""
            [..open
             ..closed
             ..none
             ($.default /.memoization)
             ($.default (/.Memo input output))]
            []))
