aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/lux/target/jvm/encoding/name.lux
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib/source/lux/target/jvm/encoding/name.lux')
-rw-r--r--stdlib/source/lux/target/jvm/encoding/name.lux32
1 files changed, 32 insertions, 0 deletions
diff --git a/stdlib/source/lux/target/jvm/encoding/name.lux b/stdlib/source/lux/target/jvm/encoding/name.lux
new file mode 100644
index 000000000..7f2119bc0
--- /dev/null
+++ b/stdlib/source/lux/target/jvm/encoding/name.lux
@@ -0,0 +1,32 @@
+(.module:
+ [lux #*
+ [data
+ ["." text]]
+ [type
+ abstract]])
+
+(def: #export internal-separator "/")
+(def: #export external-separator ".")
+
+(type: #export External Text)
+
+(abstract: #export Internal
+ {}
+
+ Text
+
+ (def: #export internal
+ (-> Text Internal)
+ (|>> (text.replace-all ..external-separator
+ ..internal-separator)
+ :abstraction))
+
+ (def: #export read
+ (-> Internal Text)
+ (|>> :representation))
+
+ (def: #export external
+ (-> Internal External)
+ (|>> :representation
+ (text.replace-all ..internal-separator
+ ..external-separator))))