Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7d690f1

Browse files
committed
gleam 1.8.0
1 parent 9006998 commit 7d690f1

File tree

13 files changed

+2183
-345
lines changed

13 files changed

+2183
-345
lines changed

.github/workflows/test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88

99
env:
1010
otp: "27.0"
11-
gleam: "1.6.1"
11+
gleam: "1.8.0"
1212
rebar: "3"
1313

1414
jobs:
@@ -39,7 +39,7 @@ jobs:
3939
runs-on: ubuntu-latest
4040
strategy:
4141
matrix:
42-
node-version: [20.x, 22.x, 23.x]
42+
node-version: [22.x, 23.x]
4343
steps:
4444
- uses: actions/checkout@v4
4545
- uses: erlef/setup-beam@v1
@@ -70,7 +70,7 @@ jobs:
7070
- run: bun install
7171
- uses: actions/setup-node@v4
7272
with:
73-
node-version: 20.x
73+
node-version: 22.x
7474
- run: yarn build
7575
- run: gleam test --target javascript --runtime bun
7676
- run: bun test ./specs/test_dist.spec.js

.tool-versions

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
gleam 1.6.2
2-
erlang 27.1.2
3-
nodejs 22.11.0
4-
deno 2.1.1
1+
gleam 1.8.0
2+
erlang 27.2.1
3+
nodejs 22.13.1
4+
deno 2.1.9

dist/delay.d.mts

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,65 +2,65 @@
22
/**
33
* Type representing a delayed effect to be lazily evaluated
44
*/
5-
export type Delay$<MKH, MKI> = Continue<MKH, MKI> | Stop<MKI>
5+
export type Delay$<JAJ, JAI> = Continue<JAJ, JAI> | Stop<JAJ>
66

77

88
/**
99
* Stores an effect to be run later, short circuiting on errors
1010
*/
11-
export function delay_effect<MKJ, MKK>(func: () => Result<MKJ, MKK>): Delay$<MKJ, MKK>
11+
export function delay_effect<JAK, JAL>(func: () => Result<JAK, JAL>): Delay$<JAK, JAL>
1212

1313

1414
/**
1515
* Chains an operation onto an existing delay. The result of the current delay will be lazily passed to `func`
1616
* `func` will not be called if the delay has already returned an error
1717
*/
18-
export function map<MKP, MKQ, MKT>(delayed: Delay$<MKP, MKQ>, func: (x0: MKP) => Result<MKT, MKQ>): Delay$<MKT, MKQ>
18+
export function map<JAQ, JAR, JAU>(delayed: Delay$<JAQ, JAR>, func: (x0: JAQ) => Result<JAU, JAR>): Delay$<JAU, JAR>
1919

2020

2121
/**
2222
* flatten a nested Delay
2323
*/
24-
export function flatten<MLH, MLI>(delayed: Delay$<Delay$<MLH, MLI>, MLI>): Delay$<MLH, MLI>
24+
export function flatten<JBI, JBJ>(delayed: Delay$<Delay$<JBI, JBJ>, JBJ>): Delay$<JBI, JBJ>
2525

2626

2727
/**
2828
* Map and then flatten `delayed`
2929
*/
30-
export function flat_map<MLP, MLQ, MLT>(
31-
delayed: Delay$<MLP, MLQ>,
32-
func: (x0: MLP) => Result<Delay$<MLT, MLQ>, MLQ>
33-
): Delay$<MLT, MLQ>
30+
export function flat_map<JBQ, JBR, JBU>(
31+
delayed: Delay$<JBQ, JBR>,
32+
func: (x0: JBQ) => Result<Delay$<JBU, JBR>, JBR>
33+
): Delay$<JBU, JBR>
3434

3535

3636
/**
3737
* Run a delayed effect and get the result
3838
* short-circuiting if any in delay in the chain returns an Error
3939
*/
40-
export function run<MNE, MNF>(delayed: Delay$<MNE, MNF>): Result<MNE, MNF>
40+
export function run<JDF, JDG>(delayed: Delay$<JDF, JDG>): Result<JDF, JDG>
4141

4242

