From 74fd0966b60a3594b5f6d289d837207718352ef2 Mon Sep 17 00:00:00 2001
From: Eduardo Julian
Date: Thu, 23 Nov 2017 19:11:27 -0400
Subject: - Added REPL.
---
stdlib/source/lux/macro.lux | 6 +++---
stdlib/source/lux/macro/poly.lux | 11 +++++++++++
2 files changed, 14 insertions(+), 3 deletions(-)
(limited to 'stdlib/source')
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
[#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
+ [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
--
cgit v1.2.3