aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/library/lux/meta/target/jvm/encoding/name.lux
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib/source/library/lux/meta/target/jvm/encoding/name.lux')
-rw-r--r--stdlib/source/library/lux/meta/target/jvm/encoding/name.lux42
1 files changed, 42 insertions, 0 deletions
diff --git a/stdlib/source/library/lux/meta/target/jvm/encoding/name.lux b/stdlib/source/library/lux/meta/target/jvm/encoding/name.lux
new file mode 100644
index 000000000..7516cdc46
--- /dev/null
+++ b/stdlib/source/library/lux/meta/target/jvm/encoding/name.lux
@@ -0,0 +1,42 @@
+(.require
+ [library
+ [lux (.except)
+ [data
+ ["[0]" text (.only)
+ ["%" \\format (.only format)]]]
+ [meta
+ [type
+ [primitive (.except)]]]]])
+
+(def .public internal_separator "/")
+(def .public external_separator ".")
+
+(type .public External
+ Text)
+
+(primitive .public Internal
+ Text
+
+ (def .public internal
+ (-> External Internal)
+ (|>> (text.replaced ..external_separator
+ ..internal_separator)
+ abstraction))
+
+ (def .public read
+ (-> Internal Text)
+ (|>> representation))
+
+ (def .public external
+ (-> Internal External)
+ (|>> representation
+ (text.replaced ..internal_separator
+ ..external_separator))))
+
+(def .public safe
+ (-> Text External)
+ (|>> ..internal ..external))
+
+(def .public (qualify package class)
+ (-> Text External External)
+ (format (..safe package) ..external_separator class))