| Copyright | (c) 2015 Nikita Churaev |
|---|---|
| License | BSD3 |
| Safe Haskell | None |
| Language | Haskell2010 |
Dialog.Internal
Description
- data DialogT m a where
- type DialogIO = DialogT IO
- changeTitle :: String -> DialogT m ()
- changeEndMessage :: String -> DialogT m ()
- displayLine :: String -> DialogT m ()
- askLine :: String -> DialogT m String
- display :: [Paragraph] -> DialogT m ()
- p :: FormattedText -> Paragraph
- url :: String -> FormattedText
- link :: String -> FormattedText -> FormattedText
- img :: String -> Paragraph
- il :: [ListItem] -> Paragraph
- ul :: [ListItem] -> Paragraph
- li :: FormattedText -> ListItem
- li' :: [Paragraph] -> ListItem
- (<+>) :: FormattedText -> FormattedText -> FormattedText
- str :: String -> FormattedText
- b :: FormattedText -> FormattedText
- i :: FormattedText -> FormattedText
- u :: FormattedText -> FormattedText
- color :: Color -> FormattedText -> FormattedText
- size :: FontSize -> FormattedText -> FormattedText
- table :: [TableRow] -> Paragraph
- tr :: [TableCell] -> TableRow
- td :: FormattedText -> TableCell
- th :: FormattedText -> TableCell
- td' :: [Paragraph] -> TableCell
- th' :: [Paragraph] -> TableCell
- data Paragraph
- data FormattedText
- data PictureSource = PictureFromURL String
- data ListStyle
- newtype ListItem = ListItem [Paragraph]
- newtype TableRow = TableRow [TableCell]
- data TableCell = TableCell CellStyle [Paragraph]
- data CellStyle
- data FontSize = FontSize Int
- mkFontSize :: Int -> FontSize
- data Color = Color Word8 Word8 Word8
- white :: Color
- black :: Color
- red :: Color
- green :: Color
- blue :: Color
- rgb :: Word8 -> Word8 -> Word8 -> Color
- toRGB :: Color -> (Word8, Word8, Word8)
Documentation
Dialog monad transformer.
Constructors
| Pure :: a -> DialogT m a | |
| Bind :: (forall r. (forall b. DialogT m b -> (b -> DialogT m a) -> r) -> r) -> DialogT m a | |
| Lift :: m a -> DialogT m a | |
| ChangeTitle :: String -> DialogT m () | |
| ChangeEndMessage :: String -> DialogT m () | |
| Display :: [Paragraph] -> DialogT m () | |
| AskLine :: String -> DialogT m String |
changeTitle :: String -> DialogT m () Source
Changes the title of the dialog window. Default: "Dialog"
changeEndMessage :: String -> DialogT m () Source
Changes the end message of the dialog. Default: "End of program."
displayLine :: String -> DialogT m () Source
Displays a plain-text single-line message.
p :: FormattedText -> Paragraph Source
Shorthand for TextParagraph.
link :: String -> FormattedText -> FormattedText Source
Makes a labeled link. Alias for Link.
li :: FormattedText -> ListItem Source
Makes a single-line list item. Shorthand for
(.ListItem [TextParagraph text])
(<+>) :: FormattedText -> FormattedText -> FormattedText infixr 6 Source
Combines two formatted texts together.
str :: String -> FormattedText Source
Converts a String to a FormattedText. Shorthand for Plain.
b :: FormattedText -> FormattedText Source
Makes a text bold. Shorthand for Bold.
i :: FormattedText -> FormattedText Source
Makes a text italic. Shorthand for Italic.
u :: FormattedText -> FormattedText Source
Makes a text underlined. Shorthand for Underline.
color :: Color -> FormattedText -> FormattedText Source
Changes the color of a text. Alias of Colored.
size :: FontSize -> FormattedText -> FormattedText Source
Changes the size of a text. Alias of Size.
td :: FormattedText -> TableCell Source
Makes a normal table cell with a single line of text in it. Shorthand for
(.TableCell NormalCell [TextParagraph text])
th :: FormattedText -> TableCell Source
Makes a table header cell with a single line of text in it. Shorthand for
(.TableCell HeaderCell [TextParagraph text])
td' :: [Paragraph] -> TableCell Source
Makes a normal table cell. Shorthand for
(.TableCell NormalCell paragraphs)
th' :: [Paragraph] -> TableCell Source
Makes a header table cell. Shorthand for
(.TableCell HeaderCell paragraphs)
Constructors
| TextParagraph FormattedText | |
| Picture PictureSource | |
| List ListStyle [ListItem] | |
| Table [TableRow] |
data FormattedText Source
Constructors
| NumberedList | |
| BulletList |
Constructors
| NormalCell | |
| HeaderCell |
Font size (in percent of the base font size).
mkFontSize :: Int -> FontSize Source
Color.