print

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"
Print an IP using the textual encoding. This exists mostly for debugging purposes.
>>> print (ipv4 10 0 0 25)
10.0.0.25
>>> print (ipv6 0x3124 0x0 0x0 0xDEAD 0xCAFE 0xFF 0xFE00 0x1)
3124::dead:cafe:ff:fe00:1
Print an IPv4 using the textual encoding.
Print an IPv6 using the textual encoding.
Print a Mac address using the textual encoding.
Intended primarily for printed material or in a print layout.
Prints the accumulated benchmark results. Does nothing if no benchmark profiling is enabled.