The inline module provides a limited interface to changing the style of terminal output. The intention is for this interface to be used inline with other output systems.
The changes specified by the InlineM monad are applied to the terminals display attributes. These display attributes effect the display of all following text output to the terminal file descriptor.
For example, in an IO monad the following code with print the text "Not styled. " Followed by the text " Styled! " drawn over a red background and underlined.
t <- terminal_handle putStr "Not styled. " put_attr_change t $ do back_color red apply_style underline putStr " Styled! " put_attr_change t $ default_all putStrLn "Not styled." release_terminal t
put_attr_change outputs the control codes to the terminal device
Handle. This is a duplicate
stdout handle when the
terminal_handle was (first) acquired. If
stdout has since been
Copyright 2009-2010 Corey O'Connor
Attempt to change the
Style of the following text.
If the terminal does not support the style change no error is produced. The style can still be removed.
Attempt to remove the specified
Style from the display of the following text.
This will fail if apply_style for the given style has not been previously called.