class SFRP::Poly::FuncCallExp

Public Class Methods

new(func_str, arg_exps, id = nil) click to toggle source
# File lib/sfrp/poly/expression.rb, line 45
def initialize(func_str, arg_exps, id = nil)
  @func_str = func_str
  @arg_exps = arg_exps
  @id = id
end

Public Instance Methods

called_func_strs() click to toggle source
# File lib/sfrp/poly/expression.rb, line 63
def called_func_strs
  [@func_str, *@arg_exps.flat_map(&:called_func_strs)]
end
clone() click to toggle source
# File lib/sfrp/poly/expression.rb, line 59
def clone
  FuncCallExp.new(@func_str, @arg_exps.map(&:clone), @id)
end
to_mono(monofier) click to toggle source
# File lib/sfrp/poly/expression.rb, line 67
def to_mono(monofier)
  raise UndeterminableTypeError.new(@id, @typing) unless @typing.mono?
  mono_func_str = monofier.use_func(@func_str, @ftyping)
  args = @arg_exps.map { |e| e.to_mono(monofier) }
  M.call_e(monofier.use_type(@typing), mono_func_str, *args)
end
typing(set, var_env) click to toggle source
# File lib/sfrp/poly/expression.rb, line 51
def typing(set, var_env)
  raise if @typing
  @ftyping = set.func(@func_str).ftyping(set).instance do |ft|
    ft.params.zip(@arg_exps) { |t, e| e.typing(set, var_env).unify(t) }
  end
  @typing = @ftyping.body
end