4343
/**
4444
* returns a delay, that joins two delays. If `left` fails `right` will not be run, if either fails the result will be an Error
4545
*/
46-
export function join<MMA, MMB, MME, MMF>(
47-
left: Delay$<MMA, MMB>,
48-
right: Delay$<MME, MMF>
49-
): Delay$<[MMA, MME], [Option$<MMB>, Option$<MMF>]>
46+
export function join<JCB, JCC, JCF, JCG>(
47+
left: Delay$<JCB, JCC>,
48+
right: Delay$<JCF, JCG>
49+
): Delay$<[JCB, JCF], [Option$<JCC>, Option$<JCG>]>
5050

5151

5252
/**
5353
* Returns a new Delay that will be re-attempted `retries` times with `delay` ms in-between
5454
* Note: JS uses busy waiting
5555
*/
56-
export function retry<MMM, MMN>(delayed: Delay$<MMM, MMN>, retries: number, delay: number): Delay$<MMM, MMN>
56+
export function retry<JCN, JCO>(delayed: Delay$<JCN, JCO>, retries: number, delay: number): Delay$<JCN, JCO>
5757

5858

5959
/**
6060
* Returns a new Delay that will be re-attempted `retries` times with `delay` ms in-between
6161
* Note: JS uses busy waiting
6262
*/
63-
export function retry_with_backoff<MMS, MMT>(delayed: Delay$<MMS, MMT>, retries: number): Delay$<MMS, MMT>
63+
export function retry_with_backoff<JCT, JCU>(delayed: Delay$<JCT, JCU>, retries: number): Delay$<JCT, JCU>
6464

6565

6666
/**
@@ -73,13 +73,13 @@ export function drain(delayed: Delay$<any, any>): undefined
7373
/**
7474
* Run every effect in sequence and get their results
7575
*/
76-
export function every<MNV, MNW>(effects: List<Delay$<MNV, MNW>>): List<Result<MNV, MNW>>
76+
export function every<JDW, JDX>(effects: List<Delay$<JDW, JDX>>): List<Result<JDW, JDX>>
7777

7878

7979
/**
8080
* Repeat a Delay and return the results in a list
8181
*/
82-
export function repeat<MNO, MNP>(delayed: Delay$<MNO, MNP>, repetition: number): List<Result<MNO, MNP>>
82+
export function repeat<JDP, JDQ>(delayed: Delay$<JDP, JDQ>, repetition: number): List<Result<JDP, JDQ>>
8383

8484

8585
/**
@@ -100,24 +100,24 @@ export function any(effects: List<Delay$<any, any>>): boolean
100100
* Attempt multiple Delays until one returns an Ok
101101
* unlike `any/1` this will short circuit on the first Ok
102102
*/
103-
export function fallthrough<MOY, MOZ>(effects: List<Delay$<MOY, MOZ>>): Result<MOY, MOZ>
103+
export function fallthrough<JEZ, JFA>(effects: List<Delay$<JEZ, JFA>>): Result<JEZ, JFA>
104104

