Matchable

public protocol Matchable

Protocol enabling match against custom types via the case pattern.

Conformers decide what "matches" means — for Bool and the integer types it is straight equality; for ranges it is containment. The compiler lowers case <pattern> => to a matches call.

Methods

func matches(Self) -> Bool

Returns true if other matches the receiver.

Defined in lang/std/core/protocols.ks