Closed wookieb closed 1 year ago
Hi!
I would like to ask why do we have Either<L,R> and not Either<unknown, R> ? Errors are not strongly typed in Js
EDIT1. Also, with this sample from README
const a1 = fromTry(() => 2); // Either<never, number>.Right
const a2 = fromTry(() => {
throw new Error("test");
}); // Either<Error, never>.Left
a1 has type Either<unknown, number>
a2 has type Either<unknown, never>
EDIT2
Same for fromPromise actually, and also
Returns Right
with the promise value if the provided promise fulfilled or Left
with the error value if the provided promise rejected.
I think it's incorrect as it will return Promise of Right or Left, not the Right\Left itself
@Lonli-Lokli You're obviously right! Fixed in another branch. Both addressed in #59
Related to #48