From 82c955d5777ecb87b53bafcc658683d5a76e9a3c Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Mon, 3 Apr 2017 18:18:34 -0400 Subject: - Implemented Int encoding/decoding in the standard library. - Moved some type-constructors for building functor types into the lux/control/functor module. - Renamed Ord to Order. - Renamed Env to Reader. --- stdlib/source/lux.lux | 163 +++++++++++++++------------- stdlib/source/lux/codata/env.lux | 63 ----------- stdlib/source/lux/codata/reader.lux | 63 +++++++++++ stdlib/source/lux/control/enum.lux | 4 +- stdlib/source/lux/control/functor.lux | 9 ++ stdlib/source/lux/control/interval.lux | 10 +- stdlib/source/lux/control/ord.lux | 44 -------- stdlib/source/lux/control/order.lux | 44 ++++++++ stdlib/source/lux/data/char.lux | 4 +- stdlib/source/lux/data/coll/ordered.lux | 18 +-- stdlib/source/lux/data/coll/seq.lux | 1 - stdlib/source/lux/data/coll/tree/finger.lux | 3 +- stdlib/source/lux/data/number.lux | 66 ++++++++--- stdlib/source/lux/data/number/complex.lux | 1 - stdlib/source/lux/data/number/ratio.lux | 4 +- stdlib/source/lux/data/text.lux | 4 +- stdlib/source/lux/lexer.lux | 2 +- 17 files changed, 277 insertions(+), 226 deletions(-) delete mode 100644 stdlib/source/lux/codata/env.lux create mode 100644 stdlib/source/lux/codata/reader.lux delete mode 100644 stdlib/source/lux/control/ord.lux create mode 100644 stdlib/source/lux/control/order.lux (limited to 'stdlib/source') diff --git a/stdlib/source/lux.lux b/stdlib/source/lux.lux index 964cf5b57..bac65ef16 100644 --- a/stdlib/source/lux.lux +++ b/stdlib/source/lux.lux @@ -2059,73 +2059,6 @@ (-> (-> a Bool) ($' List a) Bool)) (fold (lambda' [_2 _1] (if _1 (p _2) false)) true xs)) -(def:''' (i= x y) - #Nil - (-> Int Int Bool) - (_lux_proc ["int" "="] [x y])) - -(def:''' (Bool/encode x) - #Nil - (-> Bool Text) - (if x "true" "false")) - -(def:''' (digit-to-text digit) - #Nil - (-> Nat Text) - (_lux_case digit - +0 "0" - +1 "1" +2 "2" +3 "3" - +4 "4" +5 "5" +6 "6" - +7 "7" +8 "8" +9 "9" - _ (_lux_proc ["io" "error"] ["undefined"]))) - -(def:''' (Nat/encode value) - #Nil - (-> Nat Text) - (_lux_case value - +0 - "+0" - - _ - (let' [loop (_lux_: (-> Nat Text Text) - (lambda' recur [input output] - (if (_lux_proc ["nat" "="] [input +0]) - (_lux_proc ["text" "append"] ["+" output]) - (recur (_lux_proc ["nat" "/"] [input +10]) - (_lux_proc ["text" "append"] [(digit-to-text (_lux_proc ["nat" "%"] [input +10])) - output])))))] - (loop value "")))) - -(def:''' (Int/encode x) - #Nil - (-> Int Text) - (_lux_proc ["int" "encode"] [x])) - -(def:''' (Deg/encode x) - #Nil - (-> Deg Text) - (_lux_proc ["deg" "encode"] [x])) - -(def:''' (Real/encode x) - #Nil - (-> Real Text) - (_lux_proc ["real" "encode"] [x])) - -(def:''' (Char/encode x) - #Nil - (-> Char Text) - (let' [as-text (_lux_case x - #"\t" "\\t" - #"\v" "\\v" - #"\b" "\\b" - #"\n" "\\n" - #"\r" "\\r" - #"\f" "\\f" - #"\"" "\\\"" - #"\\" "\\\\" - _ (_lux_proc ["char" "to-text"] [x]))] - ($_ Text/append "#\"" as-text "\""))) - (macro:' #export (do-template tokens) (list [["lux" "doc"] (#TextA "## By specifying a pattern (with holes), and the input data to fill those holes, repeats the pattern as many times as necessary. (do-template [ ] @@ -2143,11 +2076,12 @@ (let' [apply (_lux_: (-> RepEnv ($' List AST)) (lambda' [env] (map (apply-template env) templates))) num-bindings (length bindings')] - (if (every? (i= num-bindings) (map length data')) + (if (every? (lambda' [sample] (_lux_proc ["int" "="] [num-bindings sample])) + (map length data')) (|> data' (join-map (. apply (make-env bindings'))) return) - (fail (Text/append "Irregular arguments vectors for do-template. Expected size " (Int/encode num-bindings))))) + (fail "Irregular arguments vectors for do-template."))) _ (fail "Wrong syntax for do-template")) @@ -2261,6 +2195,88 @@ [r.max Real r.> "Real minimum."] ) +(def:''' (Bool/encode x) + #Nil + (-> Bool Text) + (if x "true" "false")) + +(def:''' (digit-to-text digit) + #Nil + (-> Nat Text) + (_lux_case digit + +0 "0" + +1 "1" +2 "2" +3 "3" + +4 "4" +5 "5" +6 "6" + +7 "7" +8 "8" +9 "9" + _ (_lux_proc ["io" "error"] ["undefined"]))) + +(def:''' (Nat/encode value) + #Nil + (-> Nat Text) + (_lux_case value + +0 + "+0" + + _ + (let' [loop (_lux_: (-> Nat Text Text) + (lambda' recur [input output] + (if (_lux_proc ["nat" "="] [input +0]) + (_lux_proc ["text" "append"] ["+" output]) + (recur (_lux_proc ["nat" "/"] [input +10]) + (_lux_proc ["text" "append"] [(digit-to-text (_lux_proc ["nat" "%"] [input +10])) + output])))))] + (loop value "")))) + +(def:''' (Int/abs value) + #Nil + (-> Int Int) + (if (i.< 0 value) + (i.* -1 value) + value)) + +(def:''' (Int/encode value) + #Nil + (-> Int Text) + (if (i.= 0 value) + "0" + (let' [sign (if (i.> 0 value) + "" + "-")] + ((_lux_: (-> Int Text Text) + (lambda' recur [input output] + (if (i.= 0 input) + (_lux_proc ["text" "append"] [sign output]) + (recur (i./ 10 input) + (_lux_proc ["text" "append"] [(|> input (i.% 10) (_lux_:! Nat) digit-to-text) + output]))))) + (|> value (i./ 10) Int/abs) + (|> value (i.% 10) Int/abs (_lux_:! Nat) digit-to-text))))) + +(def:''' (Deg/encode x) + #Nil + (-> Deg Text) + (_lux_proc ["deg" "encode"] [x])) + +(def:''' (Real/encode x) + #Nil + (-> Real Text) + (_lux_proc ["real" "encode"] [x])) + +(def:''' (Char/encode x) + #Nil + (-> Char Text) + (let' [as-text (_lux_case x + #"\t" "\\t" + #"\v" "\\v" + #"\b" "\\b" + #"\n" "\\n" + #"\r" "\\r" + #"\f" "\\f" + #"\"" "\\\"" + #"\\" "\\\\" + _ (_lux_proc ["char" "to-text"] [x]))] + ($_ Text/append "#\"" as-text "\""))) + (def:''' (multiple? div n) #Nil (-> Int Int Bool) @@ -5767,15 +5783,6 @@ ))))) )) -(type: #export (<&> f g) - (All [a] (& (f a) (g a)))) - -(type: #export (<|> f g) - (All [a] (| (f a) (g a)))) - -(type: #export (<.> f g) - (All [a] (f (g a)))) - (def: #export (assume mx) (All [a] (-> (Maybe a) a)) (default (undefined) mx)) diff --git a/stdlib/source/lux/codata/env.lux b/stdlib/source/lux/codata/env.lux deleted file mode 100644 index c9cc107c4..000000000 --- a/stdlib/source/lux/codata/env.lux +++ /dev/null @@ -1,63 +0,0 @@ -(;module: - lux - (lux (control functor - applicative - ["M" monad #*]))) - -## [Types] -(type: #export (Env r a) - {#;doc "Computations that have access to some environmental value."} - (-> r a)) - -## [Structures] -(struct: #export Functor (All [r] (Functor (Env r))) - (def: (map f fa) - (lambda [env] - (f (fa env))))) - -(struct: #export Applicative (All [r] (Applicative (Env r))) - (def: functor Functor) - - (def: (wrap x) - (lambda [env] x)) - - (def: (apply ff fa) - (lambda [env] - ((ff env) (fa env))))) - -(struct: #export Monad (All [r] (Monad (Env r))) - (def: applicative Applicative) - - (def: (join mma) - (lambda [env] - (mma env env)))) - -## [Values] -(def: #export ask - {#;doc "Get the environment."} - (All [r] (Env r r)) - (lambda [env] env)) - -(def: #export (local change env-proc) - {#;doc "Run computation with a locally-modified environment."} - (All [r a] (-> (-> r r) (Env r a) (Env r a))) - (|>. change env-proc)) - -(def: #export (run env env-proc) - (All [r a] (-> r (Env r a) a)) - (env-proc env)) - -(struct: #export (EnvT Monad) - {#;doc "Monad transformer for Env."} - (All [M] (-> (Monad M) (All [e] (Monad (All [a] (Env e (M a))))))) - (def: applicative (compA Applicative (get@ #M;applicative Monad))) - (def: (join eMeMa) - (lambda [env] - (do Monad - [eMa (run env eMeMa)] - (run env eMa))))) - -(def: #export lift-env - {#;doc "Lift monadic values to the Env wrapper."} - (All [M e a] (-> (M a) (Env e (M a)))) - (:: Monad wrap)) diff --git a/stdlib/source/lux/codata/reader.lux b/stdlib/source/lux/codata/reader.lux new file mode 100644 index 000000000..955b4bba3 --- /dev/null +++ b/stdlib/source/lux/codata/reader.lux @@ -0,0 +1,63 @@ +(;module: + lux + (lux (control functor + applicative + ["M" monad #*]))) + +## [Types] +(type: #export (Reader r a) + {#;doc "Computations that have access to some environmental value."} + (-> r a)) + +## [Structures] +(struct: #export Functor (All [r] (Functor (Reader r))) + (def: (map f fa) + (lambda [env] + (f (fa env))))) + +(struct: #export Applicative (All [r] (Applicative (Reader r))) + (def: functor Functor) + + (def: (wrap x) + (lambda [env] x)) + + (def: (apply ff fa) + (lambda [env] + ((ff env) (fa env))))) + +(struct: #export Monad (All [r] (Monad (Reader r))) + (def: applicative Applicative) + + (def: (join mma) + (lambda [env] + (mma env env)))) + +## [Values] +(def: #export ask + {#;doc "Get the environment."} + (All [r] (Reader r r)) + (lambda [env] env)) + +(def: #export (local change reader-proc) + {#;doc "Run computation with a locally-modified environment."} + (All [r a] (-> (-> r r) (Reader r a) (Reader r a))) + (|>. change reader-proc)) + +(def: #export (run env reader-proc) + (All [r a] (-> r (Reader r a) a)) + (reader-proc env)) + +(struct: #export (ReaderT Monad) + {#;doc "Monad transformer for Reader."} + (All [M] (-> (Monad M) (All [e] (Monad (All [a] (Reader e (M a))))))) + (def: applicative (compA Applicative (get@ #M;applicative Monad))) + (def: (join eMeMa) + (lambda [env] + (do Monad + [eMa (run env eMeMa)] + (run env eMa))))) + +(def: #export lift-reader + {#;doc "Lift monadic values to the Reader wrapper."} + (All [M e a] (-> (M a) (Reader e (M a)))) + (:: Monad wrap)) diff --git a/stdlib/source/lux/control/enum.lux b/stdlib/source/lux/control/enum.lux index c91b5b9ea..5cd20c1a2 100644 --- a/stdlib/source/lux/control/enum.lux +++ b/stdlib/source/lux/control/enum.lux @@ -1,10 +1,10 @@ (;module: lux - (lux/control [ord])) + (lux/control [order])) ## [Signatures] (sig: #export (Enum e) {#;doc "Enumerable types, with a notion of moving forward and backwards through a type's instances."} - (: (ord;Ord e) ord) + (: (order;Order e) order) (: (-> e e) succ) (: (-> e e) pred)) diff --git a/stdlib/source/lux/control/functor.lux b/stdlib/source/lux/control/functor.lux index 3532e0633..416223cd7 100644 --- a/stdlib/source/lux/control/functor.lux +++ b/stdlib/source/lux/control/functor.lux @@ -8,6 +8,15 @@ (type: #export (Fix f) (f (Fix f))) +(type: #export (<&> f g) + (All [a] (& (f a) (g a)))) + +(type: #export (<|> f g) + (All [a] (| (f a) (g a)))) + +(type: #export (<.> f g) + (All [a] (f (g a)))) + (struct: #export (compF Functor Functor) {#;doc "Functor composition."} (All [F G] (-> (Functor F) (Functor G) (Functor (All [a] (F (G a)))))) diff --git a/stdlib/source/lux/control/interval.lux b/stdlib/source/lux/control/interval.lux index 1b197840b..c007477b4 100644 --- a/stdlib/source/lux/control/interval.lux +++ b/stdlib/source/lux/control/interval.lux @@ -1,7 +1,7 @@ (;module: lux (lux (control eq - [ord] + [order] [enum #+ Enum]))) ## Signatures @@ -72,14 +72,14 @@ (def: #export (union left right) (All [a] (-> (Interval a) (Interval a) (Interval a))) (struct (def: enum (get@ #enum right)) - (def: bottom (ord;min (get@ [#enum #enum;ord] right) (:: left bottom) (:: right bottom))) - (def: top (ord;max (get@ [#enum #enum;ord] right) (:: left top) (:: right top))))) + (def: bottom (order;min (get@ [#enum #enum;order] right) (:: left bottom) (:: right bottom))) + (def: top (order;max (get@ [#enum #enum;order] right) (:: 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 (ord;max (get@ [#enum #enum;ord] right) (:: left bottom) (:: right bottom))) - (def: top (ord;min (get@ [#enum #enum;ord] right) (:: left top) (:: right top))))) + (def: bottom (order;max (get@ [#enum #enum;order] right) (:: left bottom) (:: right bottom))) + (def: top (order;min (get@ [#enum #enum;order] right) (:: left top) (:: right top))))) (def: #export (complement interval) (All [a] (-> (Interval a) (Interval a))) diff --git a/stdlib/source/lux/control/ord.lux b/stdlib/source/lux/control/ord.lux deleted file mode 100644 index 8b2875e25..000000000 --- a/stdlib/source/lux/control/ord.lux +++ /dev/null @@ -1,44 +0,0 @@ -(;module: - lux - (.. eq) - lux/codata/function) - -## [Signatures] -(sig: #export (Ord a) - {#;doc "A signature for types that possess some sense of ordering among their elements."} - - (: (Eq a) - eq) - - (do-template [] - [(: (-> a a Bool) )] - - [<] [<=] [>] [>=] - ) - ) - -## [Values] -(def: #export (ord eq <) - (All [a] - (-> (Eq a) (-> a a Bool) (Ord 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)))))) - -(do-template [ ] - [(def: #export ( ord x y) - (All [a] - (-> (Ord a) a a a)) - (if (:: ord y x) x y))] - - [max >] - [min <] - ) diff --git a/stdlib/source/lux/control/order.lux b/stdlib/source/lux/control/order.lux new file mode 100644 index 000000000..153100cff --- /dev/null +++ b/stdlib/source/lux/control/order.lux @@ -0,0 +1,44 @@ +(;module: + lux + (.. eq) + lux/codata/function) + +## [Signatures] +(sig: #export (Order a) + {#;doc "A signature for types that possess some sense of ordering among their elements."} + + (: (Eq a) + eq) + + (do-template [] + [(: (-> a a Bool) )] + + [<] [<=] [>] [>=] + ) + ) + +## [Values] +(def: #export (order eq <) + (All [a] + (-> (Eq 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)))))) + +(do-template [ ] + [(def: #export ( order x y) + (All [a] + (-> (Order a) a a a)) + (if (:: order y x) x y))] + + [max >] + [min <] + ) diff --git a/stdlib/source/lux/data/char.lux b/stdlib/source/lux/data/char.lux index 0db90898e..06efa3f64 100644 --- a/stdlib/source/lux/data/char.lux +++ b/stdlib/source/lux/data/char.lux @@ -1,7 +1,7 @@ (;module: lux (lux/control eq - [ord] + [order] codec hash) (.. [text "Text/" Monoid])) @@ -16,7 +16,7 @@ (def: (hash input) (_lux_proc ["char" "to-nat"] [input]))) -(struct: #export _ (ord;Ord Char) +(struct: #export _ (order;Order Char) (def: eq Eq) (def: (< test subject) diff --git a/stdlib/source/lux/data/coll/ordered.lux b/stdlib/source/lux/data/coll/ordered.lux index 1db97519b..37fbb1505 100644 --- a/stdlib/source/lux/data/coll/ordered.lux +++ b/stdlib/source/lux/data/coll/ordered.lux @@ -2,7 +2,7 @@ lux (lux (control monad eq - [ord #+ Ord]) + [order #+ Order]) (data (coll [list "" Monad "L/" Monoid Fold]) ["p" product] ["M" maybe #+ Functor]) @@ -33,12 +33,12 @@ ) (type: #export (Set a) - {#order (Ord a) + {#order (Order a) #root (Maybe (Node a))}) -(def: #export (new Ord) - (All [a] (-> (Ord a) (Set a))) - {#order Ord +(def: #export (new Order) + (All [a] (-> (Order a) (Set a))) + {#order Order #root #;None}) (def: #export (member? tree elem) @@ -446,9 +446,9 @@ (set@ #root (#;Some (blacken root)) tree) ))) -(def: #export (from-list Ord list) - (All [a] (-> (Ord a) (List a) (Set a))) - (L/fold add (new Ord) list)) +(def: #export (from-list Order list) + (All [a] (-> (Order a) (List a) (Set a))) + (L/fold add (new Order) list)) (def: #export (to-list tree) (All [a] (-> (Set a) (List a))) @@ -489,5 +489,5 @@ (struct: #export Eq (All [a] (Eq (Set a))) (def: (= reference sample) - (:: (list;Eq (get@ [#order #ord;eq] sample)) + (:: (list;Eq (get@ [#order #order;eq] sample)) = (to-list reference) (to-list sample)))) diff --git a/stdlib/source/lux/data/coll/seq.lux b/stdlib/source/lux/data/coll/seq.lux index 0cf7029ea..1912a31a8 100644 --- a/stdlib/source/lux/data/coll/seq.lux +++ b/stdlib/source/lux/data/coll/seq.lux @@ -4,7 +4,6 @@ applicative monad eq - [ord #+ Ord] fold) (data (coll ["L" list "L/" Monoid Fold] (tree ["F" finger])) diff --git a/stdlib/source/lux/data/coll/tree/finger.lux b/stdlib/source/lux/data/coll/tree/finger.lux index 936b8cb89..e338b551e 100644 --- a/stdlib/source/lux/data/coll/tree/finger.lux +++ b/stdlib/source/lux/data/coll/tree/finger.lux @@ -1,7 +1,6 @@ (;module: lux - (lux (control monoid - [ord #+ Ord]) + (lux (control monoid) (data text/format))) (type: #export (Node m a) diff --git a/stdlib/source/lux/data/number.lux b/stdlib/source/lux/data/number.lux index 9b828ec25..62c7abd6b 100644 --- a/stdlib/source/lux/data/number.lux +++ b/stdlib/source/lux/data/number.lux @@ -4,7 +4,7 @@ monoid eq hash - [ord] + [order] enum interval codec) @@ -22,7 +22,7 @@ ) (do-template [ ] - [(struct: #export _ (ord;Ord ) + [(struct: #export _ (order;Order ) (def: eq ) (def: < ) (def: <= ) @@ -49,7 +49,7 @@ _ +1)) ) -(do-template [ <+> <-> <*> <%> <=> <<> <0> <1> <-1>] +(do-template [ <+> <-> <*> <%> <=> <<> <0> <1> <-1>] [(struct: #export _ (Number ) (def: + <+>) (def: - <->) @@ -68,8 +68,8 @@ <1>)) )] - [ Int Ord i.+ i.- i.* i./ i.% i.= i.< 0 1 -1] - [Real Ord r.+ r.- r.* r./ r.% r.= r.< 0.0 1.0 -1.0] + [ Int Order i.+ i.- i.* i./ i.% i.= i.< 0 1 -1] + [Real Order r.+ r.- r.* r./ r.% r.= r.< 0.0 1.0 -1.0] ) (struct: #export _ (Number Deg) @@ -84,16 +84,16 @@ (_lux_proc ["deg" "max-value"] [])) ) -(do-template [ ] +(do-template [ ] [(struct: #export _ (Enum ) - (def: ord ) + (def: order ) (def: succ ) (def: pred ))] - [Nat Ord n.inc n.dec] - [Int Ord i.inc i.dec] - [Real Ord (r.+ (_lux_proc [ "real" "smallest-value"] [])) (r.- (_lux_proc [ "real" "smallest-value"] []))] - [Deg Ord (d.+ (_lux_proc [ "deg" "min-value"] [])) (d.- (_lux_proc [ "deg" "min-value"] []))] + [Nat Order n.inc n.dec] + [Int Order i.inc i.dec] + [Real Order (r.+ (_lux_proc [ "real" "smallest-value"] [])) (r.- (_lux_proc [ "real" "smallest-value"] []))] + [Deg Order (d.+ (_lux_proc [ "deg" "min-value"] [])) (d.- (_lux_proc [ "deg" "min-value"] []))] ) (do-template [ ] @@ -144,7 +144,6 @@ #;None (#;Left ))))] - [ Int [ "int" "encode"] [ "int" "decode"] "Couldn't decode Int"] [ Deg [ "deg" "encode"] [ "deg" "decode"] "Couldn't decode Deg"] [Real ["real" "encode"] ["real" "decode"] "Couldn't decode Real"] ) @@ -167,6 +166,45 @@ "7" (#;Some +7) "8" (#;Some +8) "9" (#;Some +9) _ #;None)) +(struct: #export _ (Codec Text Int) + (def: (encode value) + (if (i.= 0 value) + "0" + (let [sign (if (i.> 0 value) + "" + "-")] + (loop [input (|> value (i./ 10) (:: Number abs)) + output (|> value (i.% 10) (:: Number abs) int-to-nat digit-to-text)] + (if (i.= 0 input) + (_lux_proc ["text" "append"] [sign output]) + (recur (i./ 10 input) + (_lux_proc ["text" "append"] [(|> input (i.% 10) int-to-nat digit-to-text) + output]))))) + )) + + (def: (decode repr) + (let [input-size (_lux_proc ["text" "size"] [repr])] + (if (n.>= +1 input-size) + (let [sign (case (_lux_proc ["text" "char"] [repr +0]) + (#;Some #"-") + -1 + + _ + 1)] + (loop [idx (if (i.= -1 sign) +1 +0) + output 0] + (if (n.< input-size idx) + (case (_lux_proc ["text" "char"] [repr idx]) + (^=> (#;Some sample) + [(text-to-digit (_lux_proc ["char" "to-text"] [sample])) (#;Some digit)]) + (recur (n.inc idx) + (|> output (i.* 10) (i.+ (nat-to-int digit)))) + + _ + (undefined)) + (#;Right (i.* sign output))))) + (#;Left "Invalid syntax for Int."))))) + (struct: #export _ (Codec Text Nat) (def: (encode value) (case value @@ -200,8 +238,8 @@ (#;Right output))) _ - (#;Left "Invalid binary syntax.")) - (#;Left "Invalid binary syntax."))))) + (#;Left "Invalid syntax for Nat.")) + (#;Left "Invalid syntax for Nat."))))) (struct: #export _ (Hash Nat) (def: eq Eq) diff --git a/stdlib/source/lux/data/number/complex.lux b/stdlib/source/lux/data/number/complex.lux index 87b1a7d18..f9289c682 100644 --- a/stdlib/source/lux/data/number/complex.lux +++ b/stdlib/source/lux/data/number/complex.lux @@ -2,7 +2,6 @@ lux (lux [math] (control eq - [ord] number codec monad) diff --git a/stdlib/source/lux/data/number/ratio.lux b/stdlib/source/lux/data/number/ratio.lux index fb86b1fed..52fa2c2a9 100644 --- a/stdlib/source/lux/data/number/ratio.lux +++ b/stdlib/source/lux/data/number/ratio.lux @@ -2,7 +2,7 @@ lux (lux [math] (control eq - [ord] + [order] number codec monad) @@ -101,7 +101,7 @@ (struct: #export _ (Eq Ratio) (def: = q.=)) -(struct: #export _ (ord;Ord Ratio) +(struct: #export _ (order;Order Ratio) (def: eq Eq) (def: < q.<) (def: <= q.<=) diff --git a/stdlib/source/lux/data/text.lux b/stdlib/source/lux/data/text.lux index 4869d9e82..0f9e79ba6 100644 --- a/stdlib/source/lux/data/text.lux +++ b/stdlib/source/lux/data/text.lux @@ -2,7 +2,7 @@ lux (lux (control monoid eq - [ord] + [order] monad codec hash) @@ -109,7 +109,7 @@ (def: (= test subject) (_lux_proc ["text" "="] [subject test]))) -(struct: #export _ (ord;Ord Text) +(struct: #export _ (order;Order Text) (def: eq Eq) (def: (< test subject) diff --git a/stdlib/source/lux/lexer.lux b/stdlib/source/lux/lexer.lux index e33afa5b7..e28cb0a68 100644 --- a/stdlib/source/lux/lexer.lux +++ b/stdlib/source/lux/lexer.lux @@ -7,7 +7,7 @@ (data [text "Text/" Eq Monoid] [number "Int/" Codec] [product] - [char "Char/" Ord] + [char "Char/" Order] maybe ["E" error #- fail] (coll [list "" Functor])))) -- cgit v1.2.3