For this purpose, GHCi has a special variable called it .
Prelude> 1 1 Prelude> it 1
The reason for this, as explained in the GHCi docs , is that expressions other than IO behave like this:
someExpr ==> let it = someExpr print it
If someExpr was IO, then we would have
it <- someExpr print it
therefore, it should always be the result of your previous expression.
jozefg
source share