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
- string to Integer Friedrich Dominicus
- Re: string to Integer Lars Lundgren
- Re: string to Integer Arjan van IJzendoorn
- Re: string to Integer Friedrich Dominicus
- Re: string to Integer Ralf Muschall
- Re: string to Integer Hamilton Richards
- Re: string to Integer Peter Hancock
- Re: string to Integer Ronny Wichers Schreur
- Re: string to Integer Ralf Muschall
- Re: string to Integer Ronny Wichers Schreur
- Re: string to Integer Ronny Wichers Schreur
- Re: string to Integer Yuichi Tsuchimoto
- Re: string to Integer Jon Fairbairn
