Skip to content

pine/either

 
 

Repository files navigation

Either

Carthage compatible Version License Platform

Either is an implementation of Haskell's Either type in Swift. The current version (1.x) is compatible with Swift 3.

Usage

Either is an enum consisting of either a .right or a .left, each with an associated value. It's commonly used in Haskell for error handling, with Right holding a success value and Left holding a failure value. This is a more functional way of handling errors compared to throwing and catching.

The best way to see this library in action is by looking at the tests. Each function is also commented upon in the Either source.

Installation

Carthage

Add the following to your Cartfile:

github "runkmc/either"

Then run carthage update.

CocoaPods

Add the following to your Podfile:

pod 'Either'

You will also need to make sure you're opting into using frameworks:

use_frameworks!

Then run pod install.

Author

Kevin McGladdery, [email protected]

License

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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Swift 70.8%
  • Ruby 23.3%
  • Objective-C 5.9%