jean
05/23/2025, 10:50 AMEither
does, didn’t it?David
05/23/2025, 11:25 AM2.4
so probably in a year or sojean
05/23/2025, 11:30 AMEmil Kantis
05/23/2025, 11:50 AMjean
05/23/2025, 11:53 AMfun somWork(): SuccessReturnType | FailureReturnType { ... }
I wonder if the |
operator is a shortcut to some sort of new Result
type. Then arrow could create some extension types for whatever |
will give to the developersEmil Kantis
05/23/2025, 12:03 PMerror class TransactionError
error class UserError
then a function might in theory return fun withdrawMoney(): TransactionId | UserError | TransactionError
If we instead stick with Either
, then we could have Either<UserError | TransactionError, TransactionId>
which would let us handle only the relevant error types without needing to have a common supertype for those two errors. This would be really neat for error handling IMO, since we get to keep the left/right semantics, with "raise returns", folds etc.jean
05/23/2025, 12:03 PMsimon.vergauwen
05/23/2025, 3:34 PMMichael Friend
05/23/2025, 7:09 PMYoussef Shoaib [MOD]
05/25/2025, 8:26 PMnull
existing, because it allows arbitrary nesting of itself inside itself, which is useful in some scenarios. I suspect what we may do is make Either.Left
an error data class
, and then provide functions that return A | Either.Left
, while still preserving functions that don't.simon.vergauwen
05/26/2025, 6:37 AM