HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Modulepager-0.1.1.0Haskell2010

System.Pager

  • 5 values
  • Packagepager-0.1.1.0
  • Exports5
  • LanguageHaskell2010
  • LicenceBSD-2-Clause
  • SourcePager.hs
valueprintOrPage :: Text -> IO ()
#

If the user's terminal is long enough to display the (strict) Text, just print it. Else, send it to the pager.

The text needs to be strict, because the function counts the number of lines in the text. (This is also why it needs to be text, and not a bytestring, because Text has stuff like line-counting).

valuefindPager :: IO ByteString
#

This finds the user's $PAGER. This will fail if:

  • There is no $PATH variable

  • The user doesn't have a less or more installed, and hasn't specified an alternate program via $PAGER.