aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gleam/dynamic.gleam20
1 files changed, 4 insertions, 16 deletions
diff --git a/src/gleam/dynamic.gleam b/src/gleam/dynamic.gleam
index 3778a47..6b54df1 100644
--- a/src/gleam/dynamic.gleam
+++ b/src/gleam/dynamic.gleam
@@ -231,22 +231,10 @@ pub fn tuple2_of(
first decode_first: Decoder(a),
second decode_second: Decoder(b),
) -> Result(tuple(a, b), String) {
- tup
- |> tuple2
- |> result.then(
- fn(tup) {
- let tuple(first, second) = tup
- decode_first(first)
- |> result.map(fn(first) { tuple(first, second) })
- },
- )
- |> result.then(
- fn(tup) {
- let tuple(first, second) = tup
- decode_second(second)
- |> result.map(fn(second) { tuple(first, second) })
- },
- )
+ try tuple(first, second) = tuple2(tup)
+ try a = decode_first(first)
+ try b = decode_second(second)
+ Ok(tuple(a, b))
}
/// Check to see if the Dynamic value is map.