[Revised] SE-0235: Add Result to the Standard Library

+1

I appreciate the revisions and agree:

  • Switching the case names to value and error plays nicely with potential future enum ergonomics.

  • While I like fold, I understand that language-level sugar around switch would be better across the board.

  • The map/flatMap/mapError/flatMapError naming is good. There's no need to mapValue and flatMapValue when there's an obvious bias toward the happy path. The existence of mapValues and compactMapValues on Dictionary<Key, Value> adds clarity to the fact that both Key and Value exist at the same time and the name map 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 :slight_smile:

4 Likes