Name: Anonymous 2007-12-10 20:39
import qualified Data.ByteString as BS
import System.IO
message :: [Char]
message = ('H':'e':'l':'l':'o':',':' ':[])
++
('w':'o':'r':'l':'d':'!':[])
putHelloWorld :: [Char] -> IO()
putHelloWorld (x:xs) =
Prelude.putChar(x) >> putHelloWorld xs
putHelloWorld [] = Prelude.putChar('\n')
main :: IO ()
main =
hSetBuffering stdout NoBuffering >> hSetBuffering stdin LineBuffering
>> putHelloWorld(message)
can I short the code somehow?
thanks in advance
import System.IO
message :: [Char]
message = ('H':'e':'l':'l':'o':',':' ':[])
++
('w':'o':'r':'l':'d':'!':[])
putHelloWorld :: [Char] -> IO()
putHelloWorld (x:xs) =
Prelude.putChar(x) >> putHelloWorld xs
putHelloWorld [] = Prelude.putChar('\n')
main :: IO ()
main =
hSetBuffering stdout NoBuffering >> hSetBuffering stdin LineBuffering
>> putHelloWorld(message)
can I short the code somehow?
thanks in advance