diff options
Diffstat (limited to 'stdlib/source/library/lux/data/format/tar.lux')
-rw-r--r-- | stdlib/source/library/lux/data/format/tar.lux | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/stdlib/source/library/lux/data/format/tar.lux b/stdlib/source/library/lux/data/format/tar.lux index 8dd91b2ee..7f1346df1 100644 --- a/stdlib/source/library/lux/data/format/tar.lux +++ b/stdlib/source/library/lux/data/format/tar.lux @@ -44,7 +44,7 @@ max_size) padding (|> "0" (list.repeated padding_size) - (text.join_with ""))] + text.joined)] (format padding number))) (def: blank " ") @@ -132,9 +132,9 @@ (Parser Small) (do <>.monad [digits (<binary>.segment ..small_size) - digits (<>.lift (\ utf8.codec decode digits)) + digits (<>.lifted (\ utf8.codec decode digits)) _ ..small_suffix] - (<>.lift + (<>.lifted (do {! try.monad} [value (\ n.octal decode digits)] (..small value))))) @@ -143,12 +143,12 @@ (Parser Big) (do <>.monad [digits (<binary>.segment ..big_size) - digits (<>.lift (\ utf8.codec decode digits)) + digits (<>.lifted (\ utf8.codec decode digits)) end <binary>.bits/8 _ (let [expected (`` (char (~~ (static ..blank))))] (<>.assertion (exception.error ..wrong_character [expected end]) (n.= expected end)))] - (<>.lift + (<>.lifted (do {! try.monad} [value (\ n.octal decode digits)] (..big value))))) @@ -201,9 +201,9 @@ (Parser [Nat Checksum]) (do <>.monad [ascii (<binary>.segment ..small_size) - digits (<>.lift (\ utf8.codec decode ascii)) + digits (<>.lifted (\ utf8.codec decode ascii)) _ ..small_suffix - value (<>.lift + value (<>.lifted (\ n.octal decode digits))] (in [value (:abstraction (format digits ..checksum_suffix))]))) @@ -285,7 +285,7 @@ .let [expected (`` (char (~~ (static ..null))))] _ (<>.assertion (exception.error ..wrong_character [expected end]) (n.= expected end))] - (<>.lift + (<>.lifted (do {! try.monad} [ascii (..un_padded string) text (\ utf8.codec decode ascii)] @@ -293,7 +293,7 @@ (def: .public <none> <type> - (try.assumed (<in> ""))) + (try.trusted (<in> ""))) )] [Name Text ..name_size name_is_too_long name from_name name_writer name_parser anonymous] @@ -329,7 +329,7 @@ .let [expected (`` (char (~~ (static ..null))))] _ (<>.assertion (exception.error ..wrong_character [expected end]) (n.= expected end))] - (<>.lift + (<>.lifted (\ try.monad map (|>> :abstraction) (\ utf8.codec decode string))))) ) @@ -436,7 +436,7 @@ (<options>) _ - (<>.lift + (<>.lifted (exception.except ..invalid_link_flag [(.nat linkflag)])))))) ) @@ -459,7 +459,7 @@ (Writer Mode) (|>> :representation ..small - try.assumed + try.trusted ..small_writer)) (exception: .public (invalid_mode {value Nat}) @@ -520,7 +520,7 @@ (if (n.<= (:representation ..maximum_mode) value) (in (:abstraction value)) - (<>.lift + (<>.lifted (exception.except ..invalid_mode [value])))))) ) @@ -584,7 +584,7 @@ (def: no_device Device - (try.assumed (..small 0))) + (try.trusted (..small 0))) (type: .public Tar (Row Entry)) @@ -777,7 +777,7 @@ modification_time ..big_parser [actual checksum_code] ..checksum_parser _ (let [expected (expected_checksum checksum_code binary_header)] - (<>.lift + (<>.lifted (exception.assertion ..wrong_checksum [expected actual] (n.= expected actual)))) link_flag ..link_flag_parser @@ -817,7 +817,7 @@ .let [size (get@ #size header) rounded_size (..rounded_content_size size)] content (<binary>.segment (..from_big size)) - content (<>.lift (..content content)) + content (<>.lifted (..content content)) _ (<binary>.segment (n.- (..from_big size) rounded_size))] (in [(get@ #path header) (|> header @@ -838,7 +838,7 @@ (-> Link_Flag (-> Header Path) (Parser Path)) (do <>.monad [header ..header_parser - _ (<>.lift + _ (<>.lifted (exception.assertion ..wrong_link_flag [expected (get@ #link_flag header)] (n.= (..link_flag expected) (..link_flag (get@ #link_flag header)))))] @@ -864,7 +864,7 @@ (do <>.monad [block (<binary>.segment ..block_size)] (let [actual (..checksum block)] - (<>.lift + (<>.lifted (exception.assertion ..wrong_checksum [0 actual] (n.= 0 actual)))))) @@ -875,7 +875,7 @@ (do <>.monad [_ (<>.at_most 2 end_of_archive_block_parser) done? <binary>.end?] - (<>.lift + (<>.lifted (exception.assertion ..invalid_end_of_archive [] done?)))) |