f x
| x > 0 = 1
| otherwise = 0
def abs(number) when number > 0, do: number
def abs(number), do: -number
Languages with Runtime Guards include Haskell, Elixir
View all concepts with or missing a hasRunTimeGuards measurement
Read more about Runtime Guards on the web: 1.