Struct Nil
- Namespace
- LfrlAnvil.Functional
- Assembly
- LfrlAnvil.Functional.dll
Represents a lack of value.
public readonly struct Nil : IEquatable<Nil>, IComparable<Nil>, IComparable
- Implements
- Inherited Members
- Extension Methods
Fields
Instance
Nil singleton instance.
public static readonly Nil Instance
Field Value
Methods
CompareTo(Nil)
Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.
[Pure]
public int CompareTo(Nil other)
Parameters
otherNilAn object to compare with this instance.
Returns
- int
A value that indicates the relative order of the objects being compared. The return value has these meanings:
Value Meaning Less than zero This instance precedes otherin the sort order.Zero This instance occurs in the same position in the sort order as other.Greater than zero This instance follows otherin the sort order.
CompareTo(object?)
Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.
[Pure]
public int CompareTo(object? obj)
Parameters
objobjectAn object to compare with this instance.
Returns
- int
A value that indicates the relative order of the objects being compared. The return value has these meanings:
Value Meaning Less than zero This instance precedes objin the sort order.Zero This instance occurs in the same position in the sort order as obj.Greater than zero This instance follows objin the sort order.
Exceptions
- ArgumentException
objis not the same type as this instance.
Equals(Nil)
Indicates whether the current object is equal to another object of the same type.
[Pure]
public bool Equals(Nil other)
Parameters
otherNilAn object to compare with this object.
Returns
Equals(object?)
Indicates whether this instance and a specified object are equal.
[Pure]
public override bool Equals(object? obj)
Parameters
objobjectThe object to compare with the current instance.
Returns
- bool
true if
objand this instance are the same type and represent the same value; otherwise, false.
GetHashCode()
Returns the hash code for this instance.
[Pure]
public override int GetHashCode()
Returns
- int
A 32-bit signed integer that is the hash code for this instance.
ToString()
Returns a string representation of this Nil instance.
[Pure]
public override string ToString()
Returns
- string
String representation.
Operators
operator ==(Nil, Nil)
Checks if a is equal to b.
[Pure]
public static bool operator ==(Nil a, Nil b)
Parameters
Returns
- bool
true.
operator >(Nil, Nil)
Checks if a is greater than b.
[Pure]
public static bool operator >(Nil a, Nil b)
Parameters
Returns
- bool
false.
operator >=(Nil, Nil)
Checks if a is greater than or equal to b.
[Pure]
public static bool operator >=(Nil a, Nil b)
Parameters
Returns
- bool
true.
operator !=(Nil, Nil)
Checks if a is not equal to b.
[Pure]
public static bool operator !=(Nil a, Nil b)
Parameters
Returns
- bool
false.
operator <(Nil, Nil)
Checks if a is less than b.
[Pure]
public static bool operator <(Nil a, Nil b)
Parameters
Returns
- bool
false.
operator <=(Nil, Nil)
Checks if a is less than or equal to b.
[Pure]
public static bool operator <=(Nil a, Nil b)
Parameters
Returns
- bool
true.