aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLouis Pilfold <louis@lpil.uk>2022-01-01 23:39:51 +0000
committerLouis Pilfold <louis@lpil.uk>2022-01-01 23:39:51 +0000
commit7b89700cb2c854ee2af74980c04fbf568958f496 (patch)
tree7923675dbd56edb7271787e40e1ee785689c0db1 /src
parent98277883177ae6531bc68bb799d103e516c2006b (diff)
downloadgleam_stdlib-7b89700cb2c854ee2af74980c04fbf568958f496.tar.gz
gleam_stdlib-7b89700cb2c854ee2af74980c04fbf568958f496.zip
List pushes path
Diffstat (limited to 'src')
-rw-r--r--src/gleam/dynamic.gleam7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/gleam/dynamic.gleam b/src/gleam/dynamic.gleam
index 04a01ae..57cc7b5 100644
--- a/src/gleam/dynamic.gleam
+++ b/src/gleam/dynamic.gleam
@@ -332,9 +332,10 @@ pub fn list(
from dynamic: Dynamic,
of decoder_type: fn(Dynamic) -> Result(inner, DecodeErrors),
) -> Result(List(inner), DecodeErrors) {
- dynamic
- |> shallow_list
- |> result.then(list.try_map(_, decoder_type))
+ try list = shallow_list(dynamic)
+ list
+ |> list.try_map(decoder_type)
+ |> map_errors(push_path(_, "*"))
}
/// Checks to see if a `Dynamic` value is a nullable version of a particular