bind

Wraps a value as an Either monad

  1. Either!(Any, T) bind(T value)
  2. Either!(Left, Right) bind(T value)
  3. auto bind(T value)
  4. auto bind(T value)
  5. void bind()
  6. Either!(PickDefinedType!(L, Left), PickDefinedType!(R, Right)) bind(This value)
    Either!(PickDefinedType!(L, Left), PickDefinedType!(R, Right))
    bind
    (
    Left
    Right
    This : Either!(L, R)
    L
    R
    )
    (
    This value
    )
    if ()

Examples

returns a right hand Either when the value is an int

auto result = bind(5);

result.isLeft.should.equal(false);
result.isRight.should.equal(true);

Meta