aboutsummaryrefslogtreecommitdiff
path: root/new-luxc/source/luxc/lang
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--new-luxc/source/luxc/lang.lux44
-rw-r--r--new-luxc/source/luxc/lang/analysis.lux30
-rw-r--r--new-luxc/source/luxc/lang/pattern.lux15
-rw-r--r--new-luxc/source/luxc/lang/synthesis.lux21
4 files changed, 66 insertions, 44 deletions
diff --git a/new-luxc/source/luxc/lang.lux b/new-luxc/source/luxc/lang.lux
deleted file mode 100644
index 787895466..000000000
--- a/new-luxc/source/luxc/lang.lux
+++ /dev/null
@@ -1,44 +0,0 @@
-(;module:
- lux)
-
-(type: #export (Pattern a) Void)
-
-(type: #export Primitive
- #Unit
- (#Bool Bool)
- (#Nat Nat)
- (#Int Int)
- (#Deg Deg)
- (#Real Real)
- (#Char Char)
- (#Text Text))
-
-(type: #export Reference
- (#Relative Ref)
- (#Absolute Ident))
-
-(type: #export (Structure a)
- (#Variant Nat Bool a)
- (#Tuple (List a))
- (#Case (Pattern a))
- (#Function Scope a)
- (#Call a (List a))
- (#Procedure Text (List a)))
-
-(type: #export (Analysis' Analysis)
- (#Primitive Primitive)
- (#Structure (Structure Analysis))
- (#Reference Reference))
-
-(type: #export #rec Analysis
- (Meta [Type Cursor]
- (Analysis' Analysis)))
-
-(type: #export Synthesis
- Unit)
-
-(type: #export Eval
- (-> Type Code (Lux Top)))
-
-(type: #export Analyser
- (-> Eval Code (Lux Analysis)))
diff --git a/new-luxc/source/luxc/lang/analysis.lux b/new-luxc/source/luxc/lang/analysis.lux
new file mode 100644
index 000000000..092b561f0
--- /dev/null
+++ b/new-luxc/source/luxc/lang/analysis.lux
@@ -0,0 +1,30 @@
+(;module:
+ lux
+ (lux (data [product]))
+ (.. ["lp" pattern]))
+
+(type: #export (Analysis' Analysis)
+ #Unit
+ (#Bool Bool)
+ (#Nat Nat)
+ (#Int Int)
+ (#Deg Deg)
+ (#Real Real)
+ (#Char Char)
+ (#Text Text)
+ (#Variant Nat Bool Analysis)
+ (#Tuple (List Analysis))
+ (#Case (List [lp;Pattern Analysis]))
+ (#Function Scope Analysis)
+ (#Call Analysis (List Analysis))
+ (#Procedure Text (List Analysis))
+ (#Relative Ref)
+ (#Absolute Ident))
+
+(type: #export #rec Analysis
+ (Meta [Type Cursor]
+ (Analysis' Analysis)))
+
+(def: #export (get-type analysis)
+ (-> Analysis Type)
+ (|> analysis product;left product;left))
diff --git a/new-luxc/source/luxc/lang/pattern.lux b/new-luxc/source/luxc/lang/pattern.lux
new file mode 100644
index 000000000..a0077133b
--- /dev/null
+++ b/new-luxc/source/luxc/lang/pattern.lux
@@ -0,0 +1,15 @@
+(;module:
+ lux)
+
+(type: #export #rec Pattern
+ (#Ref Nat)
+ #Unit
+ (#Bool Bool)
+ (#Nat Nat)
+ (#Int Int)
+ (#Deg Deg)
+ (#Real Real)
+ (#Char Char)
+ (#Text Text)
+ (#Tuple (List Pattern))
+ (#Variant [Nat Nat] Pattern))
diff --git a/new-luxc/source/luxc/lang/synthesis.lux b/new-luxc/source/luxc/lang/synthesis.lux
new file mode 100644
index 000000000..00cccfbe6
--- /dev/null
+++ b/new-luxc/source/luxc/lang/synthesis.lux
@@ -0,0 +1,21 @@
+(;module:
+ lux
+ (.. ["lp" pattern]))
+
+(type: #export #rec Synthesis
+ #Unit
+ (#Bool Bool)
+ (#Nat Nat)
+ (#Int Int)
+ (#Deg Deg)
+ (#Real Real)
+ (#Char Char)
+ (#Text Text)
+ (#Variant Nat Bool Synthesis)
+ (#Tuple (List Synthesis))
+ (#Case (lp;Pattern Synthesis))
+ (#Function Scope Synthesis)
+ (#Call Synthesis (List Synthesis))
+ (#Procedure Text (List Synthesis))
+ (#Relative Ref)
+ (#Absolute Ident))