aboutsummaryrefslogtreecommitdiff
path: root/new-luxc/source/luxc/lang/analysis/procedure/common.lux
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--new-luxc/source/luxc/lang/extension/analysis/common.lux (renamed from new-luxc/source/luxc/lang/analysis/procedure/common.lux)46
1 files changed, 22 insertions, 24 deletions
diff --git a/new-luxc/source/luxc/lang/analysis/procedure/common.lux b/new-luxc/source/luxc/lang/extension/analysis/common.lux
index ecdcd0bfd..079001b26 100644
--- a/new-luxc/source/luxc/lang/analysis/procedure/common.lux
+++ b/new-luxc/source/luxc/lang/extension/analysis/common.lux
@@ -17,20 +17,18 @@
(analysis ["&." common]
[".A" function]
[".A" case]
- [".A" type]))))
+ [".A" type])))
+ [///])
(exception: #export Incorrect-Procedure-Arity)
(exception: #export Invalid-Syntax)
## [Utils]
-(type: #export Proc
- (-> &.Analyser &.Eval (List Code) (Meta la.Analysis)))
-
(type: #export Bundle
- (Dict Text (-> Text Proc)))
+ (Dict Text (-> Text ///.Analysis)))
(def: #export (install name unnamed)
- (-> Text (-> Text Proc)
+ (-> Text (-> Text ///.Analysis)
(-> Bundle Bundle))
(dict.put name unnamed))
@@ -48,7 +46,7 @@
" Actual Arity: " (|> actual nat-to-int %i)))
(def: (simple proc inputsT+ outputT)
- (-> Text (List Type) Type Proc)
+ (-> Text (List Type) Type ///.Analysis)
(let [num-expected (list.size inputsT+)]
(function [analyse eval args]
(let [num-actual (list.size args)]
@@ -64,25 +62,25 @@
(&.throw Incorrect-Procedure-Arity (wrong-arity proc num-expected num-actual)))))))
(def: #export (nullary valueT proc)
- (-> Type Text Proc)
+ (-> Type Text ///.Analysis)
(simple proc (list) valueT))
(def: #export (unary inputT outputT proc)
- (-> Type Type Text Proc)
+ (-> Type Type Text ///.Analysis)
(simple proc (list inputT) outputT))
(def: #export (binary subjectT paramT outputT proc)
- (-> Type Type Type Text Proc)
+ (-> Type Type Type Text ///.Analysis)
(simple proc (list subjectT paramT) outputT))
(def: #export (trinary subjectT param0T param1T outputT proc)
- (-> Type Type Type Type Text Proc)
+ (-> Type Type Type Type Text ///.Analysis)
(simple proc (list subjectT param0T param1T) outputT))
## [Analysers]
## "lux is" represents reference/pointer equality.
(def: (lux//is proc)
- (-> Text Proc)
+ (-> Text ///.Analysis)
(function [analyse eval args]
(do macro.Monad<Meta>
[[var-id varT] (&.with-type-env tc.var)]
@@ -92,7 +90,7 @@
## "lux try" provides a simple way to interact with the host platform's
## error-handling facilities.
(def: (lux//try proc)
- (-> Text Proc)
+ (-> Text ///.Analysis)
(function [analyse eval args]
(case args
(^ (list opC))
@@ -107,7 +105,7 @@
(&.throw Incorrect-Procedure-Arity (wrong-arity proc +1 (list.size args))))))
(def: (lux//function proc)
- (-> Text Proc)
+ (-> Text ///.Analysis)
(function [analyse eval args]
(case args
(^ (list [_ (#.Symbol ["" func-name])]
@@ -119,7 +117,7 @@
(&.throw Incorrect-Procedure-Arity (wrong-arity proc +3 (list.size args))))))
(def: (lux//case proc)
- (-> Text Proc)
+ (-> Text ///.Analysis)
(function [analyse eval args]
(case args
(^ (list input [_ (#.Record branches)]))
@@ -129,7 +127,7 @@
(&.throw Incorrect-Procedure-Arity (wrong-arity proc +2 (list.size args))))))
(def: (lux//in-module proc)
- (-> Text Proc)
+ (-> Text ///.Analysis)
(function [analyse eval argsC+]
(case argsC+
(^ (list [_ (#.Text module-name)] exprC))
@@ -146,7 +144,7 @@
(do-template [<name> <analyser>]
[(def: (<name> proc)
- (-> Text Proc)
+ (-> Text ///.Analysis)
(function [analyse eval args]
(case args
(^ (list typeC valueC))
@@ -159,7 +157,7 @@
[lux//coerce typeA.analyse-coerce])
(def: (lux//check//type proc)
- (-> Text Proc)
+ (-> Text ///.Analysis)
(function [analyse eval args]
(case args
(^ (list valueC))
@@ -296,7 +294,7 @@
)))
(def: (array//get proc)
- (-> Text Proc)
+ (-> Text ///.Analysis)
(function [analyse eval args]
(do macro.Monad<Meta>
[[var-id varT] (&.with-type-env tc.var)]
@@ -304,7 +302,7 @@
analyse eval args))))
(def: (array//put proc)
- (-> Text Proc)
+ (-> Text ///.Analysis)
(function [analyse eval args]
(do macro.Monad<Meta>
[[var-id varT] (&.with-type-env tc.var)]
@@ -312,7 +310,7 @@
analyse eval args))))
(def: (array//remove proc)
- (-> Text Proc)
+ (-> Text ///.Analysis)
(function [analyse eval args]
(do macro.Monad<Meta>
[[var-id varT] (&.with-type-env tc.var)]
@@ -355,7 +353,7 @@
)))
(def: (atom-new proc)
- (-> Text Proc)
+ (-> Text ///.Analysis)
(function [analyse eval args]
(case args
(^ (list initC))
@@ -370,7 +368,7 @@
(&.throw Incorrect-Procedure-Arity (wrong-arity proc +1 (list.size args))))))
(def: (atom-read proc)
- (-> Text Proc)
+ (-> Text ///.Analysis)
(function [analyse eval args]
(do macro.Monad<Meta>
[[var-id varT] (&.with-type-env tc.var)]
@@ -378,7 +376,7 @@
analyse eval args))))
(def: (atom//compare-and-swap proc)
- (-> Text Proc)
+ (-> Text ///.Analysis)
(function [analyse eval args]
(do macro.Monad<Meta>
[[var-id varT] (&.with-type-env tc.var)]