[Haskell-cafe] How to print a string (lazily)

Christian Maeder maeder at tzi.de
Tue Jan 3 12:37:11 EST 2006


Daniel Carrera wrote:
> print_list xs = do putStr(join xs)
>     where join [] = ""
>           join (x:xs) = (show x) ++ "\n" ++ join xs

print_list xs = mapM putStrLn xs

> Question: What do you call a function that has side-effects? (like 
> putStr) I know that "function" is the wrong term.

"action", "command", "program", etc.

HTH Christian


More information about the Haskell-Cafe mailing list