diff options
Diffstat (limited to 'stdlib/source/library/lux/data/format/tar.lux')
-rw-r--r-- | stdlib/source/library/lux/data/format/tar.lux | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/stdlib/source/library/lux/data/format/tar.lux b/stdlib/source/library/lux/data/format/tar.lux index 59a24a875..f452a2693 100644 --- a/stdlib/source/library/lux/data/format/tar.lux +++ b/stdlib/source/library/lux/data/format/tar.lux @@ -19,8 +19,8 @@ ["." format #_ ["#" binary (#+ Writer) ("#\." monoid)]] [collection - ["." list ("#\." fold)] - ["." row (#+ Row) ("#\." fold)]]] + ["." list ("#\." mix)] + ["." row (#+ Row) ("#\." mix)]]] [math ["." number ["n" nat] @@ -62,7 +62,7 @@ Nat (|> ..octal_size (list.repeated <size>) - (list\fold n.* 1) + (list\mix n.* 1) ++)) (exception: .public (<exception> {value Nat}) @@ -90,10 +90,10 @@ (let [suffix <suffix> padded_size (n.+ (text.size suffix) <size>)] (|>> :representation - (\ n.octal encode) + (\ n.octal encoded) (..octal_padding <size>) (text.suffix suffix) - (\ utf8.codec encode) + (\ utf8.codec encoded) (format.segment padded_size)))) (def: <coercion> @@ -134,25 +134,25 @@ (Parser Small) (do <>.monad [digits (<binary>.segment ..small_size) - digits (<>.lifted (\ utf8.codec decode digits)) + digits (<>.lifted (\ utf8.codec decoded digits)) _ ..small_suffix] (<>.lifted (do {! try.monad} - [value (\ n.octal decode digits)] + [value (\ n.octal decoded digits)] (..small value))))) (def: big_parser (Parser Big) (do <>.monad [digits (<binary>.segment ..big_size) - digits (<>.lifted (\ utf8.codec decode digits)) + digits (<>.lifted (\ utf8.codec decoded digits)) end <binary>.bits/8 _ (let [expected (`` (char (~~ (static ..blank))))] (<>.assertion (exception.error ..wrong_character [expected end]) (n.= expected end)))] (<>.lifted (do {! try.monad} - [value (\ n.octal decode digits)] + [value (\ n.octal decoded digits)] (..big value))))) (abstract: Checksum @@ -178,7 +178,7 @@ (def: checksum_checksum (|> ..dummy_checksum :representation - (\ utf8.codec encode) + (\ utf8.codec encoded) ..checksum)) (def: checksum_code @@ -186,7 +186,7 @@ (|>> ..checksum ..as_small ..from_small - (\ n.octal encode) + (\ n.octal encoded) (..octal_padding ..small_size) (text.suffix ..checksum_suffix) :abstraction)) @@ -196,17 +196,17 @@ (let [padded_size (n.+ (text.size ..checksum_suffix) ..small_size)] (|>> :representation - (\ utf8.codec encode) + (\ utf8.codec encoded) (format.segment padded_size)))) (def: checksum_parser (Parser [Nat Checksum]) (do <>.monad [ascii (<binary>.segment ..small_size) - digits (<>.lifted (\ utf8.codec decode ascii)) + digits (<>.lifted (\ utf8.codec decoded ascii)) _ ..small_suffix value (<>.lifted - (\ n.octal decode digits))] + (\ n.octal decoded digits))] (in [value (:abstraction (format digits ..checksum_suffix))]))) ) @@ -217,7 +217,7 @@ (def: ascii? (-> Text Bit) - (|>> (\ utf8.codec encode) + (|>> (\ utf8.codec encoded) (binary.aggregate (function (_ char verdict) (.and verdict (n.<= ..last_ascii char))) @@ -236,7 +236,7 @@ 0 (#try.Success string) size (loop [end (-- size)] (case end - 0 (#try.Success (\ utf8.codec encode "")) + 0 (#try.Success (\ utf8.codec encoded "")) _ (do try.monad [last_char (binary.read/8! end string)] (`` (case (.nat last_char) @@ -261,7 +261,7 @@ (def: .public (<in> value) (-> <representation> (Try <type>)) (if (..ascii? value) - (if (|> value (\ utf8.codec encode) binary.size (n.<= <size>)) + (if (|> value (\ utf8.codec encoded) binary.size (n.<= <size>)) (#try.Success (:abstraction value)) (exception.except <exception> [value])) (exception.except ..not_ascii [value]))) @@ -276,7 +276,7 @@ padded_size (n.+ (text.size suffix) <size>)] (|>> :representation (text.suffix suffix) - (\ utf8.codec encode) + (\ utf8.codec encoded) (format.segment padded_size)))) (def: <parser> @@ -290,7 +290,7 @@ (<>.lifted (do {! try.monad} [ascii (..un_padded string) - text (\ utf8.codec decode ascii)] + text (\ utf8.codec decoded ascii)] (<in> text))))) (def: .public <none> @@ -320,7 +320,7 @@ (let [padded_size (n.+ (text.size ..null) ..magic_size)] (|>> :representation - (\ utf8.codec encode) + (\ utf8.codec encoded) (format.segment padded_size)))) (def: magic_parser @@ -333,7 +333,7 @@ (n.= expected end))] (<>.lifted (\ try.monad map (|>> :abstraction) - (\ utf8.codec decode string))))) + (\ utf8.codec decoded string))))) ) (def: block_size Size 512) @@ -530,7 +530,7 @@ Nat (|> ..octal_size (list.repeated ..content_size) - (list\fold n.* 1))) + (list\mix n.* 1))) (abstract: .public Content {} @@ -739,10 +739,10 @@ (Writer Tar) (let [end_of_archive (binary.empty ..end_of_archive_size)] (function (_ tar) - (format\compose (row\fold (function (_ next total) - (format\compose total (..entry_writer next))) - format\identity - tar) + (format\compose (row\mix (function (_ next total) + (format\compose total (..entry_writer next))) + format\identity + tar) (format.segment ..end_of_archive_size end_of_archive))))) (exception: .public (wrong_checksum {expected Nat} {actual Nat}) @@ -763,7 +763,7 @@ (-> Checksum Binary Nat) (let [|checksum| (|> checksum ..from_checksum - (\ utf8.codec encode) + (\ utf8.codec encoded) ..checksum)] (|> (..checksum header) (n.- |checksum|) |