| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Text.Layout.Table.Cell.Formatted
Description
Provides formatting to an instance of Cell. For example, in a unix
terminal one could use the following:
>>>buildCell (formatted "\ESC[31m" "Hello World!" "\ESC[0m") :: StringHello World!
The text then appears in dull red.
More complex nested formatting can be achieved by using the Monoid
instance.
Documentation
Instances
| Foldable Formatted Source # | |
Defined in Text.Layout.Table.Cell.Formatted Methods fold :: Monoid m => Formatted m -> m foldMap :: Monoid m => (a -> m) -> Formatted a -> m foldMap' :: Monoid m => (a -> m) -> Formatted a -> m foldr :: (a -> b -> b) -> b -> Formatted a -> b foldr' :: (a -> b -> b) -> b -> Formatted a -> b foldl :: (b -> a -> b) -> b -> Formatted a -> b foldl' :: (b -> a -> b) -> b -> Formatted a -> b foldr1 :: (a -> a -> a) -> Formatted a -> a foldl1 :: (a -> a -> a) -> Formatted a -> a elem :: Eq a => a -> Formatted a -> Bool maximum :: Ord a => Formatted a -> a minimum :: Ord a => Formatted a -> a | |
| Traversable Formatted Source # | |
Defined in Text.Layout.Table.Cell.Formatted | |
| Functor Formatted Source # | |
| IsString a => IsString (Formatted a) Source # | |
Defined in Text.Layout.Table.Cell.Formatted Methods fromString :: String -> Formatted a | |
| Monoid (Formatted a) Source # | |
| Semigroup (Formatted a) Source # | |
| Show a => Show (Formatted a) Source # | |
| Eq a => Eq (Formatted a) Source # | |
| Cell a => Cell (Formatted a) Source # | |
Defined in Text.Layout.Table.Cell.Formatted Methods visibleLength :: Formatted a -> Int Source # measureAlignment :: (Char -> Bool) -> Formatted a -> AlignInfo Source # buildCell :: StringBuilder b => Formatted a -> b Source # buildCellView :: StringBuilder b => CellView (Formatted a) -> b Source # | |
plain :: a -> Formatted a Source #
Create a value from content that is kept plain without any formatting.
Arguments
| :: String | Prefix text directives for formatting. |
| -> Formatted a | The content to be formatted. |
| -> String | Suffix text directives for formatting. |
| -> Formatted a |
Create a formatted value with formatting directives that are applied to the whole value. The actual formatting has to be done by the backend.
Arguments
| :: (String -> String) | Function to operate on prefix text directives. |
| -> (String -> String) | Function to operate on suffix text directives. |
| -> Formatted a | The formatted value to operate on. |
| -> Formatted a |
Map over the formatting directives of a formatted value.
Arguments
| :: b | Value of |
| -> ([b] -> b) | Function for operating over |
| -> (a -> b) | Function for operating over |
| -> (String -> b -> String -> b) | Function for operating over |
| -> Formatted a | |
| -> b |
Process a formatted value to produce an arbitrary value.
This is the catamorphism for Formatted.