stack-1.3.2: The Haskell Tool Stack

Safe Haskell | Safe
Language | Haskell2010

System.Process.PagerEditor

Contents

- Pager
- Editor

Description

Run external pagers (`$PAGER`, `less`, `more`) and editors (`$VISUAL`, `$EDITOR`, `nano`, `pico`, `vi`).

Synopsis

- pageWriter :: (Handle -> IO ()) -> IO ()
- pageByteString :: ByteString -> IO ()
- pageBuilder :: Builder -> IO ()
- pageFile :: FilePath -> IO ()
- pageString :: String -> IO ()
- data PagerException
  - = PagerNotFound
  - | PagerExitFailure FilePath Int
- editFile :: FilePath -> IO ()
- editReaderWriter :: forall a. String -> (Handle -> IO ()) -> (FilePath -> IO a) -> IO a
- editByteString :: String -> ByteString -> IO ByteString
- editString :: String -> String -> IO String
- data EditorException
  - = EditorNotFound
  - | EditorExitFailure FilePath Int

# Pager

pageWriter :: (Handle -> IO ()) -> IO () #

Run pager, providing a function that writes to the pager's input.

pageByteString :: ByteString -> IO () #

Run pager to display a lazy ByteString.

pageBuilder :: Builder -> IO () #

Run pager to display a ByteString-Builder.

pageFile :: FilePath -> IO () #

Run pager to display contents of a file.

pageString :: String -> IO () #

Run pager to display a string.

data PagerException #

Exception running pager.

Constructors

PagerNotFound |
PagerExitFailure FilePath Int |

Instances

Show PagerException # |
Methods showsPrec :: Int -> PagerException -> ShowS # show :: PagerException -> String # showList :: [PagerException] -> ShowS #
Exception PagerException # |
Methods toException :: PagerException -> SomeException # fromException :: SomeException -> Maybe PagerException # displayException :: PagerException -> String #

# Editor

editFile :: FilePath -> IO () #

Run editor to edit a file.

editReaderWriter :: forall a. String -> (Handle -> IO ()) -> (FilePath -> IO a) -> IO a #

Run editor, providing functions to write and read the file contents.

editByteString :: String -> ByteString -> IO ByteString #

Run editor on a ByteString.

editString :: String -> String -> IO String #

Run editor on a String.

data EditorException #

Exception running editor.

Constructors

EditorNotFound |
EditorExitFailure FilePath Int |

Instances

Show EditorException # |
Methods showsPrec :: Int -> EditorException -> ShowS # show :: EditorException -> String # showList :: [EditorException] -> ShowS #
Exception EditorException # |
Methods toException :: EditorException -> SomeException # fromException :: SomeException -> Maybe EditorException # displayException :: EditorException -> String #