DEV Community

Discussion on: Write a function that shows off something unique or interesting about the language you're using

Collapse
 
nickforall profile image
Nick Vernij

Pattern matching in elixir can be pretty cool

defmodule Fib do 
  def fib(0) do 0 end
  def fib(1) do 1 end
  def fib(n) do fib(n-1) + fib(n-2) end
end