class Funcify::Cond

Public Class Methods

either() click to toggle source

The little Either Cond returns either the result of fn_ok || fn_fail by applying the value to test <t>. > either.(Monad.maybe_value_ok, identity, Monad.maybe_value).(Success(1)) => 1

# File lib/funcify/cond.rb, line 10
def either
  -> test, fn_ok, fn_fail, value { test.(value) ? fn_ok.(value) : fn_fail.(value) }.curry
end