class Steep::AST::Types::Var

def self.fresh(name)

def self.fresh(name)
  @mutex ||= Mutex.new
  @mutex.synchronize do
    @max ||= 0
    @max += 1
    new(name: :"#{name}(#{@max})")
  end
end

def ==(other)

def ==(other)
  other.is_a?(Var) &&
    other.name == name
end

def free_variables

def free_variables
  Set.new([name])
end

def hash

def hash
  self.class.hash ^ name.hash
end

def initialize(name:, location: nil)

def initialize(name:, location: nil)
  @name = name
  @location = location
end

def level

def level
  [0]
end

def subst(s)

def subst(s)
  if s.key?(name)
    s[name]
  else
    self
  end
end

def to_s

def to_s
  name.to_s
end

def with_location(new_location)

def with_location(new_location)
  self.class.new(name: name, location: new_location)
end