[Haskell-beginners] IO - getContents - putStrLn
mailing at heum.de
Sat Jun 16 20:03:36 CEST 2012
this is probably an easy question, but i simply can't figure out, why
this does not work:
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
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