aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/lux/tool/interpreter/type.lux
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib/source/lux/tool/interpreter/type.lux')
-rw-r--r--stdlib/source/lux/tool/interpreter/type.lux19
1 files changed, 10 insertions, 9 deletions
diff --git a/stdlib/source/lux/tool/interpreter/type.lux b/stdlib/source/lux/tool/interpreter/type.lux
index 19f94af1b..b9d4ebb5b 100644
--- a/stdlib/source/lux/tool/interpreter/type.lux
+++ b/stdlib/source/lux/tool/interpreter/type.lux
@@ -3,7 +3,8 @@
[control
[monad (#+ do)]
["ex" exception (#+ exception:)]
- ["p" parser]
+ ["p" parser
+ ["<.>" type (#+ Parser)]]
pipe]
[data
["." error (#+ Error)]
@@ -22,7 +23,7 @@
["." type]
["." macro
["." code]
- ["." poly (#+ Poly)]]])
+ ["." poly]]])
(exception: #export (cannot-represent-value {type Type})
(ex.report ["Type" (%type type)]))
@@ -30,7 +31,7 @@
(type: Representation (-> Any Text))
(def: primitive-representation
- (Poly Representation)
+ (Parser Representation)
(`` ($_ p.either
(do p.monad
[_ (poly.exactly Any)]
@@ -49,7 +50,7 @@
[Text %t])))))
(def: (special-representation representation)
- (-> (Poly Representation) (Poly Representation))
+ (-> (Parser Representation) (Parser Representation))
(`` ($_ p.either
(~~ (template [<type> <formatter>]
[(do p.monad
@@ -80,7 +81,7 @@
(format "(#.Some " (elemR elemV) ")"))))))))
(def: (record-representation tags representation)
- (-> (List Name) (Poly Representation) (Poly Representation))
+ (-> (List Name) (Parser Representation) (Parser Representation))
(do p.monad
[membersR+ (poly.tuple (p.many representation))
_ (p.assert "Number of tags does not match record type size."
@@ -102,7 +103,7 @@
(format "{" record-body "}"))))))
(def: (variant-representation tags representation)
- (-> (List Name) (Poly Representation) (Poly Representation))
+ (-> (List Name) (Parser Representation) (Parser Representation))
(do p.monad
[casesR+ (poly.variant (p.many representation))
#let [num-tags (list.size tags)]
@@ -130,7 +131,7 @@
(recur tail variantV)))))))))
(def: (tagged-representation compiler representation)
- (-> Lux (Poly Representation) (Poly Representation))
+ (-> Lux (Parser Representation) (Parser Representation))
(do p.monad
[[name anonymous] poly.named]
(case (macro.run compiler (macro.tags-of name))
@@ -148,7 +149,7 @@
(p.fail error))))
(def: (tuple-representation representation)
- (-> (Poly Representation) (Poly Representation))
+ (-> (Parser Representation) (Parser Representation))
(do p.monad
[membersR+ (poly.tuple (p.many representation))]
(wrap (function (_ tupleV)
@@ -167,7 +168,7 @@
(format "[" tuple-body "]"))))))
(def: (representation compiler)
- (-> Lux (Poly Representation))
+ (-> Lux (Parser Representation))
(p.rec
(function (_ representation)
($_ p.either