print -package:ip

The print function outputs a value of any printable type to the standard output device. Printable types are those that are instances of class Show; print converts values to strings for output using the show operation and adds a newline. print is implemented as putStrLn . show This operation may fail with the same errors, and has the same issues with concurrency, as hPutStr!

Examples

>>> print [1, 2, 3]
[1,2,3]
Be careful when using print for outputting strings, as this will invoke show and cause strings to be printed with quotation marks and non-ascii symbols escaped.
>>> print "λ :D"
"\995 :D"
A program to print the first 8 integers and their powers of 2 could be written as:
>>> print [(n, 2^n) | n <- [0..8]]
[(0,1),(1,2),(2,4),(3,8),(4,16),(5,32),(6,64),(7,128),(8,256)]
Print all incoming values to stdout. Subject to fusion
Run a generator with a random seed and print the outcome, and the first level of shrinks.
Gen.print (Gen.enum 'a' 'f')
=== Outcome ===
'd'
=== Shrinks ===
'a'
'b'
'c'
print values to stdout
The print function outputs a value of any printable type to the standard output device. Printable types are those that are instances of class Show; print converts values to strings for output using the show operation and adds a newline. For example, a program to print the first 20 integers and their powers of 2 could be written as:
main = print ([(n, 2^n) | n <- [0..19]])
The print function outputs a value of any printable type to the standard output device. Printable types are those that are instances of class Show; print converts values to strings for output using the show operation and adds a newline.
Lifted version of print.
Print the elements of a stream as they arise.
>>> S.print $ S.take 2 S.stdinLn
hello<Enter>
"hello"
world<Enter>
"world"
Intended primarily for printed material or in a print layout.
Prints the accumulated benchmark results. Does nothing if no benchmark profiling is enabled.
The print function outputs a value of any printable type to the standard output device. Printable types are those that are instances of class Show; print converts values to strings for output using the show operation and adds a newline. For example, a program to print the first 20 integers and their powers of 2 could be written as:
main = print ([(n, 2^n) | n <- [0..19]])
Note: This function is lifted to the MonadIO class.
Function used by logging functions.