This module provides a low-level interface to the C functions of the terminfo library.
NOTE: Since this library is built on top of the curses interface, it is not thread-safe.
- data Terminal
- setupTerm :: String -> IO Terminal
- setupTermFromEnv :: IO Terminal
- data Capability a
- getCapability :: Terminal -> Capability a -> Maybe a
- tiGetFlag :: String -> Capability Bool
- tiGuardFlag :: String -> Capability ()
- tiGetNum :: String -> Capability Int
- tiGetStr :: String -> Capability String
- data TermOutput
- runTermOutput :: Terminal -> TermOutput -> IO ()
- termText :: String -> TermOutput
- tiGetOutput :: String -> Capability ([Int] -> LinesAffected -> TermOutput)
- type LinesAffected = Int
- tiGetOutput1 :: OutputCap f => String -> Capability f
- class OutputCap f
- class Monoid a where
- (<#>) :: Monoid m => m -> m -> m
Initialize the terminfo library to the given terminal entry.
Initialize the terminfo library, using the
TERM environmental variable.
TERM is not set, we use the generic, minimal entry
A feature or operation which a
Terminal may define.
Look up a boolean capability in the terminfo database, and fail if it's not defined.
Look up a string capability in the terminfo database.
Note: Do not use this function for terminal output; use
An action which sends output to the terminal. That output may mix plain text with control characters and escape sequences, along with delays (called "padding") required by some older terminals.
Output plain text containing no control characters or escape sequences.
Look up an output capability in the terminfo database.
A parameter to specify the number of lines affected. Some capabilities
this parameter on some terminals to compute variable-length padding.
Look up an output capability which takes a fixed number of parameters
Int -> Int -> TermOutput).
For capabilities which may contain variable-length
A type class to encapsulate capabilities which take in zero or more parameters.
class Monoid a where
The class of monoids (types with an associative binary operation that has an identity). Instances should satisfy the following laws:
mappend mempty x = x
mappend x mempty = x
mappend x (mappend y z) = mappend (mappend x y) z
The method names refer to the monoid of lists under concatenation, but there are many other instances.
Some types can be viewed as a monoid in more than one way,
e.g. both addition and multiplication on numbers.
In such cases we often define
newtypes and make those instances
mempty :: a
mappend :: a -> a -> a
An associative operation
mconcat :: [a] -> a
Fold a list using the monoid.
For most types, the default definition for
mconcat will be
used, but the function is included in the class definition so
that an optimized version can be provided for specific types.
|Monoid a => Monoid (Dual a)|
|Monoid (Endo a)|
|Num a => Monoid (Sum a)|
|Num a => Monoid (Product a)|
|Monoid (First a)|
|Monoid (Last a)|
|Monoid a => Monoid (Maybe a)|
|Monoid b => Monoid (a -> b)|
|(Monoid a, Monoid b) => Monoid (a, b)|
|(Monoid a, Monoid b, Monoid c) => Monoid (a, b, c)|
|(Monoid a, Monoid b, Monoid c, Monoid d) => Monoid (a, b, c, d)|
|(Monoid a, Monoid b, Monoid c, Monoid d, Monoid e) => Monoid (a, b, c, d, e)|