-
Notifications
You must be signed in to change notification settings - Fork 34
Open
Description
hello !
using tink.CoreApi;
doesn't have same effect as
using tink.core.Promise
for merging.
when using only tink.CoreApi;
the method and(p1:A,p2:B) generates Pair<Outcome,Error>,Outcome,Error>> and not Pair<A,B> as intended.
ex:
using tink.CoreApi;
//using tink.core.Promise;
class Prom{
function new(){
trace( "olé");
var p1= Promise.lift("hop");
var p2=Promise.lift('hip');
(p1 && p2).next(pair->{
$type( pair.a);//String
pair;
})
.tryRecover(e->e)
.handle(n->n);
p1.and(p2).next(pair->{
$type( pair.a);--------------------//tink.Outcome<String, tink.Error>
pair;
})
.tryRecover(e->e)
.handle(n->n);
Promise.and(p1,p2).next(pair->{
$type( pair.a); //String
pair;
})
.tryRecover(e->e)
.handle(n->n);
}
}
don't know if it is by design or what . but it is confusing .
just sayin '
bye.
Metadata
Metadata
Assignees
Labels
No labels