I'm going through Learn you a Haskell and some of the examples don't seem to work. I'm assuming that tutorial is reputable enough, so I'm a bit surprised. A couple of examples, in GHCi 8.0.2:
length' [] = 0
length' (_:xs) = 1 + length' xs
l = [1,2,3]
length' l
*** Exception: <interactive>:2:1-31: Non-exhaustive patterns in function length'
sum' [] = 0
sum' (x:xs) = x + sum' xs
l = [1,2,3]
sum' l
*** Exception: <interactive>:2:1-25: Non-exhaustive patterns in function sum'
From here: http://learnyouahaskell.com/syntax-in-functions.
The functions look correct enough, so, what's going on here, what did I do wrong?