[Haskell-beginners] Reading input

Chaddaï Fouché chaddai.fouche at gmail.com
Thu Aug 21 00:09:53 EDT 2008


2008/8/21 Chaddaï Fouché <chaddai.fouche at gmail.com>:
>
> Another possibility would be a space delimited number list, easier for
> your users to remember :
>
>> parseWordList :: (Read a) => String -> [a]
>> parseWordList str = map read . unwords $ str
>>

Oups, that was wrong :
> parseWordList :: (Read a) => String -> [a]
> parseWordList str = map read . words $ str

-- 
Jedaï


More information about the Beginners mailing list