6 ms·
For the typescript world, there is neverthrow[0] which offers a similar Result type. [0]: https://github.com/supermacro/neverthrow https://github.com/supermacr
by paduc 11mo ago
For the typescript world, there is neverthrow[0] which offers a similar Result type.
[0]: https://github.com/supermacro/neverthrow https://github.com/supermacro/neverthrow
- pshirshov 11mo agoPromise<Result<number, string>> everywhere or type EitherT[F[_], E, A] = F[Either[E, A]] and then def dosomething(): F[String, Number] ? Isn't this beautiful: https://github.com/7mind/distage-example/blob/develop/bifunctor-tagless/src/main/scala/leaderboard/services/Ranks.scala https://github.com/7mind/distage-example/blob/develop/bifunc... ?
- RedNifre 11mo agoWhy does it have Either? Doesn't TypeScript have "A | B" style sum types?
- seivan 11mo ago[dead]
- pshirshov 11mo agoEither is biased, union is not. Probably we should say "union" instead of sum, as typescript unions are not discriminated. string | string in typescript is exactly the same as just string, while Either[String, String] is a type which is exactly a sum of two string types. Plus Either is biased towards R, the happy path value.