Re: String manipulation.

2002-02-07 Thread Hal Daume III
You should have a look at the Read class. A member a of the Read class has a function read :: String -> a. so, for example, you can say: (read "5.0") :: Double to read this as a double. You could also read it as an integer or something. If you have a list of strings that you want to conver

RE: String manipulation.

2002-02-07 Thread Chris Angus
Title: RE: String manipulation. You may want to use reads as read will call error if the string is not an integer or use something akin to the example below readMaybeInt :: String -> Maybe Int readMaybeInt s = case reads s of   [(x,_)] ->

Re: String manipulation.

2002-02-07 Thread DK
Title: RE: String manipulation. Thank you very much I'll try both approaches.   Regards, Dimitris Keramidas

Re: String manipulation.

2002-02-08 Thread Ketil Z. Malde
"DK" <[EMAIL PROTECTED]> writes: > What I would like to ask, is how can I take a string from a list, and > manipulate it, in order to convert it to an integer. That's very simple, and I'm of course happy to help out with homework questions. (That's what mailinglists are for, after all.) So, ho