aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/lux
diff options
context:
space:
mode:
authorEduardo Julian2019-05-22 00:12:24 -0400
committerEduardo Julian2019-05-22 00:12:24 -0400
commit0bc505930accb00f74724f384ee42c9a4dd32beb (patch)
tree7c7358b2090fe4023af854bc4cdd8987deaf382d /stdlib/source/lux
parent7406fbf75e7f81b466c02ed07d65e62c86e3230a (diff)
Removed the useless #lux.type? annotation tag.
Diffstat (limited to 'stdlib/source/lux')
-rw-r--r--stdlib/source/lux/host.jvm.lux3
-rw-r--r--stdlib/source/lux/host.old.lux3
-rw-r--r--stdlib/source/lux/macro.lux1
-rw-r--r--stdlib/source/lux/tool/compiler/phase/extension/statement.lux44
4 files changed, 18 insertions, 33 deletions
diff --git a/stdlib/source/lux/host.jvm.lux b/stdlib/source/lux/host.jvm.lux
index 6daaf4869..3b3d31341 100644
--- a/stdlib/source/lux/host.jvm.lux
+++ b/stdlib/source/lux/host.jvm.lux
@@ -1402,8 +1402,7 @@
(short-class-name full-name))
params' (list@map code.local-identifier params)]
(` (def: (~ (code.identifier ["" def-name]))
- {#.type? #1
- #..jvm-class (~ (code.text full-name))}
+ {#..jvm-class (~ (code.text full-name))}
.Type
(All [(~+ params')]
(primitive (~ (code.text (sanitize full-name)))
diff --git a/stdlib/source/lux/host.old.lux b/stdlib/source/lux/host.old.lux
index 9c866a66a..0c6cfcd9e 100644
--- a/stdlib/source/lux/host.old.lux
+++ b/stdlib/source/lux/host.old.lux
@@ -1510,8 +1510,7 @@
(short-class-name full-name))
params' (list@map (|>> product.left code.local-identifier) params)]
(` (def: (~ (code.identifier ["" def-name]))
- {#.type? #1
- #..jvm-class (~ (code.text full-name))}
+ {#..jvm-class (~ (code.text full-name))}
Type
(All [(~+ params')]
(primitive (~ (code.text (sanitize full-name)))
diff --git a/stdlib/source/lux/macro.lux b/stdlib/source/lux/macro.lux
index e5ac9a87a..0b0c59623 100644
--- a/stdlib/source/lux/macro.lux
+++ b/stdlib/source/lux/macro.lux
@@ -202,7 +202,6 @@
(flag-set? (name-of <tag>)))]
[export? #.export? "exported"]
- [type? #.type? "a type"]
[structure? #.struct? "a structure"]
[recursive-type? #.type-rec? "a recursive type"]
[signature? #.sig? "a signature"]
diff --git a/stdlib/source/lux/tool/compiler/phase/extension/statement.lux b/stdlib/source/lux/tool/compiler/phase/extension/statement.lux
index 6c2ba872f..7deb93696 100644
--- a/stdlib/source/lux/tool/compiler/phase/extension/statement.lux
+++ b/stdlib/source/lux/tool/compiler/phase/extension/statement.lux
@@ -17,7 +17,7 @@
["." dictionary]]]
["." macro
["." code]]
- [type (#+ :share :by-example)
+ ["." type (#+ :share :by-example) ("#@." equivalence)
["." check]]]
["." //
["#." bundle]
@@ -27,7 +27,7 @@
["#." generation]
[analysis
["." module]
- ["." type]]
+ [".A" type]]
["#/" // #_
["#." analysis]
["#." synthesis (#+ Synthesis)]
@@ -59,8 +59,8 @@
generate (get@ [#////statement.generation #////statement.phase] state)]
[_ code//type codeA] (////statement.lift-analysis
(////analysis.with-scope
- (type.with-fresh-env
- (type.with-type type
+ (typeA.with-fresh-env
+ (typeA.with-type type
(do @
[codeA (analyse codeC)]
(wrap [type codeA]))))))
@@ -83,9 +83,9 @@
_ (///generation.save! false name statement)]
(wrap [code//type codeT target-name value]))))
-(def: (definition name ?type codeC)
+(def: (definition name codeC)
(All [anchor expression statement]
- (-> Name (Maybe Type) Code
+ (-> Name Code
(Operation anchor expression statement [Type expression Text Any])))
(do ///.monad
[state (//.lift ///.get-state)
@@ -94,20 +94,12 @@
generate (get@ [#////statement.generation #////statement.phase] state)]
[_ code//type codeA] (////statement.lift-analysis
(////analysis.with-scope
- (type.with-fresh-env
- (case ?type
- (#.Some type)
- (type.with-type type
- (do @
- [codeA (analyse codeC)]
- (wrap [type codeA])))
-
- #.None
- (do @
- [[code//type codeA] (type.with-inference (analyse codeC))
- code//type (type.with-env
- (check.clean code//type))]
- (wrap [code//type codeA]))))))
+ (typeA.with-fresh-env
+ (do @
+ [[code//type codeA] (typeA.with-inference (analyse codeC))
+ code//type (typeA.with-env
+ (check.clean code//type))]
+ (wrap [code//type codeA])))))
codeS (////statement.lift-synthesis
(synthesize codeA))]
(definition' generate name code//type codeS)))
@@ -119,7 +111,7 @@
(////statement.lift-analysis
(do ///.monad
[_ (module.define short-name [type annotations value])]
- (if (macro.type? annotations)
+ (if (type@= .Type type)
(case (macro.declared-tags annotations)
#.Nil
(wrap [])
@@ -155,11 +147,7 @@
#let [full-name [current-module short-name]]
[_ annotationsT annotationsV] (evaluate! Code annotationsC)
#let [annotationsV (:coerce Code annotationsV)]
- [value//type valueT valueN valueV] (..definition full-name
- (if (macro.type? annotationsV)
- (#.Some Type)
- #.None)
- valueC)
+ [value//type valueT valueN valueV] (..definition full-name valueC)
_ (..define short-name value//type annotationsV valueV)
#let [_ (log! (format "Definition " (%name full-name)))]
_ (////statement.lift-generation
@@ -282,8 +270,8 @@
(do ///.monad
[[_ programA] (////statement.lift-analysis
(////analysis.with-scope
- (type.with-fresh-env
- (type.with-type (type (-> (List Text) (IO Any)))
+ (typeA.with-fresh-env
+ (typeA.with-type (type (-> (List Text) (IO Any)))
(analyse programC)))))]
(////statement.lift-synthesis
(synthesize programA))))