interact is:exact

interact f takes the entire input from stdin and applies f to it. The resulting string is written to the stdout device. Note that this operation is lazy, which allows to produce output even before all input has been consumed. This operation may fail with the same errors as getContents and putStr.

Examples

>>> interact (\str -> str ++ str)
> hi :)
hi :)
> ^D
hi :)
>>> interact (const ":D")
:D
>>> interact (show . words)
> hello world!
> I hope you have a great day
> ^D
["hello","world!","I","hope","you","have","a","great","day"]
The interact function takes a function of type ByteString -> ByteString as its argument. The entire input from the standard input device is passed to this function as its argument, and the resulting string is output on the standard output device.
The interact function takes a function of type Text -> Text as its argument. The entire input from the standard input device is passed to this function as its argument, and the resulting string is output on the standard output device.
The interact function takes a function of type Text -> Text as its argument. The entire input from the standard input device is passed (lazily) to this function as its argument, and the resulting string is output on the standard output device.
The interact function takes a function of type String->String as its argument. The entire input from the standard input device is passed to this function as its argument, and the resulting string is output on the standard output device.
Lifted interact
Lifted interact
Takes a function of type 'LText -> LText' and passes all input on stdin to it, then prints result to stdout Uses lazy IO Uses system locale settings
A synonym for hPut, for compatibility hPutStr :: Handle -> ByteStream IO r -> IO r hPutStr = hPut
  • - | Write a ByteStream to stdout putStr :: ByteStream IO r -> IO r putStr = hPut IO.stdout
The interact function takes a function of type ByteStream -> ByteStream as its argument. The entire input from the standard input device is passed to this function as its argument, and the resulting string is output on the standard output device.
interact morph = stdout (morph stdin)
Interact with stdin and stdout by using a function to transform input to output. May be lazy. See interact for more.
Take a function of type Text -> Text as its argument The entire input from the standard input device is passed to this function as its argument, and the resulting string is output on the standard output device.
Not on Stackage, so not searched. instantly create REPL from any function