aboutsummaryrefslogtreecommitdiff
path: root/stdlib
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib')
-rw-r--r--stdlib/source/lux/macro.lux6
-rw-r--r--stdlib/source/lux/macro/poly.lux11
2 files changed, 14 insertions, 3 deletions
diff --git a/stdlib/source/lux/macro.lux b/stdlib/source/lux/macro.lux
index fc392d49c..33ac0b89b 100644
--- a/stdlib/source/lux/macro.lux
+++ b/stdlib/source/lux/macro.lux
@@ -539,16 +539,16 @@
(def: #export (tags-of type-name)
{#;doc "All the tags associated with a type definition."}
- (-> Ident (Meta (List Ident)))
+ (-> Ident (Meta (Maybe (List Ident))))
(do Monad<Meta>
[#let [[module name] type-name]
module (find-module module)]
(case (get name (get@ #;types module))
(#;Some [tags _])
- (wrap tags)
+ (wrap (#;Some tags))
_
- (wrap (list)))))
+ (wrap #;None))))
(def: #export cursor
{#;doc "The cursor of the current expression being analyzed."}
diff --git a/stdlib/source/lux/macro/poly.lux b/stdlib/source/lux/macro/poly.lux
index 7ed7fb2ee..bbed25f98 100644
--- a/stdlib/source/lux/macro/poly.lux
+++ b/stdlib/source/lux/macro/poly.lux
@@ -285,6 +285,17 @@
_
(p;fail ($_ text/compose "Not a bound type: " (type;to-text headT))))))
+(def: #export named
+ (Poly [Ident Type])
+ (do p;Monad<Parser>
+ [inputT any]
+ (case inputT
+ (#;Named name anonymousT)
+ (wrap [name anonymousT])
+
+ _
+ (p;fail ($_ text/compose "Not a named type: " (type;to-text inputT))))))
+
(def: #export (recursive poly)
(All [a] (-> (Poly a) (Poly [Code a])))
(do p;Monad<Parser>