table-layout-0.9.0.2: Format tabular data as grid or table.
Safe HaskellSafe-Inferred
LanguageHaskell2010

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") :: String
Hello World!

The text then appears in dull red.

Synopsis

Documentation

data Formatted a Source #

Instances

Instances details
Functor Formatted Source # 
Instance details

Defined in Text.Layout.Table.Cell.Formatted

Methods

fmap :: (a -> b) -> Formatted a -> Formatted b #

(<$) :: a -> Formatted b -> Formatted a #

IsString a => IsString (Formatted a) Source # 
Instance details

Defined in Text.Layout.Table.Cell.Formatted

Methods

fromString :: String -> Formatted a #

Cell a => Cell (Formatted a) Source # 
Instance details

Defined in Text.Layout.Table.Cell.Formatted

formatted Source #

Arguments

:: String

Prefix text directives for formatting.

-> 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.

plain :: a -> Formatted a Source #

Create a value from content that is kept plain without any formatting.