Writing custom ++/2 function

Kernel module have a function ++/2 . How can I implement a custom one like that?

defmodule Test do
  def left +++ right, do: :erlang.++(left, right)
end
warning: found "++" followed by "+", please use a space between "++" and the next "+"
  iex:2

** (CompileError) iex:2: cannot invoke remote function :erlang.+/1 inside a match
    iex:2: (module)
1 Like

+++/2 is none of the allowed custom operators.

4 Likes

Wow, thanks. It completely makes sense

1 Like