Latest 1.0.2
Homepage https://github.com/runkmc/either
License MIT
Platforms ios 8.0, requires ARC
Authors

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.

Latest podspec

{
    "name": "Either",
    "version": "1.0.2",
    "summary": "An implementation of Haskell's Either type in Swift",
    "description": "From the Haskell documentation on the Either type:nnThe Either type represents values with two possibilities: a value of type Either a b is either Left a or Right b.nnThe Either type is sometimes used to represent a value which is either correct or an error; by convention, the Left constructor is used to hold an error value and the Right constructor is used to hold a correct value (mnemonic: "right" also means "correct").",
    "homepage": "https://github.com/runkmc/either",
    "license": "MIT",
    "authors": {
        "Kevin McGladdery": "[email protected]"
    },
    "source": {
        "git": "https://github.com/runkmc/either.git",
        "tag": "1.0.2"
    },
    "platforms": {
        "ios": "8.0"
    },
    "requires_arc": true,
    "source_files": "Either/**/*",
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This