| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
UI.Butcher.Monadic.Types
Description
Types used in the butcher interface.
Synopsis
- data CommandDesc out = CommandDesc {
- _cmd_mParent :: Maybe (Maybe String, CommandDesc out)
- _cmd_synopsis :: Maybe Doc
- _cmd_help :: Maybe Doc
- _cmd_parts :: [PartDesc]
- _cmd_out :: Maybe out
- _cmd_children :: Deque (Maybe String, CommandDesc out)
- _cmd_visibility :: Visibility
- cmd_out :: forall out. Lens' (CommandDesc out) (Maybe out)
- type CmdParser f out = Free (CmdParserF f out)
- data Input
- = InputString String
- | InputArgs [String]
- data ParsingError = ParsingError {
- _pe_messages :: [String]
- _pe_remaining :: Input
- data PartDesc
- = PartLiteral String
- | PartVariable String
- | PartOptional PartDesc
- | PartAlts [PartDesc]
- | PartSeq [PartDesc]
- | PartDefault String PartDesc
- | PartSuggestion [CompletionItem] PartDesc
- | PartRedirect String PartDesc
- | PartReorder [PartDesc]
- | PartMany PartDesc
- | PartWithHelp Doc PartDesc
- | PartHidden PartDesc
- emptyCommandDesc :: CommandDesc out
- data Visibility
Documentation
data CommandDesc out Source #
A representation/description of a command parser built via the
CmdParser monad. Can be transformed into a pretty Doc to display
as usage/help via ppUsage and related functions.
Note that there is the _cmd_out accessor that contains Maybe out which
might be useful after successful parsing.
Constructors
| CommandDesc | |
Fields
| |
Instances
| Functor CommandDesc Source # | |
Defined in UI.Butcher.Monadic.Internal.Types Methods fmap :: (a -> b) -> CommandDesc a -> CommandDesc b # (<$) :: a -> CommandDesc b -> CommandDesc a # | |
| Show (CommandDesc out) Source # | |
Defined in UI.Butcher.Monadic.Internal.Types Methods showsPrec :: Int -> CommandDesc out -> ShowS # show :: CommandDesc out -> String # showList :: [CommandDesc out] -> ShowS # | |
Butcher supports two input modi: String and [String]. Program
arguments have the latter form, while parsing interactive command input
(e.g. when you implement a terminal of sorts) is easier when you can
process the full String without having to wordify it first by some
means (and List.words is not the right approach in many situations.)
Constructors
| InputString String | |
| InputArgs [String] |
data ParsingError Source #
Information about an error that occured when trying to parse some Input
using some CmdParser.
Constructors
| ParsingError | |
Fields
| |
Instances
| Eq ParsingError Source # | |
Defined in UI.Butcher.Monadic.Internal.Types | |
| Show ParsingError Source # | |
Defined in UI.Butcher.Monadic.Internal.Types Methods showsPrec :: Int -> ParsingError -> ShowS # show :: ParsingError -> String # showList :: [ParsingError] -> ShowS # | |
A representation/description of a command's parts, i.e. flags or params.
As a butcher user, the higher-level pretty-printing functions for
CommandDesc are probably sufficient.
Constructors
emptyCommandDesc :: CommandDesc out Source #
Empty CommandDesc value. Mostly for butcher-internal usage.
data Visibility Source #
Instances
| Eq Visibility Source # | |
Defined in UI.Butcher.Monadic.Internal.Types | |
| Show Visibility Source # | |
Defined in UI.Butcher.Monadic.Internal.Types Methods showsPrec :: Int -> Visibility -> ShowS # show :: Visibility -> String # showList :: [Visibility] -> ShowS # | |