+1
I appreciate the revisions and agree:
-
Switching the case names to
valueanderrorplays nicely with potential future enum ergonomics. -
While I like
fold, I understand that language-level sugar aroundswitchwould be better across the board. -
The
map/flatMap/mapError/flatMapErrornaming is good. There's no need tomapValueandflatMapValuewhen there's an obvious bias toward the happy path. The existence ofmapValuesandcompactMapValuesonDictionary<Key, Value>adds clarity to the fact that bothKeyandValueexist at the same time and the namemapcould 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 ![]()