diff options
author | Eduardo Julian | 2017-11-15 22:30:57 -0400 |
---|---|---|
committer | Eduardo Julian | 2017-11-15 22:30:57 -0400 |
commit | f11c10f72d003555d76c9803954e2bd8b347362d (patch) | |
tree | f484e9876e6a4d5bba9098315155d7d898766bc9 /stdlib/source | |
parent | 53ccae1625d46cf57247b9fb1cb9f4c28b0a0ad4 (diff) |
- Moved "/type/*" to from "lux/meta/" to "lux/".
Diffstat (limited to '')
19 files changed, 107 insertions, 107 deletions
diff --git a/stdlib/source/lux/concurrency/actor.lux b/stdlib/source/lux/concurrency/actor.lux index fea0ca422..7d5c41583 100644 --- a/stdlib/source/lux/concurrency/actor.lux +++ b/stdlib/source/lux/concurrency/actor.lux @@ -12,8 +12,8 @@ ["s" syntax #+ syntax: Syntax] (syntax ["cs" common] (common ["csr" reader] - ["csw" writer])) - (type opaque)) + ["csw" writer]))) + (type opaque) (lang [type])) (.. ["A" atom] ["P" promise "P/" Monad<Promise>] diff --git a/stdlib/source/lux/data/color.lux b/stdlib/source/lux/data/color.lux index 490e31094..61ee1249a 100644 --- a/stdlib/source/lux/data/color.lux +++ b/stdlib/source/lux/data/color.lux @@ -3,7 +3,7 @@ (lux (control [eq]) (data (coll [list "L/" Functor<List>])) [math] - (meta (type opaque)))) + (type opaque))) (def: rgb Nat +256) (def: top Nat (n.dec rgb)) diff --git a/stdlib/source/lux/data/format/json.lux b/stdlib/source/lux/data/format/json.lux index 8f664d6ea..ddc2b48cf 100644 --- a/stdlib/source/lux/data/format/json.lux +++ b/stdlib/source/lux/data/format/json.lux @@ -11,7 +11,7 @@ (text ["l" lexer]) [number "frac/" Codec<Text,Frac> "nat/" Codec<Text,Nat>] [maybe] - ["E" error] + ["e" error] [sum] [product] (coll [list "list/" Fold<List> Monad<List>] @@ -96,52 +96,52 @@ (def: #export (get-fields json) {#;doc "Get all the fields in a JSON object."} - (-> JSON (E;Error (List String))) + (-> JSON (e;Error (List String))) (case json (#Object obj) - (#E;Success (dict;keys obj)) + (#e;Success (dict;keys obj)) _ - (#E;Error ($_ text/compose "Cannot get the fields of a non-object.")))) + (#e;Error ($_ text/compose "Cannot get the fields of a non-object.")))) (def: #export (get key json) {#;doc "A JSON object field getter."} - (-> String JSON (E;Error JSON)) + (-> String JSON (e;Error JSON)) (case json (#Object obj) (case (dict;get key obj) (#;Some value) - (#E;Success value) + (#e;Success value) #;None - (#E;Error ($_ text/compose "Missing field \"" key "\" on object."))) + (#e;Error ($_ text/compose "Missing field \"" key "\" on object."))) _ - (#E;Error ($_ text/compose "Cannot get field \"" key "\" of a non-object.")))) + (#e;Error ($_ text/compose "Cannot get field \"" key "\" of a non-object.")))) (def: #export (set key value json) {#;doc "A JSON object field setter."} - (-> String JSON JSON (E;Error JSON)) + (-> String JSON JSON (e;Error JSON)) (case json (#Object obj) - (#E;Success (#Object (dict;put key value obj))) + (#e;Success (#Object (dict;put key value obj))) _ - (#E;Error ($_ text/compose "Cannot set field \"" key "\" of a non-object.")))) + (#e;Error ($_ text/compose "Cannot set field \"" key "\" of a non-object.")))) (do-template [<name> <tag> <type> <desc>] [(def: #export (<name> key json) {#;doc (code;text ($_ text/compose "A JSON object field getter for " <desc> "."))} - (-> Text JSON (E;Error <type>)) + (-> Text JSON (e;Error <type>)) (case (get key json) - (#E;Success (<tag> value)) - (#E;Success value) + (#e;Success (<tag> value)) + (#e;Success value) - (#E;Success _) - (#E;Error ($_ text/compose "Wrong value type at key: " key)) + (#e;Success _) + (#e;Error ($_ text/compose "Wrong value type at key: " key)) - (#E;Error error) - (#E;Error error)))] + (#e;Error error) + (#e;Error error)))] [get-boolean #Boolean Boolean "booleans"] [get-number #Number Number "numbers"] @@ -195,23 +195,23 @@ (def: unconsumed-input-error Text "Unconsumed JSON.") (def: #export (run json parser) - (All [a] (-> JSON (Reader a) (E;Error a))) + (All [a] (-> JSON (Reader a) (e;Error a))) (case (p;run (list json) parser) - (#E;Success [remainder output]) + (#e;Success [remainder output]) (case remainder #;Nil - (#E;Success output) + (#e;Success output) _ - (#E;Error unconsumed-input-error)) + (#e;Error unconsumed-input-error)) - (#E;Error error) - (#E;Error error))) + (#e;Error error) + (#e;Error error))) (def: #export (fail error) (All [a] (-> Text (Reader a))) (function [inputs] - (#E;Error error))) + (#e;Error error))) (def: #export any {#;doc "Just returns the JSON input without applying any logic."} @@ -219,10 +219,10 @@ (<| (function [inputs]) (case inputs #;Nil - (#E;Error "Empty JSON stream.") + (#e;Error "Empty JSON stream.") (#;Cons head tail) - (#E;Success [tail head])))) + (#e;Success [tail head])))) (do-template [<name> <type> <tag> <desc>] [(def: #export <name> @@ -289,10 +289,10 @@ (case head (#Array values) (case (p;run (sequence;to-list values) parser) - (#E;Error error) + (#e;Error error) (fail error) - (#E;Success [remainder output]) + (#e;Success [remainder output]) (case remainder #;Nil (wrap output) @@ -310,7 +310,7 @@ [head any] (case head (#Object object) - (case (do E;Monad<Error> + (case (do e;Monad<Error> [] (|> (dict;entries object) (monad;map @ (function [[key val]] @@ -318,10 +318,10 @@ [val (run val parser)] (wrap [key val])))) (:: @ map (dict;from-list text;Hash<Text>)))) - (#E;Success table) + (#e;Success table) (wrap table) - (#E;Error error) + (#e;Error error) (fail error)) _ @@ -337,13 +337,13 @@ (case (dict;get field-name object) (#;Some value) (case (run value parser) - (#E;Success output) + (#e;Success output) (function [tail] - (#E;Success [(#;Cons (#Object (dict;remove field-name object)) + (#e;Success [(#;Cons (#Object (dict;remove field-name object)) tail) output])) - (#E;Error error) + (#e;Error error) (fail error)) _ @@ -438,10 +438,10 @@ offset (l;many l;decimal)] (wrap ($_ text/compose mark (if signed?' "-" "") offset))))] (case (frac/decode ($_ text/compose (if signed? "-" "") digits "." decimals exp)) - (#E;Error message) + (#e;Error message) (p;fail message) - (#E;Success value) + (#e;Success value) (wrap value)))) (def: escaped~ diff --git a/stdlib/source/lux/data/lazy.lux b/stdlib/source/lux/data/lazy.lux index 0b0bf8a1d..547418d51 100644 --- a/stdlib/source/lux/data/lazy.lux +++ b/stdlib/source/lux/data/lazy.lux @@ -6,8 +6,8 @@ monad) (concurrency ["a" atom]) [meta] - (meta ["s" syntax #+ syntax:] - (type opaque)))) + (meta ["s" syntax #+ syntax:]) + (type opaque))) (opaque: #export (Lazy a) (-> [] a) diff --git a/stdlib/source/lux/data/store.lux b/stdlib/source/lux/data/store.lux index f2713c6b8..535254ad9 100644 --- a/stdlib/source/lux/data/store.lux +++ b/stdlib/source/lux/data/store.lux @@ -2,7 +2,7 @@ lux (lux (control ["F" functor] comonad) - (meta (type implicit)))) + (type implicit))) (type: #export (Store s a) {#cursor s diff --git a/stdlib/source/lux/data/tainted.lux b/stdlib/source/lux/data/tainted.lux index ad91ea8ab..ffe128022 100644 --- a/stdlib/source/lux/data/tainted.lux +++ b/stdlib/source/lux/data/tainted.lux @@ -1,7 +1,7 @@ (;module: lux (lux (data [product]) - (meta (type opaque)))) + (type opaque))) (opaque: #export (Tainted a) a diff --git a/stdlib/source/lux/data/text/format.lux b/stdlib/source/lux/data/text/format.lux index 161288d86..7fdd9f552 100644 --- a/stdlib/source/lux/data/text/format.lux +++ b/stdlib/source/lux/data/text/format.lux @@ -1,12 +1,12 @@ (;module: lux - (lux (control ["M" monad #+ do Monad] + (lux (control [monad #+ do Monad] ["p" parser]) (data [bool] [number] [text] [ident] - (coll [list "L/" Monad<List>]) + (coll [list "list/" Monad<List>]) (format [xml] [json])) (time [instant] @@ -64,4 +64,4 @@ "(list)" _ - (format "(list " (text;join-with " " (L/map formatter values)) ")")))) + (format "(list " (text;join-with " " (list/map formatter values)) ")")))) diff --git a/stdlib/source/lux/meta/poly.lux b/stdlib/source/lux/meta/poly.lux index 432d9385a..08d91c5f0 100644 --- a/stdlib/source/lux/meta/poly.lux +++ b/stdlib/source/lux/meta/poly.lux @@ -12,7 +12,7 @@ [bool] [maybe] [ident "ident/" Eq<Ident> Codec<Text,Ident>] - ["E" error]) + ["e" error]) [meta #+ with-gensyms] (meta [code] ["s" syntax #+ syntax: Syntax] @@ -31,70 +31,70 @@ (def: #export fresh Env (dict;new number;Hash<Nat>)) (def: (run' env types poly) - (All [a] (-> Env (List Type) (Poly a) (E;Error a))) + (All [a] (-> Env (List Type) (Poly a) (e;Error a))) (case (p;run [env types] poly) - (#E;Error error) - (#E;Error error) + (#e;Error error) + (#e;Error error) - (#E;Success [[env' remaining] output]) + (#e;Success [[env' remaining] output]) (case remaining #;Nil - (#E;Success output) + (#e;Success output) _ - (#E;Error (|> remaining + (#e;Error (|> remaining (list/map type;to-text) (text;join-with ", ") (text/compose "Unconsumed types: ")))))) (def: #export (run type poly) - (All [a] (-> Type (Poly a) (E;Error a))) + (All [a] (-> Type (Poly a) (e;Error a))) (run' fresh (list type) poly)) (def: #export env (Poly Env) (;function [[env inputs]] - (#E;Success [[env inputs] env]))) + (#e;Success [[env inputs] env]))) (def: (with-env temp poly) (All [a] (-> Env (Poly a) (Poly a))) (;function [[env inputs]] (case (p;run [temp inputs] poly) - (#E;Error error) - (#E;Error error) + (#e;Error error) + (#e;Error error) - (#E;Success [[_ remaining] output]) - (#E;Success [[env remaining] output])))) + (#e;Success [[_ remaining] output]) + (#e;Success [[env remaining] output])))) (def: #export peek (Poly Type) (;function [[env inputs]] (case inputs #;Nil - (#E;Error "Empty stream of types.") + (#e;Error "Empty stream of types.") (#;Cons headT tail) - (#E;Success [[env inputs] headT])))) + (#e;Success [[env inputs] headT])))) (def: #export any (Poly Type) (;function [[env inputs]] (case inputs #;Nil - (#E;Error "Empty stream of types.") + (#e;Error "Empty stream of types.") (#;Cons headT tail) - (#E;Success [[env tail] headT])))) + (#e;Success [[env tail] headT])))) (def: #export (local types poly) (All [a] (-> (List Type) (Poly a) (Poly a))) (;function [[env pass-through]] (case (run' env types poly) - (#E;Error error) - (#E;Error error) + (#e;Error error) + (#e;Error error) - (#E;Success output) - (#E;Success [[env pass-through] output])))) + (#e;Success output) + (#e;Success [[env pass-through] output])))) (def: (label idx) (-> Nat Code) @@ -108,11 +108,11 @@ (case (p;run [(dict;put current-id [type g!var] env) inputs] poly) - (#E;Error error) - (#E;Error error) + (#e;Error error) + (#e;Error error) - (#E;Success [[_ inputs'] output]) - (#E;Success [[env inputs'] [g!var output]]))))) + (#e;Success [[_ inputs'] output]) + (#e;Success [[env inputs'] [g!var output]]))))) (do-template [<combinator> <name> <type>] [(def: #export <combinator> @@ -149,10 +149,10 @@ deg frac text)) - (#E;Error error) + (#e;Error error) (p;fail error) - (#E;Success _) + (#e;Success _) (wrap headT)))) (do-template [<name> <flattener> <tag>] diff --git a/stdlib/source/lux/meta/poly/eq.lux b/stdlib/source/lux/meta/poly/eq.lux index a57a9e5de..0d63f0d35 100644 --- a/stdlib/source/lux/meta/poly/eq.lux +++ b/stdlib/source/lux/meta/poly/eq.lux @@ -23,8 +23,8 @@ (meta [code] [syntax #+ syntax: Syntax] (syntax [common]) - [poly #+ poly:] - (type [unit])) + [poly #+ poly:]) + (type [unit]) (lang [type]) )) diff --git a/stdlib/source/lux/meta/poly/json.lux b/stdlib/source/lux/meta/poly/json.lux index 703bbf109..282c8ad7c 100644 --- a/stdlib/source/lux/meta/poly/json.lux +++ b/stdlib/source/lux/meta/poly/json.lux @@ -23,8 +23,8 @@ [meta #+ with-gensyms] (meta ["s" syntax #+ syntax:] [code] - [poly #+ poly:] - (type [unit])) + [poly #+ poly:]) + (type [unit]) (lang [type]) )) diff --git a/stdlib/source/lux/time/date.lux b/stdlib/source/lux/time/date.lux index 3f2dc7255..5b124a669 100644 --- a/stdlib/source/lux/time/date.lux +++ b/stdlib/source/lux/time/date.lux @@ -6,7 +6,7 @@ codec ["p" parser] [monad #+ do]) - (data ["E" error] + (data ["e" error] [maybe] [number "int/" Codec<Text,Int>] [text "text/" Monoid<Text>] @@ -311,7 +311,7 @@ #day (int-to-nat utc-day)}))) (def: (decode input) - (-> Text (E;Error Date)) + (-> Text (e;Error Date)) (l;run input lex-date)) (struct: #export _ diff --git a/stdlib/source/lux/time/duration.lux b/stdlib/source/lux/time/duration.lux index e063a30ce..283b48c91 100644 --- a/stdlib/source/lux/time/duration.lux +++ b/stdlib/source/lux/time/duration.lux @@ -8,8 +8,8 @@ (data [number "int/" Codec<Text,Int> Number<Int>] [text "text/" Monoid<Text>] (text ["l" lexer]) - ["E" error]) - (meta (type opaque)))) + ["e" error]) + (type opaque))) (opaque: #export Duration {#;doc "Durations have a resolution of milliseconds."} @@ -134,7 +134,7 @@ (merge (scale (sign utc-millis) milli)))))) (def: (decode input) - (-> Text (E;Error Duration)) + (-> Text (e;Error Duration)) (l;run input lex-duration)) (struct: #export _ diff --git a/stdlib/source/lux/time/instant.lux b/stdlib/source/lux/time/instant.lux index a9d10fd4f..2d4c1c58b 100644 --- a/stdlib/source/lux/time/instant.lux +++ b/stdlib/source/lux/time/instant.lux @@ -10,11 +10,11 @@ (data [text "text/" Monoid<Text>] (text ["l" lexer]) [number "int/" Codec<Text,Int>] - ["E" error] + ["e" error] [maybe] (coll [list "L/" Fold<List> Functor<List>] [sequence #+ Sequence sequence "sequence/" Functor<Sequence> Fold<Sequence>])) - (meta (type opaque))) + (type opaque)) (.. [duration "duration/" Order<Duration>] [date])) @@ -296,7 +296,7 @@ (shift (duration;scale utc-millis duration;milli)))))) (def: (decode input) - (-> Text (E;Error Instant)) + (-> Text (e;Error Instant)) (l;run input lex-instant)) (struct: #export _ diff --git a/stdlib/source/lux/meta/type/implicit.lux b/stdlib/source/lux/type/implicit.lux index 54fec2626..54fec2626 100644 --- a/stdlib/source/lux/meta/type/implicit.lux +++ b/stdlib/source/lux/type/implicit.lux diff --git a/stdlib/source/lux/meta/type/object.lux b/stdlib/source/lux/type/object.lux index 0eb354242..0eb354242 100644 --- a/stdlib/source/lux/meta/type/object.lux +++ b/stdlib/source/lux/type/object.lux diff --git a/stdlib/source/lux/meta/type/opaque.lux b/stdlib/source/lux/type/opaque.lux index acd73d6a4..acd73d6a4 100644 --- a/stdlib/source/lux/meta/type/opaque.lux +++ b/stdlib/source/lux/type/opaque.lux diff --git a/stdlib/source/lux/meta/type/unit.lux b/stdlib/source/lux/type/unit.lux index de00fb82d..de00fb82d 100644 --- a/stdlib/source/lux/meta/type/unit.lux +++ b/stdlib/source/lux/type/unit.lux diff --git a/stdlib/source/lux/world/net/tcp.jvm.lux b/stdlib/source/lux/world/net/tcp.jvm.lux index 81aec7dc2..4b111fcf7 100644 --- a/stdlib/source/lux/world/net/tcp.jvm.lux +++ b/stdlib/source/lux/world/net/tcp.jvm.lux @@ -4,8 +4,8 @@ (concurrency ["P" promise] ["T" task] [frp]) - (data ["E" error]) - (meta (type opaque)) + (data ["e" error]) + (type opaque) (world [blob #+ Blob]) [io] [host]) @@ -44,7 +44,7 @@ (def: #export (read data offset length self) (let [in (get@ #in (@repr self))] (P;future - (do (E;ErrorT io;Monad<IO>) + (do (e;ErrorT io;Monad<IO>) [bytes-read (InputStream.read [data (nat-to-int offset) (nat-to-int length)] in)] (wrap (int-to-nat bytes-read)))))) @@ -52,7 +52,7 @@ (def: #export (write data offset length self) (let [out (get@ #out (@repr self))] (P;future - (do (E;ErrorT io;Monad<IO>) + (do (e;ErrorT io;Monad<IO>) [_ (OutputStream.write [data (nat-to-int offset) (nat-to-int length)] out)] (Flushable.flush [] out))))) @@ -60,14 +60,14 @@ (def: #export (close self) (let [(^open) (@repr self)] (P;future - (do (E;ErrorT io;Monad<IO>) + (do (e;ErrorT io;Monad<IO>) [_ (AutoCloseable.close [] in) _ (AutoCloseable.close [] out)] (AutoCloseable.close [] socket))))) (def: (tcp-client socket) - (-> Socket (io;IO (E;Error TCP))) - (do (E;ErrorT io;Monad<IO>) + (-> Socket (io;IO (e;Error TCP))) + (do (e;ErrorT io;Monad<IO>) [input (Socket.getInputStream [] socket) output (Socket.getOutputStream [] socket)] (wrap (@opaque {#socket socket @@ -77,7 +77,7 @@ (def: #export (client address port) (-> ..;Address ..;Port (T;Task TCP)) (P;future - (do (E;ErrorT io;Monad<IO>) + (do (e;ErrorT io;Monad<IO>) [socket (Socket.new [address (nat-to-int port)])] (tcp-client socket)))) @@ -102,21 +102,21 @@ (def: #export (server port) (-> ..;Port (T;Task (frp;Channel TCP))) (P;future - (do (E;ErrorT io;Monad<IO>) + (do (e;ErrorT io;Monad<IO>) [server (ServerSocket.new [(nat-to-int port)]) #let [output (frp;channel TCP) _ (: (P;Promise Bool) (P;future (loop [tail output] (do io;Monad<IO> - [?client (do (E;ErrorT io;Monad<IO>) + [?client (do (e;ErrorT io;Monad<IO>) [socket (ServerSocket.accept [] server)] (tcp-client socket))] (case ?client - (#E;Error error) + (#e;Error error) (frp;close tail) - (#E;Success client) + (#e;Success client) (do @ [?tail' (frp;write client tail)] (case ?tail' diff --git a/stdlib/source/lux/world/net/udp.jvm.lux b/stdlib/source/lux/world/net/udp.jvm.lux index 4bbc28729..a3124bdf2 100644 --- a/stdlib/source/lux/world/net/udp.jvm.lux +++ b/stdlib/source/lux/world/net/udp.jvm.lux @@ -5,10 +5,10 @@ (concurrency ["P" promise] ["T" task] [frp]) - (data ["E" error] + (data ["e" error] [maybe] (coll [array])) - (meta (type opaque)) + (type opaque) (world [blob #+ Blob]) [io] [host]) @@ -45,10 +45,10 @@ (exception: #export Multiple-Candidate-Addresses) (def: (resolve address) - (-> ..;Address (io;IO (E;Error InetAddress))) - (do (E;ErrorT io;Monad<IO>) + (-> ..;Address (io;IO (e;Error InetAddress))) + (do (e;ErrorT io;Monad<IO>) [addresses (InetAddress.getAllByName [address])] - (: (io;IO (E;Error InetAddress)) + (: (io;IO (e;Error InetAddress)) (case (array;size addresses) +0 (io;io (ex;throw Cannot-Resolve-Address address)) +1 (wrap (maybe;assume (array;read +0 addresses))) @@ -62,7 +62,7 @@ (let [(^open) (@repr self) packet (DatagramPacket.new|receive [data (nat-to-int offset) (nat-to-int length)])] (P;future - (do (E;ErrorT io;Monad<IO>) + (do (e;ErrorT io;Monad<IO>) [_ (DatagramSocket.receive [packet] socket) #let [bytes-read (int-to-nat (DatagramPacket.getLength [] packet))]] (wrap [bytes-read @@ -72,7 +72,7 @@ (def: #export (write address port data offset length self) (-> ..;Address ..;Port Blob Nat Nat UDP (T;Task Unit)) (P;future - (do (E;ErrorT io;Monad<IO>) + (do (e;ErrorT io;Monad<IO>) [address (resolve address) #let [(^open) (@repr self)]] (DatagramSocket.send (DatagramPacket.new|send [data (nat-to-int offset) (nat-to-int length) address (nat-to-int port)]) @@ -87,14 +87,14 @@ (def: #export (client _) (-> Unit (T;Task UDP)) (P;future - (do (E;ErrorT io;Monad<IO>) + (do (e;ErrorT io;Monad<IO>) [socket (DatagramSocket.new|client [])] (wrap (@opaque (#socket socket)))))) (def: #export (server port) (-> ..;Port (T;Task UDP)) (P;future - (do (E;ErrorT io;Monad<IO>) + (do (e;ErrorT io;Monad<IO>) [socket (DatagramSocket.new|server [(nat-to-int port)])] (wrap (@opaque (#socket socket)))))) ) |