Hello Friedrich,

Turning a string into an integer is easy with the Prelude function 'read':

n :: Integer
n = read "-34232"

Your own function can be made to work for negative numbers by a simple
wrapper:

stringToInteger :: String -> Integer
stringToInteger ('-':rest) = -string_to_integer rest
stringToInteger string = string_to_integer string

> string_to_integer :: String -> Integer
> string_to_integer =  string_to_int_list .| int_list_to_integer

Bye,
 Arjan



Reply via email to