Class: Kleisli::Validation

Inherits:
Either
  • Object
show all
Defined in:
lib/kleisli/validation.rb

Direct Known Subclasses

Failure, Success

Defined Under Namespace

Classes: Failure, Success

Constant Summary collapse

VERSION =
"0.0.2"

Instance Method Summary collapse

Instance Method Details

#*(other) ⇒ Object



9
10
11
12
13
14
15
# File 'lib/kleisli/validation.rb', line 9

def *(other)
  self >-> f {
    other >-> val {
      Success(f.arity > 1 ? f.curry.call(val) : f.call(val))
    }
  }
end