(.require [library [lux (.except) [abstract [equivalence (.only Equivalence)] [hash (.only Hash)] [order (.only Order)] [codec (.only Codec)]] [data ["[0]" text (.use "[1]#[0]" equivalence monoid)] ["[0]" product]]]]) ... (type Symbol ... [Text Text]) (with_template [] [(def .public ( [module short]) (-> Symbol Text) )] [module] [short] ) (def .public hash (Hash Symbol) (product.hash text.hash text.hash)) (def .public equivalence (Equivalence Symbol) (at ..hash equivalence)) (def .public order (Order Symbol) (implementation (def equivalence ..equivalence) (def (< [moduleP shortP] [moduleS shortS]) (if (text#= moduleP moduleS) (at text.order < shortP shortS) (at text.order < moduleP moduleS))))) (def .public separator ".") (def .public codec (Codec Text Symbol) (implementation (def (encoded [module short]) (when module "" short _ (all text#composite module ..separator short))) (def (decoded input) (when (text.all_split_by ..separator input) (list short) {.#Right ["" short]} (list module short) {.#Right [module short]} _ {.#Left (text#composite "Invalid format for Symbol: " input)}))))