Couldn't match expected type `Integer' against inferred type `Int'In the expression: foldl step 0 xsIn the definition of `asInt_foldAux':asInt_foldAux xs= foldl step 0 xswherestep acc '.' = error "cannot handle decimal numbers"step acc x = acc * 10 + digitToInt x
import Data.Char (digitToInt)asInt_fold :: String -> IntegerasInt_fold ('-':xs) = -(asInt_foldAux xs)asInt_fold xs = asInt_foldAux xsasInt_foldAux :: String -> IntegerasInt_foldAux xs = foldl step 0 xswhere step acc '.' = error "cannot handle decimal numbers"step acc x = acc * 10 + digitToInt x