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

Adrian Hey ahey at iee.org
Tue Jan 3 13:15:39 EST 2006


On Tuesday 03 Jan 2006 6:11 pm, Donn Cave wrote:
> On Tue, 3 Jan 2006, Chris Kuklewicz wrote:
> ...
>
> > I sometimes call a function with side-effects in IO a "command".  But
> > the terms are fungible.  But calling putStr a "function" is correct.  It
> > is not a "pure function" however.
>
> Is that the standard party line?

I don't think so. putStr certainly is a pure function.
Try running..
main :: IO ()
main = let action = putStr "Bye"
       in action `seq` action
..and see what happens.

Regards
--
Adrian Hey






More information about the Haskell-Cafe mailing list