Show / Hide Table of Contents
  • MaybeSharp
    • Maybe<T>
      • As
      • Bind
      • Cast
      • CompareTo
      • Equality
      • Equals
      • Explicit
      • GetHashCode
      • GreaterThan
      • GreaterThanOrEqual
      • HasValue
      • Implicit
      • Inequality
      • IsEmpty
      • LessThan
      • LessThanOrEqual
      • Maybe
      • Nothing
      • ToString
      • Value
  • MaybeSharp.Extensions
    • MaybeDictionaryExtensions
      • TryGetValue
    • MaybeExtensions
      • Coalesce
      • Or
      • Select
      • SelectMany
      • SelectNonempty
      • ToNullable
      • ValueOr
      • ValueOrException
      • WhenNothing
      • WhenSomething
      • Where
    • MaybeStringExtensions
      • TryParseBoolean
      • TryParseByte
      • TryParseChar
      • TryParseDateTime
      • TryParseDateTimeOffset
      • TryParseDecimal
      • TryParseDouble
      • TryParseInt
      • TryParseInt16
      • TryParseInt64
      • TryParseSingle
    • NullableExtensions
      • ToMaybe

Operator Equality

Equality(Maybe<T>, Maybe<T>)

Performs equality checking on Maybe{T} instances.

Declaration
public static bool operator ==(Maybe<T> m1, Maybe<T> m2)
Parameters
Type Name Description
Maybe<T> m1

A Maybe{T} instance.

Maybe<T> m2

A Maybe{T} instance.

Returns
Type Description
System.Boolean

True if the instances are equal, otherwise false.

Remarks

Returns true if both instances are 'empty'. Returns false is one instance is empty and the other is not. Otherwise returns the result of EqualityComparer{T}.Default.Equals for the inner values of the maybe instances.

Back to top Copyright (c) 2017 Troy Willmot