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

Adrian Hey ahey at iee.org
Tue Jan 3 12:42:36 EST 2006


On Tuesday 03 Jan 2006 5:37 pm, Christian Maeder wrote:
> Daniel Carrera wrote:
>
> > 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.

Actually (at the risk of appearing pedantic), I think it's important
to make clear that "function" *is* the correct term for putStr..
 putStr :: String -> IO ()
It's expressions like (putStr "Hello World") of type IO <something>
that are (what I would call) "actions".

Haskell has no name for "functions that have side-effects".
They don't exist (well not unless you're grossly abusing
unsafePerformIO).

Regards
--
Adrian Hey





More information about the Haskell-Cafe mailing list