[Haskell-beginners] IO - getContents - putStrLn
Robert Heumüller
mailing at heum.de
Sat Jun 16 20:03:36 CEST 2012
Hi,
this is probably an easy question, but i simply can't figure out, why
this does not work:
import Data.Char
main = do
contents <- getContents
putStrLn $ show $ splitcomma contents
splitcomma = split ','
split :: Char -> String -> [String]
split _ "" = [""]
split sp (c:cs)
| c == sp = "": rest
| otherwise = (c : head rest) : tail rest
where
rest = split sp cs
The program compiles and runs without any problems. But there is
absolutely no output, when f.eg. i type "hello, world" and hit return.
Why would that be?
Thank you very much
More information about the Beginners
mailing list