-- Here the |s should be read as one vertical line, like a mathematical function def.
fact n | n == 0 = 1
| otherwise = n * fact (n - 1)
-- Here's the same thing in different style, the same one as I'd used earlier and
-- called "declarative", sometimes called direct pattern matching, because each
-- variant gets to bind whatever it managed to match.
fact 0 = 1
fact n = n * fact (n - 1)