dialog-0.3.0.0: Simple dialog-based user interfaces

Copyright(c) 2015 Nikita Churaev
LicenseBSD3
Safe HaskellSafe
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.

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.