+1
I appreciate the revisions and agree:
-
Switching the case names to
value
anderror
plays nicely with potential future enum ergonomics. -
While I like
fold
, I understand that language-level sugar aroundswitch
would be better across the board. -
The
map
/flatMap
/mapError
/flatMapError
naming is good. There's no need tomapValue
andflatMapValue
when there's an obvious bias toward the happy path. The existence ofmapValues
andcompactMapValues
onDictionary<Key, Value>
adds clarity to the fact that bothKey
andValue
exist at the same time and the namemap
could imply the ability to transform both. -
The removals all make sense to me.
While I don't love the Swift.Error
constraint, I understand it. I'll continue to define Either
in my projects as a result