IOSpec-0.2.1: A pure specification of the IO monad.Source codeContentsIndex
Test.IOSpec.Teletype
Contents
The IOTeletype monad
Pure getChar and putChar
Description
A pure specification of getChar and putChar.
Synopsis
data Teletype a
getChar :: Teletype :<: f => IOSpec f Char
putChar :: Teletype :<: f => Char -> IOSpec f ()
putStr :: Teletype :<: f => String -> IOSpec f ()
putStrLn :: Teletype :<: f => String -> IOSpec f ()
getLine :: Teletype :<: f => IOSpec f String
The IOTeletype monad
data Teletype a Source

An expression of type IOSpec Teletype a corresponds to an IO computation that may print to or read from stdout and stdin respectively.

There is a minor caveat here. I assume that stdin and stdout are not buffered. This is not the standard behaviour in many Haskell compilers.

show/hide Instances
Pure getChar and putChar
getChar :: Teletype :<: f => IOSpec f CharSource
The getChar function can be used to read a character from the teletype.
putChar :: Teletype :<: f => Char -> IOSpec f ()Source
The getChar function can be used to print a character to the teletype.
putStr :: Teletype :<: f => String -> IOSpec f ()Source
putStrLn :: Teletype :<: f => String -> IOSpec f ()Source
getLine :: Teletype :<: f => IOSpec f StringSource
Produced by Haddock version 2.4.2