Given this code:
defmodule Foo do
def bar(i), do: i * 2
end
anon = fn (i) -> i * 2 end
import Foo
Foo.bar(3) # 6
Foo.bar 3 # 6
bar(3) # 6
bar 3 # 6
(&bar/1).(3) # 6
anon.(3) # 6
3 |> Foo.bar() # 6
3 |> Foo.bar # 6
3 |> bar() # 6
3 |> bar # 6
3 |> (&bar/1).() # 6
3 |> anon.() # 6
Both are functions, one anonymous one defined in a module. Yet calling them is very different, starting with the dot before the parenthesis for the anonymous function. Also, you can't call it without parenthesis, unlike named functions
Is there a reason for this distinction?
If not, I propose to remove that distinction and have the call be the same.