haskell-menu-0.2.1: A simple menu system for Haskell programs

LicenseLGPL-3
Maintainerjlamothe1980@gmail.com
Safe HaskellSafe
LanguageHaskell98

System.IO.Menu

Description

 

Synopsis

Documentation

data Menu a Source #

Defines a Menu

Constructors

Menu 

Fields

Instances

Show (Menu a) Source # 

Methods

showsPrec :: Int -> Menu a -> ShowS #

show :: Menu a -> String #

showList :: [Menu a] -> ShowS #

data Item a Source #

Defines a Menu item

Constructors

Item 

Fields

Instances

Show (Item a) Source # 

Methods

showsPrec :: Int -> Item a -> ShowS #

show :: Item a -> String #

showList :: [Item a] -> ShowS #

build Source #

Arguments

:: String

The menu title

-> [(Char, Item a)]

A list of tuples containing a character (must be upper case) and its corresponding Item

-> Menu a 

Builds a Menu from a list.

execute Source #

Arguments

:: Menu a

The Menu

-> IO a 

Prompts the user to select an option from a Menu and returns the resulting value

addItem Source #

Arguments

:: Char

The character (must be upper case) of the Item to be added to the menu

-> Item a

The Item to be added

-> Menu a

The Menu being modified

-> Menu a 

Adds an Item to a Menu, returning the resulting Menu