aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/library/lux.lux
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib/source/library/lux.lux')
-rw-r--r--stdlib/source/library/lux.lux44
1 files changed, 18 insertions, 26 deletions
diff --git a/stdlib/source/library/lux.lux b/stdlib/source/library/lux.lux
index 16123c586..f534a51d9 100644
--- a/stdlib/source/library/lux.lux
+++ b/stdlib/source/library/lux.lux
@@ -2496,10 +2496,11 @@
[(def:''' .private (<name> xy)
#End
(All [a b] (-> (Tuple a b) <type>))
- (let' [[x y] xy] <value>))]
+ (let' [[x y] xy]
+ <value>))]
- [first a x]
- [second b y])
+ [product\left a x]
+ [product\right b y])
(def:''' .private (type_declaration type_codes)
#End
@@ -2516,8 +2517,8 @@
(failure "Wrong syntax for variant case.")}
pair)))
pairs)]
- (in_meta [(` (Tuple (~+ (list\map second members))))
- (#Some (list\map first members))]))
+ (in_meta [(` (Tuple (~+ (list\map product\right members))))
+ (#Some (list\map product\left members))]))
(#Item type #End)
({[_ (#Tag "" member_name)]
@@ -2548,8 +2549,8 @@
(failure "Wrong syntax for variant case.")}
case)))
(list& case cases))]
- (in_meta [(` (..Variant (~+ (list\map second members))))
- (#Some (list\map first members))]))
+ (in_meta [(` (..Variant (~+ (list\map product\right members))))
+ (#Some (list\map product\left members))]))
_
(failure "Improper type-definition syntax")}
@@ -3551,7 +3552,7 @@
_
(failure "No tags available for type.")))
.let [tag_mappings (: (List [Text Code])
- (list\map (function (_ tag) [(second tag) (tag$ tag)])
+ (list\map (function (_ tag) [(product\right tag) (tag$ tag)])
tags))]
members (monad\map meta_monad
(: (-> Code (Meta [Code Code]))
@@ -5033,8 +5034,8 @@
[[_ _ column] (#Record pairs)]
(list\fold n/min column
- (list\compose (list\map (|>> first baseline_column) pairs)
- (list\map (|>> second baseline_column) pairs)))
+ (list\compose (list\map (|>> product\left baseline_column) pairs)
+ (list\map (|>> product\right baseline_column) pairs)))
))
(type: Documentation_Fragment
@@ -5086,16 +5087,11 @@
(-> Location Text Location)
[file line ("lux i64 +" column (text\size code_text))])
-(def: (delimiter_updated_location [file line column])
- (-> Location Location)
- [file line (inc column)])
-
(def: un_paired
(-> (List [Code Code]) (List Code))
(let [pair_list (: (-> [Code Code] (List Code))
- (function (_ pair)
- (let [[left right] pair]
- (list left right))))]
+ (function (_ [left right])
+ (list left right)))]
(|>> (list\map pair_list)
list\join)))
@@ -5121,9 +5117,9 @@
(let [[group_location' parts_text] (list\fold (function (_ part [last_location text_accum])
(let [[part_location part_text] (example_documentation last_location baseline part)]
[part_location (text\compose text_accum part_text)]))
- [(delimiter_updated_location group_location) ""]
+ [(update@ #column inc group_location) ""]
(<prep> parts))]
- [(delimiter_updated_location group_location')
+ [(update@ #column inc group_location')
($_ text\compose (location_padding baseline prev_location group_location)
<open>
parts_text
@@ -5136,10 +5132,6 @@
("lux io error" "@example_documentation Undefined behavior.")
))
-(def: (with_baseline baseline [file line column])
- (-> Nat Location Location)
- [file line baseline])
-
(def: (fragment_documentation fragment)
(-> Documentation_Fragment Text)
(case fragment
@@ -5152,7 +5144,7 @@
(#Documentation_Example example)
(let [baseline (baseline_column example)
[location _] example
- [_ text] (..example_documentation (with_baseline baseline location) baseline example)]
+ [_ text] (..example_documentation (set@ #.column baseline location) baseline example)]
(text\compose text __paragraph))))
(macro: .public (example tokens)
@@ -5246,8 +5238,8 @@
(case ?params
(#.Some [name bindings body])
(let [pairs (pairs bindings)
- vars (list\map first pairs)
- inits (list\map second pairs)]
+ vars (list\map product\left pairs)
+ inits (list\map product\right pairs)]
(if (every? identifier? inits)
(do meta_monad
[inits' (: (Meta (List Name))