Effect CommunityEC
Effect Communityβ€’2y agoβ€’
26 replies
RJ

Reconsidering `Either` Naming Convention to Reflect Its Role as a "Result" Type

Since swapping ye olde type parameter ordering (<R, E, A>) in favor of le nouveau one (<A, E, R>), Either feels like it's in a pretty weird spot. Has any consideration been given to renaming/re-conceiving it to more formally acknowledge its conventional use as a "result" type, which encodes either success ("right") or failure ("left")? Even if that means reversing which direction is considered which. Elm did this with its
Result
type (https://package.elm-lang.org/packages/elm/core/latest/Result), with variants Ok and Err, and I've never heard any complaints. This kind of change feels like it would be very aligned with the latest change to the names of the two sides of a Schema (from From and To to
Type
and Encoded), which I think was a great move.
Was this page helpful?