ddc-interface-0.4.1.3: Disciplined Disciple Compiler user interface support.

Safe HaskellSafe-Inferred

DDC.Interface.Input

Synopsis

Documentation

data InputInterface Source

What interface is being used.

Constructors

InputInterfaceArgs

Read commands from unix command-line args.

InputInterfaceConsole

Read commands interactively from the console.

InputInterfaceBatch FilePath

Read commands from the file with this name.

Instances

data InputState command Source

Constructors

InputState 

Fields

inputParseCommand :: String -> Maybe (command, String)
 
inputMode :: Input
 
inputCommand :: Maybe (Maybe command, Int)
 
inputLineNumber :: Int
 
inputAcc :: String
 

data Input Source

How we're reading the current expression.

Constructors

InputLine

Read input line-by-line, using a backslash at the end of the line to continue to the next.

InputBlock

Read input as a block terminated by a double semicolon (;;)

InputFile FilePath

Read input from a file specified on the prompt

Instances

Eq Input 
Show Input 

readInput :: String -> (Input, String)Source

Read the input mode from the front of a string.

inputLine :: InputInterface -> InputState c -> String -> IO (InputState c, Maybe (Source, Maybe c, String))Source