Skip to content

Latest commit

History

10 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

Either

XcodeSwiftGitHub tag (latest SemVer)GitHub

What

Either is a Swift Package Manager package for iOS/tvOS (11.0 and above), watchOS (5.0 and above), and macOS (10.14 and above), under Swift 5.0 and above, implementing a simple Either type, with a few built-in and useful properties and protocol conformances:

publicenumEither<LHS, RHS>{case lhs(LHS)case rhs(RHS)publicvarlhs:LHS?publicvarrhs:RHS?}extensionEither:Equatablewhere LHS:Equatable, RHS:Equatable{}extensionEither:Hashablewhere LHS:Hashable, RHS:Hashable{}extensionEither:Codablewhere LHS:Codable, RHS:Codable{ /* ... */ }
/// The comparison operator `<` does what one would expect when its operands
/// have values of the same associated type. If the operands have values of
/// different associated types, then the left hand side type, `LHS`, is always
/// considered to be lower than the right hand side type, `RHS`.
extensionEither:Comparablewhere LHS:Comparable, RHS:Comparable{ /* ... */ }

Installation

Either is provided only as a Swift Package Manager package, because I'm moving away from CocoaPods and Carthage, and can be easily installed directly from Xcode.

License

Either is available under the MIT license. See the LICENSE file for more info.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages