class Steep::Subtyping::Relation
def ==(other)
def ==(other) other.is_a?(self.class) && other.sub_type == sub_type && other.super_type == super_type end
def flip
def flip self.class.new( sub_type: super_type, super_type: sub_type ) end
def hash
def hash self.class.hash ^ sub_type.hash ^ super_type.hash end
def initialize(sub_type:, super_type:)
def initialize(sub_type:, super_type:) @sub_type = sub_type @super_type = super_type end
def map
def map self.class.new( sub_type: yield(sub_type), super_type: yield(super_type) ) end
def to_s
def to_s "#{sub_type} <: #{super_type}" end