For some reason, Option.fold is curried but Either.fold is not. All in all, I prefer the way Either does, it makes it so much more natural to use named arguments to disambiguate the call
-
-
Replying to @NicolasRinaudo
Currying allows the type parameter to be inferred for the second argument list from the parameter to the first argument. Sometimes that's what you want. (That goes away in Scala 3, though.)
2 replies 0 retweets 2 likes -
Replying to @propensive
I’m mostly complaining about the lack of consistency between Either and Option though. There might be a good reason for ir, but I don’t really see it. Surely if it’s good to help type inference for one, it should also be for the other?
1 reply 0 retweets 0 likes -
Replying to @NicolasRinaudo
I'm not sure the inference ever helps in this case, anyway. But I suspect that the inconsistency comes from the fact Option is structurally asymmetrical, whereas Either was designed to be unbiased (but became such as an afterthought).
1 reply 0 retweets 0 likes
Option's signature is more conventional: it's easier to write a lambda as a single parameter in its own block than as one of several (consider multi-line blocks), but writing Either's the same way would bias type inference for one parameter return type over the other.
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.