Skip to content

Commit

Permalink
Update version
Browse files Browse the repository at this point in the history
  • Loading branch information
lpil committed Dec 17, 2023
1 parent 78980c3 commit f699cef
Show file tree
Hide file tree
Showing 12 changed files with 608 additions and 531 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- uses: erlef/setup-beam@v1
with:
otp-version: "26.0.2"
gleam-version: "0.32.0-rc2"
gleam-version: "0.33.0-rc3"
- uses: actions/[email protected]
with:
node-version: "16.18.1"
Expand Down
114 changes: 63 additions & 51 deletions src/gleam/dynamic.gleam
Original file line number Diff line number Diff line change
Expand Up @@ -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),
]),
)
}
}
}
Expand Down Expand Up @@ -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),
]),
)
}
}
}
Expand Down Expand Up @@ -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),
]),
)
}
}
}
Expand Down Expand Up @@ -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),
]),
)
}
}
}
Expand Down Expand Up @@ -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),
]),
)
}
}
}
Expand Down Expand Up @@ -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),
]),
)
}
}
}
Expand Down
30 changes: 12 additions & 18 deletions src/gleam/iterator.gleam
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
})
}
}

Expand Down
8 changes: 3 additions & 5 deletions src/gleam/set.gleam
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down
Loading

0 comments on commit f699cef

Please sign in to comment.