Module: Rigor::Type::PlainLattice

Included in:
BoundMethod, Constant, DataClass, DataInstance, HashShape, IntegerRange, Intersection, Nominal, Singleton, StructClass, StructInstance, Tuple
Defined in:
lib/rigor/type/plain_lattice.rb

Overview

Supplies the lattice-membership trio for the “plain” carriers — the concrete value types that are neither a lattice extreme (‘Top` / `Bot` / `Dynamic`) nor a wrapper that computes membership from an inner type.

Every such carrier answers ‘top` / `bot` / `dynamic` with the same `Trinary.no` (“this value is not that lattice point”), so the trio lived as a byte-identical copy in a dozen carriers. The extremes override the relevant member (`Top#top` / `Bot#bot` / `Dynamic#dynamic` answer `Trinary.yes`) and the delegators (`App`, `Difference`, `Refined`, `Union`) compute `dynamic` from their inner type(s); none of those include this module.

Mirrors the existing AcceptanceRouter / ‘ValueSemantics` mixins —narrow trait sharing, never carrier inheritance (which the type-object contract forbids).

Instance Method Summary collapse

Instance Method Details

#botObject



28
29
30
# File 'lib/rigor/type/plain_lattice.rb', line 28

def bot
  Trinary.no
end

#dynamicObject



32
33
34
# File 'lib/rigor/type/plain_lattice.rb', line 32

def dynamic
  Trinary.no
end

#topObject



24
25
26
# File 'lib/rigor/type/plain_lattice.rb', line 24

def top
  Trinary.no
end