From 0209454c0c9d02de69174aad9a934cdc0d6af804 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Tue, 10 Jul 2018 00:29:20 -0400 Subject: - Re-named "struct" to "structure". --- stdlib/source/lux.lux | 4 ++-- stdlib/source/lux/control/equivalence.lux | 26 +++++++++++++------------- stdlib/source/lux/control/interval.lux | 30 +++++++++++++++--------------- stdlib/source/lux/control/monoid.lux | 13 ++++++------- stdlib/source/lux/control/order.lux | 19 +++++++++---------- stdlib/source/lux/macro/poly/functor.lux | 4 ++-- stdlib/source/lux/macro/poly/json.lux | 6 +++--- 7 files changed, 50 insertions(+), 52 deletions(-) diff --git a/stdlib/source/lux.lux b/stdlib/source/lux.lux index 238d77bd8..0389a64f8 100644 --- a/stdlib/source/lux.lux +++ b/stdlib/source/lux.lux @@ -3843,7 +3843,7 @@ #None (#Left "Not expecting any type."))))) -(macro: #export (struct tokens) +(macro: #export (structure tokens) {#.doc "Not meant to be used directly. Prefer \"structure:\"."} (do Monad [tokens' (monad/map Monad macro-expand tokens) @@ -3950,7 +3950,7 @@ (~ (meta-code-merge (` {#.struct? true}) meta)) (~ type) - (struct (~+ definitions))))))) + (structure (~+ definitions))))))) #None (fail "Cannot infer name, so struct must have a name other than \"_\"!")) diff --git a/stdlib/source/lux/control/equivalence.lux b/stdlib/source/lux/control/equivalence.lux index 6ee8630e2..cddf72542 100644 --- a/stdlib/source/lux/control/equivalence.lux +++ b/stdlib/source/lux/control/equivalence.lux @@ -7,24 +7,24 @@ (def: #export (product left right) (All [l r] (-> (Equivalence l) (Equivalence r) (Equivalence [l r]))) - (struct (def: (= [a b] [x y]) - (and (:: left = a x) - (:: right = b y))))) + (structure (def: (= [a b] [x y]) + (and (:: left = a x) + (:: right = b y))))) (def: #export (sum left right) (All [l r] (-> (Equivalence l) (Equivalence r) (Equivalence (| l r)))) - (struct (def: (= a|b x|y) - (case [a|b x|y] - [(+0 a) (+0 x)] - (:: left = a x) + (structure (def: (= a|b x|y) + (case [a|b x|y] + [(+0 a) (+0 x)] + (:: left = a x) - [(+1 b) (+1 y)] - (:: right = b y) + [(+1 b) (+1 y)] + (:: right = b y) - _ - false)))) + _ + false)))) (def: #export (rec sub) (All [a] (-> (-> (Equivalence a) (Equivalence a)) (Equivalence a))) - (struct (def: (= left right) - (sub (rec sub) left right)))) + (structure (def: (= left right) + (sub (rec sub) left right)))) diff --git a/stdlib/source/lux/control/interval.lux b/stdlib/source/lux/control/interval.lux index 1cc825070..c000d0cec 100644 --- a/stdlib/source/lux/control/interval.lux +++ b/stdlib/source/lux/control/interval.lux @@ -18,15 +18,15 @@ (def: #export (between Enum bottom top) (All [a] (-> (Enum a) a a (Interval a))) - (struct (def: enum Enum) - (def: bottom bottom) - (def: top top))) + (structure (def: enum Enum) + (def: bottom bottom) + (def: top top))) (def: #export (singleton Enum elem) (All [a] (-> (Enum a) a (Interval a))) - (struct (def: enum Enum) - (def: bottom elem) - (def: top elem))) + (structure (def: enum Enum) + (def: bottom elem) + (def: top elem))) (do-template [ ] [(def: #export ( interval) @@ -71,22 +71,22 @@ (def: #export (union left right) (All [a] (-> (Interval a) (Interval a) (Interval a))) - (struct (def: enum (get@ #enum right)) - (def: bottom (order.min (:: right order) (:: left bottom) (:: right bottom))) - (def: top (order.max (:: right order) (:: left top) (:: right top))))) + (structure (def: enum (get@ #enum right)) + (def: bottom (order.min (:: right order) (:: left bottom) (:: right bottom))) + (def: top (order.max (:: right order) (:: left top) (:: right top))))) (def: #export (intersection left right) (All [a] (-> (Interval a) (Interval a) (Interval a))) - (struct (def: enum (get@ #enum right)) - (def: bottom (order.max (:: right order) (:: left bottom) (:: right bottom))) - (def: top (order.min (:: right order) (:: left top) (:: right top))))) + (structure (def: enum (get@ #enum right)) + (def: bottom (order.max (:: right order) (:: left bottom) (:: right bottom))) + (def: top (order.min (:: right order) (:: left top) (:: right top))))) (def: #export (complement interval) (All [a] (-> (Interval a) (Interval a))) (let [(^open) interval] - (struct (def: enum (get@ #enum interval)) - (def: bottom (succ top)) - (def: top (pred bottom))))) + (structure (def: enum (get@ #enum interval)) + (def: bottom (succ top)) + (def: top (pred bottom))))) (def: #export (precedes? reference sample) (All [a] (-> (Interval a) (Interval a) Bool)) diff --git a/stdlib/source/lux/control/monoid.lux b/stdlib/source/lux/control/monoid.lux index a71f2335e..301511971 100644 --- a/stdlib/source/lux/control/monoid.lux +++ b/stdlib/source/lux/control/monoid.lux @@ -12,13 +12,12 @@ (def: #export (compose Monoid Monoid) (All [l r] (-> (Monoid l) (Monoid r) (Monoid [l r]))) - (struct - (def: identity - [(:: Monoid identity) (:: Monoid identity)]) - - (def: (compose [lL rL] [lR rR]) - [(:: Monoid compose lL lR) - (:: Monoid compose rL rR)]))) + (structure (def: identity + [(:: Monoid identity) (:: Monoid identity)]) + + (def: (compose [lL rL] [lR rR]) + [(:: Monoid compose lL lR) + (:: Monoid compose rL rR)]))) (def: #export (fold Monoid Fold data) (All [a F] (-> (Monoid a) (Fold F) (F a) a)) diff --git a/stdlib/source/lux/control/order.lux b/stdlib/source/lux/control/order.lux index 153b1fa9a..c06658b21 100644 --- a/stdlib/source/lux/control/order.lux +++ b/stdlib/source/lux/control/order.lux @@ -22,16 +22,15 @@ (All [a] (-> (Equivalence a) (-> a a Bool) (Order a))) (let [> (flip <)] - (struct - (def: eq eq) - (def: < <) - (def: (<= test subject) - (or (< test subject) - (:: eq = test subject))) - (def: > >) - (def: (>= test subject) - (or (> test subject) - (:: eq = test subject)))))) + (structure (def: eq eq) + (def: < <) + (def: (<= test subject) + (or (< test subject) + (:: eq = test subject))) + (def: > >) + (def: (>= test subject) + (or (> test subject) + (:: eq = test subject)))))) (do-template [ ] [(def: #export ( order x y) diff --git a/stdlib/source/lux/macro/poly/functor.lux b/stdlib/source/lux/macro/poly/functor.lux index 0f7b67b57..a0e5bb463 100644 --- a/stdlib/source/lux/macro/poly/functor.lux +++ b/stdlib/source/lux/macro/poly/functor.lux @@ -92,5 +92,5 @@ (Arg inputC)) (p.fail (format "Cannot create Functor for: " (%type inputT)))))] (wrap (` (: (~ (@Functor inputT)) - (struct (def: ((~' map) (~ funcC) (~ inputC)) - (~ outputC)))))))) + (structure (def: ((~' map) (~ funcC) (~ inputC)) + (~ outputC)))))))) diff --git a/stdlib/source/lux/macro/poly/json.lux b/stdlib/source/lux/macro/poly/json.lux index 2a708ee2e..18fd0ea2c 100644 --- a/stdlib/source/lux/macro/poly/json.lux +++ b/stdlib/source/lux/macro/poly/json.lux @@ -310,6 +310,6 @@ (derived: (Codec Record)))} (with-gensyms [g!inputs] (wrap (list (` (: (Codec //.JSON (~ inputT)) - (struct (def: (~' encode) ((~! Codec//encode) (~ inputT))) - (def: ((~' decode) (~ g!inputs)) (//.run (~ g!inputs) ((~! Codec//decode) (~ inputT)))) - ))))))) + (structure (def: (~' encode) ((~! Codec//encode) (~ inputT))) + (def: ((~' decode) (~ g!inputs)) (//.run (~ g!inputs) ((~! Codec//decode) (~ inputT)))) + ))))))) -- cgit v1.2.3