Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

lambdash.either

mwardle6MIT0.7.0-alpha.2

Either data type for lambdash

readme

Either

This package implements an either type for lambdash.

Installation

Use npm.


npm install --save lambdash.either

Implements

  1. Eq
  2. Ord
  3. Functor
  4. Semigroup (If its right type implements Semigroup)
  5. Monoid
  6. Foldable
  7. Applicative
  8. Monad
  9. Show

Typed Either

By default the Either implementation accepts any value for the left or the right. You can create typed Either like so:

    var _ = require('lambdash');
    var Either = require('lambdash.either')

    // An either that accepts strings on the left and numbers on the right
    var StringOrNumber = Either.Typed(_.Str, _.Num);