digestive-functors-0.0.2.1: A general way to consume input using applicative functors

Text.Digestive.Cli

Description

Proof-of-concept module: use digestive functors for a command line interface prompt

Synopsis

Documentation

newtype Descriptions Source

A list of descriptions for a certain input prompt

Constructors

Descriptions 

type Prompt a = Form IO String String Descriptions aSource

Type for a prompt

prompt :: String -> Prompt StringSource

Generate a prompt field from a description

promptReadSource

Arguments

:: Read a 
=> String

Error when the value can't be read

-> String

Description

-> Prompt a

Resulting prompt

Generate a prompt field for a value which can be read

runPrompt :: Prompt a -> IO aSource

Run a prompt. This will repeatedly prompt for input until we have a valid result.