How is pattern matching done in haskell? code example
Example: pattern matching in haskell
factorial :: (Integral a) => a -> a
factorial 0 = 1
factorial n = n * factorial (n - 1)
factorial :: (Integral a) => a -> a
factorial 0 = 1
factorial n = n * factorial (n - 1)