Module: Fear

Extended by:
PatternMatchingApi
Defined in:
lib/fear.rb,
lib/fear/for.rb,
lib/fear/try.rb,
lib/fear/done.rb,
lib/fear/left.rb,
lib/fear/none.rb,
lib/fear/some.rb,
lib/fear/right.rb,
lib/fear/utils.rb,
lib/fear/either.rb,
lib/fear/option.rb,
lib/fear/failure.rb,
lib/fear/success.rb,
lib/fear/version.rb,
lib/fear/right_biased.rb,
lib/fear/pattern_match.rb,
lib/fear/partial_function.rb,
lib/fear/try_pattern_match.rb,
lib/fear/left_pattern_match.rb,
lib/fear/none_pattern_match.rb,
lib/fear/some_pattern_match.rb,
lib/fear/right_pattern_match.rb,
lib/fear/either_pattern_match.rb,
lib/fear/option_pattern_match.rb,
lib/fear/partial_function/any.rb,
lib/fear/pattern_matching_api.rb,
lib/fear/failure_pattern_match.rb,
lib/fear/success_pattern_match.rb,
lib/fear/empty_partial_function.rb,
lib/fear/partial_function/empty.rb,
lib/fear/partial_function/guard.rb,
lib/fear/partial_function_class.rb,
lib/fear/partial_function/lifted.rb,
lib/fear/partial_function/or_else.rb,
lib/fear/partial_function/and_then.rb,
lib/fear/partial_function/combined.rb,
lib/fear/partial_function/guard/or.rb,
lib/fear/partial_function/guard/and.rb,
lib/fear/partial_function/guard/and3.rb

Defined Under Namespace

Modules: Either, For, Mixin, Option, PartialFunction, PatternMatchingApi, Try Classes: EitherPatternMatch, Failure, FailurePatternMatch, Left, LeftPatternMatch, OptionPatternMatch, PatternMatch, Right, RightPatternMatch, Some, Success, SuccessPatternMatch, TryPatternMatch

Constant Summary collapse

Error =
Class.new(StandardError)
NoSuchElementError =
Class.new(Error)
MatchError =
Class.new(Error)
Done =

Typically used to signal completion but there is no actual value completed.

Examples:

if user.valid?
  Right(Done)
else
  Left(user.errors)
end
Object.new.tap do |done|
  # @return [String]
  def done.to_s
    'Done'
  end

  # @return [String]
  def done.inspect
    'Done'
  end
end.freeze
None =

The only instance of NoneClass

NoneClass.new.freeze
VERSION =
'0.11.0'.freeze

Method Summary

Methods included from PatternMatchingApi

case, match, matcher