I've got this code:
oof [] = 1
oof [(i,j)] = i+j
oof [(i,7),(5,j)] = i*j
oof (_:_:xs) = foo xs
and I typed it into ghci. When I try to execute the expression:
oof [(3,7),(5,2)]
it should make use of the third line and return 6, but I'll get the error message:
Exception: <interactive>:11:1-21: Non-exhaustive patterns in function foo
Why do I get this exception?