105-
export class Continue<MKH, MKI> extends CustomType {
105+
export class Continue<JAJ, JAI> extends CustomType {
106106
constructor(effect: () => Result<any, any>)
107107
effect(): Result<any, any>
108108
}
109109

110-
export class Stop<MKI> extends CustomType {
111-
constructor(err: MKI)
112-
err: MKI
110+
export class Stop<JAJ> extends CustomType {
111+
constructor(err: JAJ)
112+
err: JAJ
113113
}
114114

115115
export class Result<T, E> extends CustomType {
116116
static isResult(data: unknown): boolean
117117
isOk(): boolean
118118
}
119119

120-
export type Option$<FQ> = Some<FQ> | None
120+
export type Option$<GA> = Some<GA> | None
121121

122122
export class List<T> implements any {
123123
head: T
@@ -136,9 +136,9 @@ export class CustomType {
136136
}): this
137137
}
138138

139-
export class Some<FQ> extends CustomType {
140-
constructor(argument$0: FQ)
141-
0: FQ
139+
export class Some<GA> extends CustomType {
140+
constructor(argument$0: GA)
141+
0: GA
142142
}
143143

144144
export class None extends CustomType {}

dist/delay.mjs

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,6 @@ var unicode_whitespaces = [
7676
"\u2029"
7777
// Paragraph separator
7878
].join("")
79-
var trim_start_regex = new RegExp(`^[${unicode_whitespaces}]*`)
80-
var trim_end_regex = new RegExp(`[${unicode_whitespaces}]*$`)
81-
var trim_regex = new RegExp(`^[${unicode_whitespaces}]*(.*?)[${unicode_whitespaces}]*$`)
8279

8380
function length_loop(loop$list, loop$count) {
8481
while (true) {
@@ -98,23 +95,23 @@ function length2(list) {
9895
return length_loop(list, 0)
9996
}
10097
__name(length2, "length")
101-
function reverse_loop(loop$remaining, loop$accumulator) {
98+
function reverse_and_prepend(loop$prefix, loop$suffix) {
10299
while (true) {
103-
let remaining = loop$remaining
104-
let accumulator = loop$accumulator
105-
if (remaining.hasLength(0)) {
106-
return accumulator
100+
let prefix = loop$prefix
101+
let suffix = loop$suffix
102+
if (prefix.hasLength(0)) {
103+
return suffix
107104
} else {
108-
let item = remaining.head
109-
let rest$1 = remaining.tail
110-
loop$remaining = rest$1
111-
loop$accumulator = listPrepend7(item, accumulator)
105+
let first$1 = prefix.head
106+
let rest$1 = prefix.tail
107+
loop$prefix = rest$1
108+
loop$suffix = listPrepend7(first$1, suffix)
112109
}
113110
}
114111
}
115-
__name(reverse_loop, "reverse_loop")
112+
__name(reverse_and_prepend, "reverse_and_prepend")
116113
function reverse(list) {
117-
return reverse_loop(list, toList8([]))
114+
return reverse_and_prepend(list, toList8([]))
118115
}
119116
__name(reverse, "reverse")
120117
function filter_loop(loop$list, loop$fun, loop$acc) {
@@ -208,10 +205,10 @@ import {
208205
Error as Error11,
209206
toList as toList9,
210207
prepend as listPrepend8,
211-
CustomType as $CustomType8,
212-
makeError
208+
CustomType as $CustomType7,
209+
makeError as makeError2
213210
} from "./extras/prelude.mjs"
214-
var Continue = class extends $CustomType8 {
211+
var Continue = class extends $CustomType7 {
215212
static {
216213
__name(this, "Continue")
217214
}
@@ -220,7 +217,7 @@ var Continue = class extends $CustomType8 {
220217
this.effect = effect
221218
}
222219
}
223-
var Stop = class extends $CustomType8 {
220+
var Stop = class extends $CustomType7 {
224221
static {
225222
__name(this, "Stop")
226223
}
@@ -409,7 +406,7 @@ function do_every(loop$effects, loop$results) {
409406
loop$effects = rest
410407
loop$results = listPrepend8(run(head), results)
411408
} else {
412-
throw makeError("panic", "delay", 196, "do_every", "Empty list", {})
409+
throw makeError2("panic", "delay", 196, "do_every", "Empty list", {})
413410
}
414411
}
415412
}
@@ -471,7 +468,7 @@ function do_fallthrough(effects) {
471468
return fallthrough(rest)
472469
})
473470
} else {
474-
throw makeError("panic", "delay", 211, "do_fallthrough", "Empty list", {})
471+
throw makeError2("panic", "delay", 211, "do_fallthrough", "Empty list", {})
475472
}
476473
}
477474
__name(do_fallthrough, "do_fallthrough")

dist/extras/prelude.d.mts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,7 @@ export class NonEmpty<T> extends List<T> {}
225225

226226
export class BitArray {
227227
buffer: Uint8Array
228+
constructor(buffer: Uint8Array)
228229
get length(): number
229230
byteAt(index: number): number
230231
floatFromSlice(index: number, end: number, isBigEndian: boolean): number

0 commit comments

Comments
 (0)