I am having trouble with some haskell code. Namely a function checksum which is meant to check whether the sum of a list of Integers is equal to the Integer argument tot.
There is something wrong with the syntax because I keep getting:
Main.hs:11:1: Parse error in pattern: checksum
And the module isn't loaded.
checksum :: ([Int], Int) -> (Bool, Int)
checksum [x] tot
| x == tot = (True, tot)
| otherwise = (False, tot)
checksum x:xs tot = checksum xs tot-x`