aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/lux/data/name.lux
diff options
context:
space:
mode:
authorEduardo Julian2020-08-10 02:29:18 -0400
committerEduardo Julian2020-08-10 02:29:18 -0400
commit56fa0ab84c1112ea297c46814e580ca8d11b101e (patch)
treef6a4eeb3032ef86ab916c69b0a2de7865ffb087b /stdlib/source/lux/data/name.lux
parentf79e39de3f605695a33acadf751be498f552930b (diff)
Improved naming when evaluating code on the host platform.
Diffstat (limited to 'stdlib/source/lux/data/name.lux')
-rw-r--r--stdlib/source/lux/data/name.lux26
1 files changed, 10 insertions, 16 deletions
diff --git a/stdlib/source/lux/data/name.lux b/stdlib/source/lux/data/name.lux
index 897690144..e79398021 100644
--- a/stdlib/source/lux/data/name.lux
+++ b/stdlib/source/lux/data/name.lux
@@ -2,11 +2,12 @@
[lux #*
[abstract
[equivalence (#+ Equivalence)]
+ [hash (#+ Hash)]
[order (#+ Order)]
- [codec (#+ Codec)]
- hash]
+ [codec (#+ Codec)]]
[data
- ["." text ("#@." monoid hash)]]])
+ ["." text ("#@." equivalence monoid)]
+ ["." product]]])
## (type: Name
## [Text Text])
@@ -20,12 +21,13 @@
[short short]
)
-(structure: #export equivalence
+(def: #export hash
+ (Hash Name)
+ (product.hash text.hash text.hash))
+
+(def: #export equivalence
(Equivalence Name)
-
- (def: (= [xmodule xname] [ymodule yname])
- (and (text@= xmodule ymodule)
- (text@= xname yname))))
+ (:: ..hash &equivalence))
(structure: #export order
(Order Name)
@@ -56,11 +58,3 @@
_
(#.Left (text@compose "Invalid format for Name: " input))))))
-
-(structure: #export hash
- (Hash Name)
-
- (def: &equivalence ..equivalence)
-
- (def: (hash [module name])
- ("lux i64 +" (text@hash module) (text@hash name))))