wizards-1.0.2: High level, generic library for interrogative user interfaces

Safe Haskell | Trustworthy
Language | Haskell98

System.Console.Wizard.Pure

Contents

- Orphan instances

Synopsis

- data Pure a
- data UnexpectedEOI = UnexpectedEOI
- runPure :: Wizard Pure a -> String -> (Maybe a, String)
- type PureState = ([String], Seq Char)

# Documentation

data Pure a #

The `Pure` backend supports only simple input and output. Support for `Password` and `LinePrewritten` features can be added with a shim from System.Console.Wizard.Shim.

Instances

Functor Pure # |
Methods fmap :: (a -> b) -> Pure a -> Pure b # (<$) :: a -> Pure b -> Pure a #
Character :<: Pure # |
Methods inj :: Character a -> Pure a
Line :<: Pure # |
Methods inj :: Line a -> Pure a
OutputLn :<: Pure # |
Methods inj :: OutputLn a -> Pure a
Output :<: Pure # |
Methods inj :: Output a -> Pure a
Run (State PureState) Pure # |
Methods runAlgebra :: Pure (State PureState v) -> State PureState v #

data UnexpectedEOI #

Thrown if the wizard ever unexpectedly runs out of input.

Constructors

UnexpectedEOI |

Instances

Show UnexpectedEOI # |
Methods showsPrec :: Int -> UnexpectedEOI -> ShowS # show :: UnexpectedEOI -> String # showList :: [UnexpectedEOI] -> ShowS #
Exception UnexpectedEOI # |
Methods toException :: UnexpectedEOI -> SomeException # fromException :: SomeException -> Maybe UnexpectedEOI # displayException :: UnexpectedEOI -> String #

runPure :: Wizard Pure a -> String -> (Maybe a, String) #

Run a wizard in the Pure backend

type PureState = ([String], Seq Char) #

The pure backend is actually just a simple state monad, with the following state.

# Orphan instances

Run (State PureState) Character # |
Methods runAlgebra :: Character (State PureState v) -> State PureState v #
Run (State PureState) Line # |
Methods runAlgebra :: Line (State PureState v) -> State PureState v #
Run (State PureState) OutputLn # |
Methods runAlgebra :: OutputLn (State PureState v) -> State PureState v #
Run (State PureState) Output # |
Methods runAlgebra :: Output (State PureState v) -> State PureState v #