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

Safe Haskell | Trustworthy
Language | Haskell98

System.Console.Wizard.Haskeline

Contents

- Orphan instances

Synopsis

- data UnexpectedEOF = UnexpectedEOF
- data Haskeline a
- haskeline :: Wizard Haskeline a -> Wizard Haskeline a
- withSettings :: WithSettings :<: b => Settings IO -> Wizard b a -> Wizard b a
- data WithSettings w = WithSettings (Settings IO) w

# Documentation

data UnexpectedEOF #

The Haskeline back-end will throw this exception if EOF is encountered when it is not expected. Specifically, when actions such as `getInputLine` return `Nothing`.

Constructors

UnexpectedEOF |

Instances

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

data Haskeline a #

Haskeline supports all the following features completely.

Instances

Functor Haskeline # |
Methods fmap :: (a -> b) -> Haskeline a -> Haskeline b # (<$) :: a -> Haskeline b -> Haskeline a #
ArbitraryIO :<: Haskeline # |
Methods inj :: ArbitraryIO a -> Haskeline a
Password :<: Haskeline # |
Methods inj :: Password a -> Haskeline a
LinePrewritten :<: Haskeline # |
Methods inj :: LinePrewritten a -> Haskeline a
Character :<: Haskeline # |
Methods inj :: Character a -> Haskeline a
Line :<: Haskeline # |
Methods inj :: Line a -> Haskeline a
OutputLn :<: Haskeline # |
Methods inj :: OutputLn a -> Haskeline a
Output :<: Haskeline # |
Methods inj :: Output a -> Haskeline a
WithSettings :<: Haskeline # |
Methods inj :: WithSettings a -> Haskeline a
Run (InputT IO) Haskeline # |
Methods runAlgebra :: Haskeline (InputT IO v) -> InputT IO v #

haskeline :: Wizard Haskeline a -> Wizard Haskeline a #

A simple identity function, used to restrict types if the type inferred by GHC is too general. You could achieve the same effect with a type signature, but this is slightly less typing.

withSettings :: WithSettings :<: b => Settings IO -> Wizard b a -> Wizard b a #

Modifies a wizard so that it will run with different Haskeline `Settings` to the top level input monad.

data WithSettings w #

Constructors

WithSettings (Settings IO) w |

Instances

Functor WithSettings # |
Methods fmap :: (a -> b) -> WithSettings a -> WithSettings b # (<$) :: a -> WithSettings b -> WithSettings a #
WithSettings :<: Haskeline # |
Methods inj :: WithSettings a -> Haskeline a
Run (InputT IO) WithSettings # |
Methods runAlgebra :: WithSettings (InputT IO v) -> InputT IO v #

# Orphan instances

Run (InputT IO) ArbitraryIO # |
Methods runAlgebra :: ArbitraryIO (InputT IO v) -> InputT IO v #
Run (InputT IO) Password # |
Methods runAlgebra :: Password (InputT IO v) -> InputT IO v #
Run (InputT IO) LinePrewritten # |
Methods runAlgebra :: LinePrewritten (InputT IO v) -> InputT IO v #
Run (InputT IO) Character # |
Methods runAlgebra :: Character (InputT IO v) -> InputT IO v #
Run (InputT IO) Line # |
Methods runAlgebra :: Line (InputT IO v) -> InputT IO v #
Run (InputT IO) OutputLn # |
Methods runAlgebra :: OutputLn (InputT IO v) -> InputT IO v #
Run (InputT IO) Output # |
Methods runAlgebra :: Output (InputT IO v) -> InputT IO v #