Sha256: 32ff35964fcabf20a61264ac9e68bd5cc3a8fc1929c0484b6037faa833e71de0
Contents?: true
Size: 488 Bytes
Versions: 11
Compression:
Stored size: 488 Bytes
Contents
# frozen_string_literal: true module Kind require 'kind/monad' class Result::Monad::Wrapper < Kind::Monad::Wrapper def failure(types = Undefined, matcher = Undefined) return if @monad.success? || output? @output = yield(@monad.value) if @monad.result?(types, matcher) end def success(types = Undefined, matcher = Undefined) return if @monad.failure? || output? @output = yield(@monad.value) if @monad.result?(types, matcher) end end end
Version data entries
11 entries across 11 versions & 1 rubygems