-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/

-- | Open up a pager, like 'less' or 'more'
--   
--   This opens up the user's $PAGER. On Linux, this is usually called
--   less. On the various BSDs, this is usually more.
--   
--   CHANGES
--   
--   
--   
- 0.1.1.0 Add printOrPage function and
--   sendToPagerStrict function.
--   
@package pager
@version 0.1.1.0

module System.Pager

-- | 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).
printOrPage :: Text -> IO ()

-- | Send a lazy ByteString to the user's $PAGER.
sendToPager :: ByteString -> IO ()

-- | Send a strict ByteString to the user's $PAGER.
sendToPagerStrict :: ByteString -> IO ()

-- | 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.
--   
findPager :: IO ByteString

-- | This is what sendToPager uses on the back end. It takes a
--   Producer, from Data.Conduit, and then sends the produced
--   bytes to the pager's stdin.
sendToPagerConduit :: Producer (ResourceT IO) ByteString -> IO ()
