diff options
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/lux/data/name.lux (renamed from stdlib/source/lux/data/ident.lux) | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/stdlib/source/lux/data/ident.lux b/stdlib/source/lux/data/name.lux index 27d45227f..0129bc5cc 100644 --- a/stdlib/source/lux/data/ident.lux +++ b/stdlib/source/lux/data/name.lux @@ -8,46 +8,46 @@ ["." text ("text/." Monoid<Text> Hash<Text>)]]]) ## [Types] -## (type: Ident +## (type: Name ## [Text Text]) ## [Functions] (do-template [<name> <side>] - [(def: #export (<name> [module name]) - (-> Ident Text) + [(def: #export (<name> [module short]) + (-> Name Text) <side>)] [module module] - [name name] + [short short] ) ## [Structures] -(structure: #export _ (Equivalence Ident) +(structure: #export _ (Equivalence Name) (def: (= [xmodule xname] [ymodule yname]) (and (text/= xmodule ymodule) (text/= xname yname)))) -(structure: #export _ (Codec Text Ident) - (def: (encode [module name]) +(structure: #export _ (Codec Text Name) + (def: (encode [module short]) (case module - "" name - _ ($_ text/compose module "." name))) + "" short + _ ($_ text/compose module "." short))) (def: (decode input) (if (text/= "" input) - (#.Left (text/compose "Invalid format for Ident: " input)) + (#.Left (text/compose "Invalid format for Name: " input)) (case (text.split-all-with "." input) - (^ (list name)) - (#.Right ["" name]) + (^ (list short)) + (#.Right ["" short]) - (^ (list module name)) - (#.Right [module name]) + (^ (list module short)) + (#.Right [module short]) _ - (#.Left (text/compose "Invalid format for Ident: " input)))))) + (#.Left (text/compose "Invalid format for Name: " input)))))) -(structure: #export _ (Hash Ident) - (def: eq Equivalence<Ident>) +(structure: #export _ (Hash Name) + (def: eq Equivalence<Name>) (def: (hash [module name]) (n/+ (text/hash module) (text/hash name)))) |