dialog-0.1.0.0: Simple dialog-based user interfaces

Copyright(c) 2015 Nikita Churaev
LicenseBSD3
Safe HaskellNone
LanguageHaskell2010

Dialog.Internal

Description

 

Synopsis

Documentation

data DialogT m a where Source

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 

type DialogIO = DialogT IO Source

Dialog with IO as the base monad.

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.

askLine :: String -> DialogT m String Source

Asks the user for a line of text.

display :: [Paragraph] -> DialogT m () Source

Displays a message.

url :: String -> FormattedText Source

Makes an unlabeled link. Shorthand for (Link url (Plain url)).

link :: String -> FormattedText -> FormattedText Source

Makes a labeled link. Alias for Link.

img :: String -> Paragraph Source

Shorthand for (Picture (PictureFromURL url)).

il :: [ListItem] -> Paragraph Source

Makes a numbered list. Shorthand for (List NumberedList items).

ul :: [ListItem] -> Paragraph Source

Makes a bullet list. Shorthand for (List BulletList items).

li :: FormattedText -> ListItem Source

Makes a single-line list item. Shorthand for (ListItem [TextParagraph text]).

li' :: [Paragraph] -> ListItem Source

Makes a list item. Shorthand for ListItem.

(<+>) :: 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.

table :: [TableRow] -> Paragraph Source

Makes a table. Alias for Table.

tr :: [TableCell] -> TableRow Source

Makes a table row. Shorthand for TableRow.

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

data FontSize Source

Font size (in percent of the base font size).

Constructors

FontSize Int 

data Color Source

Color.

Constructors

Color Word8 Word8 Word8 

white :: Color Source

Pure white (red: 255, green: 255, blue: 255).

black :: Color Source

Pure black (red: 0, green: 0, blue: 0).

red :: Color Source

Pure red (red: 255, green: 0, blue: 0).

green :: Color Source

Pure green (red: 0, green: 255, blue: 0).

blue :: Color Source

Pure blue (red: 0, green: 0, blue: 255).

rgb :: Word8 -> Word8 -> Word8 -> Color Source

Makes a color from red, green and blue components.

toRGB :: Color -> (Word8, Word8, Word8) Source

Unpacks a color into red, green and blue components.