class Ecu::ValueComparison

def arrays_eql?(left, right)

def arrays_eql?(left, right)
  return false unless left.size == right.size
  left.zip(right).all? { self.class.new(*_1).eql? }
end

def check_compatibility(left, right)

def check_compatibility(left, right)
  if left.class != right.class
    fail ArgumentError, "Values must have the same class for comparison (#{left}: #{left.class}/#{right}: #{right.class})"
  end
end

def eql?

def eql?
  case [@left, @right]
  in [NilClass, NilClass] then @left == @right
  in [String, String]     then @left == @right
  in [Numeric, Numeric]   then @left == @right
  in [Array, Array]       then arrays_eql?(@left, @right)
  in [_, _]               then false
  end
end

def initialize(left, right)

def initialize(left, right)
  # check_compatibility(left, right)
  @left, @right = left, right
end