class Algebrick::Type

Any Algebraic type defined by Algebrick is kind of Type

Public Class Methods

new(name, &definition) click to toggle source
Calls superclass method
# File lib/algebrick/type.rb, line 23
def initialize(name, &definition)
  super &definition
  @name = name
end

Public Instance Methods

==(other) click to toggle source
# File lib/algebrick/type.rb, line 36
def ==(other)
  raise NotImplementedError
end
be_kind_of(type) click to toggle source
# File lib/algebrick/type.rb, line 40
def be_kind_of(type)
  raise NotImplementedError
end
inspect() click to toggle source
# File lib/algebrick/type.rb, line 48
def inspect
  to_s
end
match(value, *cases) click to toggle source
Calls superclass method Algebrick::Matching#match
# File lib/algebrick/type.rb, line 52
def match(value, *cases)
  Type! value, self
  super value, *cases
end
name() click to toggle source
Calls superclass method
# File lib/algebrick/type.rb, line 28
def name
  super || @name || nil
end
to_m(*args) click to toggle source
# File lib/algebrick/type.rb, line 32
def to_m(*args)
  raise NotImplementedError
end
to_s() click to toggle source
# File lib/algebrick/type.rb, line 44
def to_s
  raise NotImplementedError
end