aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source
diff options
context:
space:
mode:
authorEduardo Julian2017-11-23 19:11:27 -0400
committerEduardo Julian2017-11-23 19:11:27 -0400
commit74fd0966b60a3594b5f6d289d837207718352ef2 (patch)
tree95d4eb6a6eb0682c0e8b91abe64e2c470f7dc23f /stdlib/source
parent5a619fc3978d1ded629f7c255d1c1c672033ad54 (diff)
- Added REPL.
Diffstat (limited to '')
-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>