(.require [library [lux (.except) [abstract [equivalence (.only Equivalence)]] [control ["<>" parser (.use "[1]#[0]" monad)]] [data ["[0]" product] ["[0]" text] [collection ["[0]" list (.use "[1]#[0]" functor)]]] [meta ["[0]" code (.only) ["<[1]>" \\parser (.only Parser)]]]]]) (type .public Declaration (Record [#name Text #arguments (List Text)])) (def .public equivalence (Equivalence Declaration) (all product.equivalence text.equivalence (list.equivalence text.equivalence) )) (def .public parser (Parser Declaration) (<>.either (<>.and .local (<>#in (list))) (.form (<>.and .local (<>.some .local))))) (def .public (format value) (-> Declaration Code) (let [g!name (code.local (the #name value))] (when (the #arguments value) {.#End} g!name arguments (` ((, g!name) (,* (list#each code.local arguments)))))))