HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Modulevty-6.5Haskell2010

Graphics.Vty.Inline

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 terminal's display attributes. These display attributes affect the display of all following text output to the terminal file descriptor.

For example, in an IO monad the following code will print the text "Not styled. " Followed by the text " Styled! " drawn over a red background and underlined.

     putStr "Not styled. "
     putAttrChange_ $ do
         backColor red
         applyStyle underline
     putStr " Styled! "
     putAttrChange_ $ defaultAll
     putStrLn "Not styled."

putAttrChange emits the control codes to the terminal device attached to Handle. This is a duplicate of the stdout handle when the terminalHandle was (first) acquired. If stdout has since been changed then putStr, putStrLn, print etc. will output to a different Handle than putAttrChange.

Copyright 2009-2010 Corey O'Connor

  • 2 types
  • 7 values
  • Packagevty-6.5
  • Exports9
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceInline.hs
valueapplyStyle :: Style -> InlineM ()
#

Attempt to change the Style of the following text..

If the terminal does not support the style change then no error is produced. The style can still be removed.

valueremoveStyle :: Style -> InlineM ()
#

Attempt to remove the specified Style from the display of the following text.

This will fail if applyStyle for the given style has not been previously called.