aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/library/lux/data/format/tar.lux
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--stdlib/source/library/lux/data/format/tar.lux80
1 files changed, 40 insertions, 40 deletions
diff --git a/stdlib/source/library/lux/data/format/tar.lux b/stdlib/source/library/lux/data/format/tar.lux
index b4ae34e8a..d216a1ef8 100644
--- a/stdlib/source/library/lux/data/format/tar.lux
+++ b/stdlib/source/library/lux/data/format/tar.lux
@@ -74,7 +74,7 @@
(-> Nat (Try <type>))
(if (n.< <limit> value)
(#try.Success (:abstraction value))
- (exception.throw <exception> [value])))
+ (exception.except <exception> [value])))
(def: #export <out>
(-> <type> Nat)
@@ -123,7 +123,7 @@
_ (let [expected (`` (char (~~ (static ..null))))]
(<>.assert (exception.construct ..wrong_character [expected end])
(n.= expected end)))]
- (wrap [])))
+ (in [])))
(def: small_parser
(Parser Small)
@@ -200,8 +200,8 @@
_ ..verify_small_suffix
value (<>.lift
(\ n.octal decode digits))]
- (wrap [value
- (:abstraction (format digits ..checksum_suffix))])))
+ (in [value
+ (:abstraction (format digits ..checksum_suffix))])))
)
(def: last_ascii
@@ -254,8 +254,8 @@
(if (..ascii? value)
(if (|> value (\ utf8.codec encode) binary.size (n.<= <size>))
(#try.Success (:abstraction value))
- (exception.throw <exception> [value]))
- (exception.throw ..not_ascii [value])))
+ (exception.except <exception> [value]))
+ (exception.except ..not_ascii [value])))
(def: #export <out>
(-> <type> <representation>)
@@ -421,12 +421,12 @@
(case (.nat linkflag)
(^template [<value> <link_flag>]
[(^ <value>)
- (wrap <link_flag>)])
+ (in <link_flag>)])
(<options>)
_
(<>.lift
- (exception.throw ..invalid_link_flag [(.nat linkflag)]))))))
+ (exception.except ..invalid_link_flag [(.nat linkflag)]))))))
)
(abstract: #export Mode
@@ -506,9 +506,9 @@
[value (\ ! map ..from_small ..small_parser)]
(if (n.<= (:representation ..maximum_mode)
value)
- (wrap (:abstraction value))
+ (in (:abstraction value))
(<>.lift
- (exception.throw ..invalid_mode [value]))))))
+ (exception.except ..invalid_mode [value]))))))
)
(def: maximum_content_size
@@ -524,7 +524,7 @@
(-> Binary (Try Content))
(do try.monad
[size (..big (binary.size content))]
- (wrap (:abstraction [size content]))))
+ (in (:abstraction [size content]))))
(def: from_content
(-> Content [Big Binary])
@@ -773,20 +773,20 @@
major_device ..small_parser
minor_device ..small_parser
_ (<b>.segment ..header_padding_size)]
- (wrap {#path path
- #mode mode
- #user_id user_id
- #group_id group_id
- #size size
- #modification_time modification_time
- #checksum checksum_code
- #link_flag link_flag
- #link_name link_name
- #magic magic
- #user_name user_name
- #group_name group_name
- #major_device major_device
- #minor_device minor_device})))
+ (in {#path path
+ #mode mode
+ #user_id user_id
+ #group_id group_id
+ #size size
+ #modification_time modification_time
+ #checksum checksum_code
+ #link_flag link_flag
+ #link_name link_name
+ #magic magic
+ #user_name user_name
+ #group_name group_name
+ #major_device major_device
+ #minor_device minor_device})))
(exception: #export (wrong_link_flag {expected Link_Flag} {actual Link_Flag})
(exception.report
@@ -804,20 +804,20 @@
content (<b>.segment (..from_big size))
content (<>.lift (..content content))
_ (<b>.segment (n.- (..from_big size) rounded_size))]
- (wrap [(get@ #path header)
- (|> header
- (get@ #modification_time)
- ..from_big
- .int
- duration.of_millis
- (duration.up (|> duration.second duration.to_millis .nat))
- instant.absolute)
- (get@ #mode header)
- {#user {#name (get@ #user_name header)
- #id (get@ #user_id header)}
- #group {#name (get@ #group_name header)
- #id (get@ #group_id header)}}
- content])))
+ (in [(get@ #path header)
+ (|> header
+ (get@ #modification_time)
+ ..from_big
+ .int
+ duration.of_millis
+ (duration.up (|> duration.second duration.to_millis .nat))
+ instant.absolute)
+ (get@ #mode header)
+ {#user {#name (get@ #user_name header)
+ #id (get@ #user_id header)}
+ #group {#name (get@ #group_name header)
+ #id (get@ #group_id header)}}
+ content])))
(def: (file_name_parser expected extractor)
(-> Link_Flag (-> Header Path) (Parser Path))
@@ -827,7 +827,7 @@
(exception.assert ..wrong_link_flag [expected (get@ #link_flag header)]
(n.= (..link_flag expected)
(..link_flag (get@ #link_flag header)))))]
- (wrap (extractor header))))
+ (in (extractor header))))
(def: entry_parser
(Parser Entry)