2
2
/**
3
3
* Type representing a delayed effect to be lazily evaluated
4
4
*/
5
- export type Delay$ < MKH , MKI > = Continue < MKH , MKI > | Stop < MKI >
5
+ export type Delay$ < JAJ , JAI > = Continue < JAJ , JAI > | Stop < JAJ >
6
6
7
7
8
8
/**
9
9
* Stores an effect to be run later, short circuiting on errors
10
10
*/
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 >
12
12
13
13
14
14
/**
15
15
* Chains an operation onto an existing delay. The result of the current delay will be lazily passed to `func`
16
16
* `func` will not be called if the delay has already returned an error
17
17
*/
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 >
19
19
20
20
21
21
/**
22
22
* flatten a nested Delay
23
23
*/
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 >
25
25
26
26
27
27
/**
28
28
* Map and then flatten `delayed`
29
29
*/
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 >
34
34
35
35
36
36
/**
37
37
* Run a delayed effect and get the result
38
38
* short-circuiting if any in delay in the chain returns an Error
39
39
*/
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 >
41
41
42
42
43
43
/**
44
44
* returns a delay, that joins two delays. If `left` fails `right` will not be run, if either fails the result will be an Error
45
45
*/
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 > ] >
50
50
51
51
52
52
/**
53
53
* Returns a new Delay that will be re-attempted `retries` times with `delay` ms in-between
54
54
* Note: JS uses busy waiting
55
55
*/
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 >
57
57
58
58
59
59
/**
60
60
* Returns a new Delay that will be re-attempted `retries` times with `delay` ms in-between
61
61
* Note: JS uses busy waiting
62
62
*/
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 >
64
64
65
65
66
66
/**
@@ -73,13 +73,13 @@ export function drain(delayed: Delay$<any, any>): undefined
73
73
/**
74
74
* Run every effect in sequence and get their results
75
75
*/
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 > >
77
77
78
78
79
79
/**
80
80
* Repeat a Delay and return the results in a list
81
81
*/
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 > >
83
83
84
84
85
85
/**
@@ -100,24 +100,24 @@ export function any(effects: List<Delay$<any, any>>): boolean
100
100
* Attempt multiple Delays until one returns an Ok
101
101
* unlike `any/1` this will short circuit on the first Ok
102
102
*/
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 >
104
104
105
- export class Continue < MKH , MKI > extends CustomType {
105
+ export class Continue < JAJ , JAI > extends CustomType {
106
106
constructor ( effect : ( ) => Result < any , any > )
107
107
effect ( ) : Result < any , any >
108
108
}
109
109
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
113
113
}
114
114
115
115
export class Result < T , E > extends CustomType {
116
116
static isResult ( data : unknown ) : boolean
117
117
isOk ( ) : boolean
118
118
}
119
119
120
- export type Option$ < FQ > = Some < FQ > | None
120
+ export type Option$ < GA > = Some < GA > | None
121
121
122
122
export class List < T > implements any {
123
123
head : T
@@ -136,9 +136,9 @@ export class CustomType {
136
136
} ) : this
137
137
}
138
138
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
142
142
}
143
143
144
144
export class None extends CustomType { }
0 commit comments