>>>>> "AvI" == Arjan van IJzendoorn <[EMAIL PROTECTED]> writes:

   AvI> Hello Friedrich,
   AvI> Turning a string into an integer is easy with the Prelude function 'read':

   AvI> n :: Integer
   AvI> n = read "-34232"
Yes, other have told me. As I mailed back I was just too blind.

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

   AvI> stringToInteger :: String -> Integer
   AvI> stringToInteger ('-':rest) = -string_to_integer rest
   AvI> stringToInteger string = string_to_integer string
This is quite nice but anyway I do not like it. I can't tell the  reason, but 
it seems to me that this does not desrves an own function.

Regards
Friedrich






Reply via email to