In Elixir I can define def add(a, b), do: a + b inside a module and call it as Math.add(1, 2). If I write add = fn a, b -> a + b end, I must call it as add.(1, 2); plain add(1, 2) gives an undefined function error. And to pass the named one to Enum.map I need &Math.add/2.
Why are there two kinds of function with different call syntax, and what are the practical differences between them?




