@@ -84,10 +84,37 @@ export function and<L, R>(second: Uncertain<L, R>): {
84
84
}
85
85
86
86
/** Logical or for Futures. See https://github.com/fluture-js/Fluture#alt */
87
- export function alt < L , R > ( left : FutureInstance < L , R > ) : ( right : FutureInstance < L , R > ) => FutureInstance < L , R >
87
+ export function alt < L > ( second : Rejected < L > ) : {
88
+ ( first : Never ) : Never
89
+ ( first : Rejected < any > ) : Rejected < L >
90
+ < R > ( first : Resolved < R > ) : Resolved < R >
91
+ < R > ( first : Uncertain < any , R > ) : Uncertain < L , R >
92
+ }
93
+
94
+ /** Logical or for Futures. See https://github.com/fluture-js/Fluture#alt */
95
+ export function alt < L , R > ( second : Uncertain < L , R > ) : {
96
+ < T > ( first : Resolved < T > ) : Resolved < T >
97
+ ( first : Rejected < any > ) : Uncertain < L , R >
98
+ ( first : Uncertain < any , R > ) : Uncertain < L , R >
99
+ }
100
+
101
+ /** Race two ConcurrentFutures. See https://github.com/fluture-js/Fluture#alt */
102
+ export function alt ( second : ConcurrentNever ) : < L , R > ( first : ConcurrentUncertain < L , R > ) => ConcurrentUncertain < L , R >
103
+
104
+ /** Race two ConcurrentFutures. See https://github.com/fluture-js/Fluture#alt */
105
+ export function alt < L > ( second : ConcurrentRejected < L > ) : {
106
+ < R > ( first : ConcurrentResolved < R > ) : ConcurrentUncertain < L , R >
107
+ < R > ( first : ConcurrentUncertain < L , R > ) : ConcurrentUncertain < L , R >
108
+ }
109
+
110
+ /** Race two ConcurrentFutures. See https://github.com/fluture-js/Fluture#alt */
111
+ export function alt < R > ( second : ConcurrentResolved < R > ) : {
112
+ < L > ( first : ConcurrentRejected < L > ) : ConcurrentUncertain < L , R >
113
+ < L > ( first : ConcurrentUncertain < L , R > ) : ConcurrentUncertain < L , R >
114
+ }
88
115
89
116
/** Race two ConcurrentFutures. See https://github.com/fluture-js/Fluture#alt */
90
- export function alt < L , R > ( left : ConcurrentFutureInstance < L , R > ) : ( right : ConcurrentFutureInstance < L , R > ) => ConcurrentFutureInstance < L , R >
117
+ export function alt < L , R > ( second : ConcurrentUncertain < L , R > ) : ( first : ConcurrentUncertain < L , R > ) => ConcurrentUncertain < L , R >
91
118
92
119
/** Apply the function in the right Future to the value in the left Future. See https://github.com/fluture-js/Fluture#ap */
93
120
export function ap < L , RA > ( value : FutureInstance < L , RA > ) : < RB > ( apply : FutureInstance < L , ( value : RA ) => RB > ) => FutureInstance < L , RB >
0 commit comments