diff options
author | Louis Pilfold <louis@lpil.uk> | 2023-12-17 18:36:58 +0000 |
---|---|---|
committer | Louis Pilfold <louis@lpil.uk> | 2023-12-17 18:36:58 +0000 |
commit | f699cef00e70443c270a7c48b45b9df64b2489e1 (patch) | |
tree | e7e1f4d13c0bfb6564dba665b885eb33255204ce /src | |
parent | 78980c30429d4aee2c77dbbb068bfe0d153d32ad (diff) | |
download | gleam_stdlib-f699cef00e70443c270a7c48b45b9df64b2489e1.tar.gz gleam_stdlib-f699cef00e70443c270a7c48b45b9df64b2489e1.zip |
Update version
Diffstat (limited to 'src')
-rw-r--r-- | src/gleam/dynamic.gleam | 114 | ||||
-rw-r--r-- | src/gleam/iterator.gleam | 30 | ||||
-rw-r--r-- | src/gleam/set.gleam | 8 |
3 files changed, 78 insertions, 74 deletions
diff --git a/src/gleam/dynamic.gleam b/src/gleam/dynamic.gleam index c71c6f3..1c4b431 100644 --- a/src/gleam/dynamic.gleam +++ b/src/gleam/dynamic.gleam @@ -1166,12 +1166,14 @@ pub fn decode4( case t1(x), t2(x), t3(x), t4(x) { Ok(a), Ok(b), Ok(c), Ok(d) -> Ok(constructor(a, b, c, d)) a, b, c, d -> - Error(list.concat([ - all_errors(a), - all_errors(b), - all_errors(c), - all_errors(d), - ])) + Error( + list.concat([ + all_errors(a), + all_errors(b), + all_errors(c), + all_errors(d), + ]), + ) } } } @@ -1221,13 +1223,15 @@ pub fn decode5( case t1(x), t2(x), t3(x), t4(x), t5(x) { Ok(a), Ok(b), Ok(c), Ok(d), Ok(e) -> Ok(constructor(a, b, c, d, e)) a, b, c, d, e -> - Error(list.concat([ - all_errors(a), - all_errors(b), - all_errors(c), - all_errors(d), - all_errors(e), - ])) + Error( + list.concat([ + all_errors(a), + all_errors(b), + all_errors(c), + all_errors(d), + all_errors(e), + ]), + ) } } } @@ -1281,14 +1285,16 @@ pub fn decode6( Ok(a), Ok(b), Ok(c), Ok(d), Ok(e), Ok(f) -> Ok(constructor(a, b, c, d, e, f)) a, b, c, d, e, f -> - Error(list.concat([ - all_errors(a), - all_errors(b), - all_errors(c), - all_errors(d), - all_errors(e), - all_errors(f), - ])) + Error( + list.concat([ + all_errors(a), + all_errors(b), + all_errors(c), + all_errors(d), + all_errors(e), + all_errors(f), + ]), + ) } } } @@ -1345,15 +1351,17 @@ pub fn decode7( Ok(a), Ok(b), Ok(c), Ok(d), Ok(e), Ok(f), Ok(g) -> Ok(constructor(a, b, c, d, e, f, g)) a, b, c, d, e, f, g -> - Error(list.concat([ - all_errors(a), - all_errors(b), - all_errors(c), - all_errors(d), - all_errors(e), - all_errors(f), - all_errors(g), - ])) + Error( + list.concat([ + all_errors(a), + all_errors(b), + all_errors(c), + all_errors(d), + all_errors(e), + all_errors(f), + all_errors(g), + ]), + ) } } } @@ -1413,16 +1421,18 @@ pub fn decode8( Ok(a), Ok(b), Ok(c), Ok(d), Ok(e), Ok(f), Ok(g), Ok(h) -> Ok(constructor(a, b, c, d, e, f, g, h)) a, b, c, d, e, f, g, h -> - Error(list.concat([ - all_errors(a), - all_errors(b), - all_errors(c), - all_errors(d), - all_errors(e), - all_errors(f), - all_errors(g), - all_errors(h), - ])) + Error( + list.concat([ + all_errors(a), + all_errors(b), + all_errors(c), + all_errors(d), + all_errors(e), + all_errors(f), + all_errors(g), + all_errors(h), + ]), + ) } } } @@ -1485,17 +1495,19 @@ pub fn decode9( Ok(a), Ok(b), Ok(c), Ok(d), Ok(e), Ok(f), Ok(g), Ok(h), Ok(i) -> Ok(constructor(a, b, c, d, e, f, g, h, i)) a, b, c, d, e, f, g, h, i -> - Error(list.concat([ - all_errors(a), - all_errors(b), - all_errors(c), - all_errors(d), - all_errors(e), - all_errors(f), - all_errors(g), - all_errors(h), - all_errors(i), - ])) + Error( + list.concat([ + all_errors(a), + all_errors(b), + all_errors(c), + all_errors(d), + all_errors(e), + all_errors(f), + all_errors(g), + all_errors(h), + all_errors(i), + ]), + ) } } } diff --git a/src/gleam/iterator.gleam b/src/gleam/iterator.gleam index c41a3c2..4cbb6f5 100644 --- a/src/gleam/iterator.gleam +++ b/src/gleam/iterator.gleam @@ -621,26 +621,20 @@ pub fn range(from start: Int, to stop: Int) -> Iterator(Int) { case int.compare(start, stop) { order.Eq -> once(fn() { start }) order.Gt -> - unfold( - from: start, - with: fn(current) { - case current < stop { - False -> Next(current, current - 1) - True -> Done - } - }, - ) + unfold(from: start, with: fn(current) { + case current < stop { + False -> Next(current, current - 1) + True -> Done + } + }) order.Lt -> - unfold( - from: start, - with: fn(current) { - case current > stop { - False -> Next(current, current + 1) - True -> Done - } - }, - ) + unfold(from: start, with: fn(current) { + case current > stop { + False -> Next(current, current + 1) + True -> Done + } + }) } } diff --git a/src/gleam/set.gleam b/src/gleam/set.gleam index df8d500..4fd7545 100644 --- a/src/gleam/set.gleam +++ b/src/gleam/set.gleam @@ -146,11 +146,9 @@ pub fn to_list(set: Set(member)) -> List(member) { /// pub fn from_list(members: List(member)) -> Set(member) { let map = - list.fold( - over: members, - from: dict.new(), - with: fn(m, k) { dict.insert(m, k, token) }, - ) + list.fold(over: members, from: dict.new(), with: fn(m, k) { + dict.insert(m, k, token) + }) Set(map) } |