Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't combine lefts on Xor and XorT combine #1034

Merged
merged 2 commits into from May 19, 2016

Commits on May 14, 2016

  1. Don't combine lefts on Xor and XorT combine

    Resolves typelevel#888
    
    I don't think there's really a _right_ answer here. Both methods of
    combining `Xor`s are straightforward and law-abiding. However, I think
    that since in pretty much every other context (including the
    `SemigroupK` instances), `Xor` does not combine failures and `Validated`
    does, it is less surprising behavior to not combine left values in
    `combine` methods for `Xor` and `XorT`.
    
    Some notes about related implementations:
    - Scalaz's respective methods (and semigroup instances) _do_ combine
      errors, so this is a deviation from that.
    - The `Semigroup` for `Either` in Haskell has doesn't combine values at
      all, but returns the first `Right` (if any), making it equivalent to
      the behavior of `orElse` and the `SemigroupK` instance for `Xor`.
      Since we have already decided to not go with `orElse`-like behavior
      for our `Option` semigroup, I'm inclined to not take this approach for
      `Xor`.
    
    See also
    typelevel#996 (comment)
    ceedubs committed May 14, 2016
    Configuration menu
    Copy the full SHA
    faf05f9 View commit details
    Browse the repository at this point in the history

Commits on May 17, 2016

  1. Use more descriptive binding name in Xor.combine

    Per @non's suggestion.
    ceedubs committed May 17, 2016
    Configuration menu
    Copy the full SHA
    2f8e0fe View commit details
    Browse the repository at this point in the history