-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Symantics for parsing and documenting a CLI -- -- An extensible, typed and embedded Domain-Specific Language (DSL) to -- build Command Line Interface (CLI) using a -- write-an-API-then-derive-code-from-it approach. The derivations -- currently implemented are for parsing arguments or printing help. @package symantic-cli @version 2.3.3.20190711 module Symantic.CLI.API class App repr (<.>) :: App repr => repr a b -> repr b c -> repr a c (<.>) :: (App repr, Trans repr) => App (UnTrans repr) => repr a b -> repr b c -> repr a c infixr 4 <.> class Alt repr () :: Alt repr => repr a k -> repr b k -> repr (a :!: b) k alt :: Alt repr => repr a k -> repr a k -> repr a k opt :: Alt repr => repr (a -> k) k -> repr (Maybe a -> k) k () :: (Alt repr, Trans repr) => Alt (UnTrans repr) => repr a k -> repr b k -> repr (a :!: b) k alt :: (Alt repr, Trans repr) => Alt (UnTrans repr) => repr a k -> repr a k -> repr a k opt :: (Alt repr, Trans repr) => Alt (UnTrans repr) => repr (a -> k) k -> repr (Maybe a -> k) k infixr 3 `alt` infixr 3 -- | Like (,) but infixr. data (:!:) a b (:!:) :: a -> b -> (:!:) a b infixr 3 :!: infixr 3 :!: class Pro repr dimap :: Pro repr => (a -> b) -> (b -> a) -> repr (a -> k) k -> repr (b -> k) k dimap :: (Pro repr, Trans repr) => Pro (UnTrans repr) => (a -> b) -> (b -> a) -> repr (a -> k) k -> repr (b -> k) k class AltApp repr many0 :: AltApp repr => repr (a -> k) k -> repr ([a] -> k) k many1 :: AltApp repr => repr (a -> k) k -> repr ([a] -> k) k many0 :: (AltApp repr, Trans repr) => AltApp (UnTrans repr) => repr (a -> k) k -> repr ([a] -> k) k many1 :: (AltApp repr, Trans repr) => AltApp (UnTrans repr) => repr (a -> k) k -> repr ([a] -> k) k class Permutable repr where { type family Permutation (repr :: * -> * -> *) = (r :: * -> * -> *) | r -> repr; type Permutation repr = Permutation (UnTrans repr); } runPermutation :: Permutable repr => Permutation repr k a -> repr (a -> k) k toPermutation :: Permutable repr => repr (a -> k) k -> Permutation repr k a toPermDefault :: Permutable repr => a -> repr (a -> k) k -> Permutation repr k a -- | Convenient wrapper to omit a runPermutation. -- --
--   opts <?> next = runPermutation opts <.> next
--   
() :: App repr => Permutable repr => Permutation repr b a -> repr b c -> repr (a -> b) c infixr 4 type Name = String type Segment = String class CLI_Command repr command :: CLI_Command repr => Name -> repr a k -> repr a k class CLI_Var repr where { type family VarConstraint repr a :: Constraint; type VarConstraint repr a = VarConstraint (UnTrans repr) a; } var' :: (CLI_Var repr, VarConstraint repr a) => Name -> repr (a -> k) k just :: CLI_Var repr => a -> repr (a -> k) k nothing :: CLI_Var repr => repr k k var' :: (CLI_Var repr, Trans repr) => CLI_Var (UnTrans repr) => VarConstraint (UnTrans repr) a => Name -> repr (a -> k) k just :: (CLI_Var repr, Trans repr) => CLI_Var (UnTrans repr) => a -> repr (a -> k) k nothing :: (CLI_Var repr, Trans repr) => CLI_Var (UnTrans repr) => repr k k -- | Like var' but with the type variable (a) first instead -- or (repr) so it can be passed using TypeApplications -- without adding a |@_| for (repr). var :: forall a k repr. CLI_Var repr => VarConstraint repr a => Name -> repr (a -> k) k class CLI_Env repr where { type family EnvConstraint repr a :: Constraint; type EnvConstraint repr a = EnvConstraint (UnTrans repr) a; } env' :: (CLI_Env repr, EnvConstraint repr a) => Name -> repr (a -> k) k env' :: (CLI_Env repr, Trans repr) => CLI_Env (UnTrans repr) => EnvConstraint (UnTrans repr) a => Name -> repr (a -> k) k -- | Like env' but with the type enviable (a) first instead -- or (repr) so it can be passed using TypeApplications -- without adding a |@_| for (repr). env :: forall a k repr. CLI_Env repr => EnvConstraint repr a => Name -> repr (a -> k) k data Tag Tag :: Char -> Name -> Tag TagLong :: Name -> Tag TagShort :: Char -> Tag class (App repr, Permutable repr, CLI_Var repr) => CLI_Tag repr where { type family TagConstraint repr a :: Constraint; type TagConstraint repr a = TagConstraint (UnTrans repr) a; } tagged :: CLI_Tag repr => Tag -> repr f k -> repr f k endOpts :: CLI_Tag repr => repr k k short :: (CLI_Tag repr, TagConstraint repr a) => Char -> repr (a -> k) k -> Permutation repr k a long :: (CLI_Tag repr, TagConstraint repr a) => Name -> repr (a -> k) k -> Permutation repr k a option :: (CLI_Tag repr, TagConstraint repr a) => a -> repr (a -> k) k -> Permutation repr k a flag :: (CLI_Tag repr, TagConstraint repr Bool) => Tag -> Permutation repr k Bool shortOpt :: (CLI_Tag repr, TagConstraint repr a) => Char -> a -> repr (a -> k) k -> Permutation repr k a longOpt :: (CLI_Tag repr, TagConstraint repr a) => Name -> a -> repr (a -> k) k -> Permutation repr k a tagged :: (CLI_Tag repr, Trans repr) => CLI_Tag (UnTrans repr) => Tag -> repr f k -> repr f k endOpts :: (CLI_Tag repr, Trans repr) => CLI_Tag (UnTrans repr) => repr k k class CLI_Response repr where { type family ResponseConstraint repr a :: Constraint; type family ResponseArgs repr a :: *; type family Response repr :: *; type ResponseConstraint repr a = ResponseConstraint (UnTrans repr) a; type ResponseArgs repr a = ResponseArgs (UnTrans repr) a; type Response repr = Response (UnTrans repr); } response' :: (CLI_Response repr, ResponseConstraint repr a) => repr (ResponseArgs repr a) (Response repr) response' :: forall a. (CLI_Response repr, Trans repr) => CLI_Response (UnTrans repr) => ResponseConstraint (UnTrans repr) a => ResponseArgs repr a ~ ResponseArgs (UnTrans repr) a => Response repr ~ Response (UnTrans repr) => repr (ResponseArgs repr a) (Response repr) response :: forall a repr. CLI_Response repr => ResponseConstraint repr a => repr (ResponseArgs repr a) (Response repr) class CLI_Help repr where { type family HelpConstraint repr d :: Constraint; type HelpConstraint repr d = HelpConstraint (UnTrans repr) d; } help :: (CLI_Help repr, HelpConstraint repr d) => d -> repr f k -> repr f k program :: CLI_Help repr => Name -> repr f k -> repr f k rule :: CLI_Help repr => Name -> repr f k -> repr f k program :: (CLI_Help repr, Trans repr) => CLI_Help (UnTrans repr) => Name -> repr f k -> repr f k rule :: (CLI_Help repr, Trans repr) => CLI_Help (UnTrans repr) => Name -> repr f k -> repr f k infixr 0 `help` class Trans repr where { -- | The (repr)esentation that (repr) Transforms. type family UnTrans repr :: * -> * -> *; } -- | Lift the underlying (repr)esentation to (repr). -- Useful to define a combinator that does nothing in a -- Transformation. noTrans :: Trans repr => UnTrans repr a b -> repr a b -- | Unlift a (repr)esentation. Useful when a -- Transformation combinator needs to access the -- UnTransformed (repr)esentation, or at the end to get -- the underlying UnTransformed (repr)esentation from the -- inferred (repr) value (eg. in server). unTrans :: Trans repr => repr a b -> UnTrans repr a b instance GHC.Show.Show Symantic.CLI.API.Tag instance GHC.Classes.Eq Symantic.CLI.API.Tag module Symantic.CLI.Fixity data Fixity Fixity1 :: Unifix -> Fixity Fixity2 :: Infix -> Fixity data Unifix Prefix :: Precedence -> Unifix [unifix_prece] :: Unifix -> Precedence Postfix :: Precedence -> Unifix [unifix_prece] :: Unifix -> Precedence data Infix Infix :: Maybe Associativity -> Precedence -> Infix [infix_assoc] :: Infix -> Maybe Associativity [infix_prece] :: Infix -> Precedence infixL :: Precedence -> Infix infixR :: Precedence -> Infix infixB :: Side -> Precedence -> Infix infixN :: Precedence -> Infix infixN0 :: Infix infixN5 :: Infix -- | Given Precedence and Associativity of its parent -- operator, and the operand Side it is in, return whether an -- Infix operator needs to be enclosed by parenthesis. needsParenInfix :: (Infix, Side) -> Infix -> Bool type Precedence = Int class PrecedenceOf a precedence :: PrecedenceOf a => a -> Precedence data Associativity -- | Associate to the left: a ¹ b ² c == (a ¹ b) ² c AssocL :: Associativity -- | Associate to the right: a ¹ b ² c == a ¹ (b ² c) AssocR :: Associativity -- | Associate to both sides, but to Side when reading. AssocB :: Side -> Associativity data Side -- | Left SideL :: Side -- | Right SideR :: Side instance GHC.Show.Show Symantic.CLI.Fixity.Fixity instance GHC.Classes.Eq Symantic.CLI.Fixity.Fixity instance GHC.Show.Show Symantic.CLI.Fixity.Infix instance GHC.Classes.Eq Symantic.CLI.Fixity.Infix instance GHC.Show.Show Symantic.CLI.Fixity.Associativity instance GHC.Classes.Eq Symantic.CLI.Fixity.Associativity instance GHC.Show.Show Symantic.CLI.Fixity.Side instance GHC.Classes.Eq Symantic.CLI.Fixity.Side instance GHC.Show.Show Symantic.CLI.Fixity.Unifix instance GHC.Classes.Eq Symantic.CLI.Fixity.Unifix instance Symantic.CLI.Fixity.PrecedenceOf Symantic.CLI.Fixity.Fixity instance Symantic.CLI.Fixity.PrecedenceOf Symantic.CLI.Fixity.Infix instance Symantic.CLI.Fixity.PrecedenceOf Symantic.CLI.Fixity.Unifix module Symantic.CLI.Parser newtype Parser e d f k Parser :: ParsecT e [Arg] IO (f -> k) -> Parser e d f k [unParser] :: Parser e d f k -> ParsecT e [Arg] IO (f -> k) parser :: ShowErrorComponent e => Router (Parser e d) handlers (Response (Router (Parser e d))) -> handlers -> [Arg] -> IO () -- | Rewrite parseErrorTextPretty to keep Ord of Arg. parseErrorTextPretty :: forall s e. (Stream s, ShowErrorComponent e) => ParseError s e -> String messageItemsPretty :: String -> [String] -> String orList :: NonEmpty String -> String showErrorItem :: Stream s => Proxy s -> ErrorItem (Token s) -> String concatCont :: [(a -> k) -> k] -> ([a] -> k) -> k consCont :: (a -> b -> c) -> ((a -> k) -> k) -> ((b -> k) -> k) -> (c -> k) -> k mapCont :: (a -> b) -> ((a -> k) -> k) -> (b -> k) -> k newtype ParserResponse ParserResponse :: IO () -> ParserResponse [unResponseParser] :: ParserResponse -> IO () type ParserResponseArgs = IO -- | Output of a CLI. class IOType a => Outputable a output :: Outputable a => a -> IO () output :: (Outputable a, Show a) => a -> IO () data OnHandle a OnHandle :: Handle -> a -> OnHandle a -- | Like a MIME type but for input/output of a CLI. class IOType a ioType :: IOType a => String ioType :: (IOType a, Typeable a) => String class FromSegment a fromSegment :: FromSegment a => Segment -> IO (Either String a) fromSegment :: (FromSegment a, Read a) => Segment -> IO (Either String a) data ParserPerm e d repr k a ParserPerm :: !Maybe ((a -> k) -> k) -> repr () (ParserPerm e d repr k a) -> ParserPerm e d repr k a [permutation_result] :: ParserPerm e d repr k a -> !Maybe ((a -> k) -> k) [permutation_parser] :: ParserPerm e d repr k a -> repr () (ParserPerm e d repr k a) noTransParserPerm :: Trans repr => Functor (UnTrans repr ()) => ParserPerm e d (UnTrans repr) k a -> ParserPerm e d repr k a unTransParserPerm :: Trans repr => Functor (UnTrans repr ()) => ParserPerm e d repr k a -> ParserPerm e d (UnTrans repr) k a hoistParserPerm :: Functor (repr ()) => (forall a b. repr a b -> repr a b) -> ParserPerm e d repr k c -> ParserPerm e d repr k c class CLI_Routing repr commands :: CLI_Routing repr => Map Name (repr a k) -> Map Name (repr a k) -> repr a k data Router repr a b -- | Lift any (repr) into Router, those not useful to -- segregate wrt. the Transformation performed, aka. -- noTrans. [Router_Any] :: repr a b -> Router repr a b -- | Represent commands. [Router_Commands] :: Map Name (Router repr a k) -> Map Name (Router repr a k) -> Router repr a k -- | Represent tagged. [Router_Tagged] :: Tag -> Router repr f k -> Router repr f k -- | Represent (<.>). [Router_App] :: Router repr a b -> Router repr b c -> Router repr a c -- | Represent (<!>). [Router_Alt] :: Router repr a k -> Router repr b k -> Router repr (a :!: b) k -- | Unify Routers which have different handlers. Useful to -- put alternative Routers in a Map as in -- Router_Commands. [Router_Union] :: (b -> a) -> Router repr a k -> Router repr b k router :: repr ~ Parser e d => Router repr a b -> Router repr a b -- | Merge/reorder alternatives if possible or default to a -- Router_Alt. router_Alt :: repr ~ Parser e d => Router repr a k -> Router repr b k -> Router repr (a :!: b) k router_Commands :: repr ~ Parser e d => Bool -> Map Segment (Router repr a k) -> Map Segment (Router repr b k) -> Map Segment (Router repr (a :!: b) k) data Arg ArgSegment :: Segment -> Arg ArgTagLong :: Name -> Arg ArgTagShort :: Char -> Arg -- | Here only for error reporting. ArgEnv :: Name -> String -> Arg lexer :: [String] -> [Arg] showArg :: Arg -> String showArgs :: [Arg] -> String instance GHC.Show.Show Symantic.CLI.Parser.Arg instance GHC.Classes.Ord Symantic.CLI.Parser.Arg instance GHC.Classes.Eq Symantic.CLI.Parser.Arg instance GHC.Base.Functor (Symantic.CLI.Parser.Parser e d f) instance GHC.Base.Applicative (Symantic.CLI.Parser.Parser e d f) instance GHC.Classes.Ord e => GHC.Base.Alternative (Symantic.CLI.Parser.Parser e d f) instance GHC.Classes.Ord e => Symantic.CLI.API.Permutable (Symantic.CLI.Parser.Parser e d) instance Symantic.CLI.API.App (Symantic.CLI.Parser.Parser e d) instance GHC.Classes.Ord e => Symantic.CLI.API.Alt (Symantic.CLI.Parser.Parser e d) instance GHC.Classes.Ord e => Symantic.CLI.API.AltApp (Symantic.CLI.Parser.Parser e d) instance Symantic.CLI.API.Pro (Symantic.CLI.Parser.Parser e d) instance GHC.Classes.Ord e => Symantic.CLI.API.CLI_Command (Symantic.CLI.Parser.Parser e d) instance GHC.Classes.Ord e => Symantic.CLI.API.CLI_Tag (Symantic.CLI.Parser.Parser e d) instance GHC.Classes.Ord e => Symantic.CLI.API.CLI_Var (Symantic.CLI.Parser.Parser e d) instance GHC.Classes.Ord e => Symantic.CLI.API.CLI_Env (Symantic.CLI.Parser.Parser e d) instance GHC.Classes.Ord e => Symantic.CLI.API.CLI_Response (Symantic.CLI.Parser.Parser e d) instance GHC.Classes.Ord e => Symantic.CLI.API.CLI_Help (Symantic.CLI.Parser.Parser e d) instance Symantic.CLI.API.CLI_Help repr => Symantic.CLI.API.CLI_Help (Symantic.CLI.Parser.ParserPerm e d repr) instance GHC.Classes.Ord e => Symantic.CLI.Parser.CLI_Routing (Symantic.CLI.Parser.Parser e d) instance GHC.Classes.Ord e => GHC.Base.Functor (Symantic.CLI.Parser.Router (Symantic.CLI.Parser.Parser e d) f) instance GHC.Classes.Ord e => GHC.Base.Applicative (Symantic.CLI.Parser.Router (Symantic.CLI.Parser.Parser e d) f) instance GHC.Classes.Ord e => GHC.Base.Alternative (Symantic.CLI.Parser.Router (Symantic.CLI.Parser.Parser e d) f) instance GHC.Classes.Ord e => Symantic.CLI.API.Permutable (Symantic.CLI.Parser.Router (Symantic.CLI.Parser.Parser e d)) instance (repr Data.Type.Equality.~ Symantic.CLI.Parser.Parser e d) => GHC.Show.Show (Symantic.CLI.Parser.Router repr a b) instance GHC.Classes.Ord e => Symantic.CLI.API.Trans (Symantic.CLI.Parser.Router (Symantic.CLI.Parser.Parser e d)) instance GHC.Classes.Ord e => Symantic.CLI.API.App (Symantic.CLI.Parser.Router (Symantic.CLI.Parser.Parser e d)) instance GHC.Classes.Ord e => Symantic.CLI.API.Alt (Symantic.CLI.Parser.Router (Symantic.CLI.Parser.Parser e d)) instance GHC.Classes.Ord e => Symantic.CLI.API.Pro (Symantic.CLI.Parser.Router (Symantic.CLI.Parser.Parser e d)) instance (repr Data.Type.Equality.~ Symantic.CLI.Parser.Parser e d) => Symantic.CLI.API.CLI_Command (Symantic.CLI.Parser.Router repr) instance GHC.Classes.Ord e => Symantic.CLI.API.CLI_Var (Symantic.CLI.Parser.Router (Symantic.CLI.Parser.Parser e d)) instance GHC.Classes.Ord e => Symantic.CLI.API.CLI_Env (Symantic.CLI.Parser.Router (Symantic.CLI.Parser.Parser e d)) instance GHC.Classes.Ord e => Symantic.CLI.API.CLI_Tag (Symantic.CLI.Parser.Router (Symantic.CLI.Parser.Parser e d)) instance Symantic.CLI.API.CLI_Help (Symantic.CLI.Parser.Router (Symantic.CLI.Parser.Parser e d)) instance GHC.Classes.Ord e => Symantic.CLI.API.CLI_Response (Symantic.CLI.Parser.Router (Symantic.CLI.Parser.Parser e d)) instance GHC.Classes.Ord e => Symantic.CLI.Parser.CLI_Routing (Symantic.CLI.Parser.Router (Symantic.CLI.Parser.Parser e d)) instance Text.Megaparsec.Stream.Stream [Symantic.CLI.Parser.Arg] instance (Symantic.CLI.API.App repr, GHC.Base.Functor (repr ())) => GHC.Base.Functor (Symantic.CLI.Parser.ParserPerm e d repr k) instance (Symantic.CLI.API.App repr, GHC.Base.Functor (repr ()), GHC.Base.Alternative (repr ())) => GHC.Base.Applicative (Symantic.CLI.Parser.ParserPerm e d repr k) instance Symantic.CLI.Parser.FromSegment GHC.Base.String instance Symantic.CLI.Parser.FromSegment Data.Text.Internal.Text instance Symantic.CLI.Parser.FromSegment Data.Text.Internal.Lazy.Text instance Symantic.CLI.Parser.FromSegment GHC.Types.Bool instance Symantic.CLI.Parser.FromSegment GHC.Types.Int instance Symantic.CLI.Parser.FromSegment GHC.Integer.Type.Integer instance Symantic.CLI.Parser.FromSegment GHC.Natural.Natural instance Symantic.CLI.Parser.Outputable () instance Symantic.CLI.Parser.Outputable GHC.Types.Bool instance Symantic.CLI.Parser.Outputable GHC.Types.Int instance Symantic.CLI.Parser.Outputable GHC.Integer.Type.Integer instance Symantic.CLI.Parser.Outputable GHC.Natural.Natural instance Symantic.CLI.Parser.Outputable GHC.Types.Char instance Symantic.CLI.Parser.Outputable GHC.Base.String instance Symantic.CLI.Parser.Outputable Data.Text.Internal.Text instance Symantic.CLI.Parser.Outputable Data.Text.Internal.Lazy.Text instance Symantic.CLI.Parser.Outputable (Symantic.Document.Plain.Plain Data.Text.Internal.Builder.Builder) instance Symantic.CLI.Parser.Outputable (Symantic.CLI.Parser.OnHandle ()) instance Symantic.CLI.Parser.Outputable (Symantic.CLI.Parser.OnHandle GHC.Types.Bool) instance Symantic.CLI.Parser.Outputable (Symantic.CLI.Parser.OnHandle GHC.Types.Int) instance Symantic.CLI.Parser.Outputable (Symantic.CLI.Parser.OnHandle GHC.Integer.Type.Integer) instance Symantic.CLI.Parser.Outputable (Symantic.CLI.Parser.OnHandle GHC.Natural.Natural) instance Symantic.CLI.Parser.Outputable (Symantic.CLI.Parser.OnHandle GHC.Types.Char) instance Symantic.CLI.Parser.Outputable (Symantic.CLI.Parser.OnHandle GHC.Base.String) instance Symantic.CLI.Parser.Outputable (Symantic.CLI.Parser.OnHandle Data.Text.Internal.Text) instance Symantic.CLI.Parser.Outputable (Symantic.CLI.Parser.OnHandle Data.Text.Internal.Lazy.Text) instance Symantic.CLI.Parser.Outputable (Symantic.CLI.Parser.OnHandle (Symantic.Document.Plain.Plain Data.Text.Internal.Builder.Builder)) instance Symantic.CLI.Parser.IOType a => Symantic.CLI.Parser.IOType (Symantic.CLI.Parser.OnHandle a) instance Symantic.CLI.Parser.IOType () instance Symantic.CLI.Parser.IOType GHC.Types.Bool instance Symantic.CLI.Parser.IOType GHC.Types.Char instance Symantic.CLI.Parser.IOType GHC.Types.Int instance Symantic.CLI.Parser.IOType GHC.Integer.Type.Integer instance Symantic.CLI.Parser.IOType GHC.Natural.Natural instance Symantic.CLI.Parser.IOType GHC.Base.String instance Symantic.CLI.Parser.IOType Data.Text.Internal.Text instance Symantic.CLI.Parser.IOType Data.Text.Internal.Lazy.Text instance Symantic.CLI.Parser.IOType (Symantic.Document.Plain.Plain Data.Text.Internal.Builder.Builder) instance Symantic.CLI.Parser.IOType (GHC.IO.Handle.Types.Handle, Symantic.Document.Plain.Plain Data.Text.Internal.Builder.Builder) module Symantic.CLI.Schema newtype Schema d f k Schema :: (SchemaInh d -> Maybe d) -> Schema d f k [unSchema] :: Schema d f k -> SchemaInh d -> Maybe d runSchema :: Monoid d => Schema d f k -> SchemaInh d -> d docSchema :: Monoid d => SchemaDoc d => Schema d f k -> d coerceSchema :: Schema d f k -> Schema d f' k' type SchemaDoc d = (Semigroup d, Monoid d, IsString d, Colorable16 d, Decorable d, Spaceable d, Indentable d, Wrappable d, From (Word Char) d, From (Word Text) d, From (Word String) d) -- | Inherited top-down. data SchemaInh d SchemaInh :: (Infix, Side) -> Bool -> d -> SchemaInh d -- | Parent operator. [schemaInh_op] :: SchemaInh d -> (Infix, Side) -- | Whether to print a definition, or not. [schemaInh_define] :: SchemaInh d -> Bool [schemaInh_or] :: SchemaInh d -> d defSchemaInh :: SchemaDoc d => SchemaInh d pairIfNeeded :: SchemaDoc d => (Infix, Side) -> Infix -> d -> d docOrH :: Spaceable d => From (Word Char) d => d docOrV :: Spaceable d => From (Word Char) d => d data SchemaResponseArgs a data SchemaPerm d k a SchemaPerm :: (forall b c. Schema d (b -> c) c -> Schema d (b -> c) c) -> [Schema d (a -> k) k] -> SchemaPerm d k a -- | Used to implement rule. [schemaPerm_finalizer] :: SchemaPerm d k a -> forall b c. Schema d (b -> c) c -> Schema d (b -> c) c -- | Collect alternatives for rendering them all at once in -- runPermutation. [schemaPerm_alternatives] :: SchemaPerm d k a -> [Schema d (a -> k) k] instance GHC.Base.Functor (Symantic.CLI.Schema.SchemaPerm d k) instance GHC.Base.Applicative (Symantic.CLI.Schema.SchemaPerm d k) instance Symantic.CLI.Schema.SchemaDoc d => Symantic.CLI.API.Permutable (Symantic.CLI.Schema.Schema d) instance Symantic.CLI.Schema.SchemaDoc d => Symantic.CLI.API.CLI_Help (Symantic.CLI.Schema.SchemaPerm d) instance Symantic.CLI.Schema.SchemaDoc d => Symantic.CLI.API.CLI_Response (Symantic.CLI.Schema.Schema d) instance GHC.Base.Semigroup d => GHC.Base.Semigroup (Symantic.CLI.Schema.Schema d f k) instance (GHC.Base.Semigroup d, GHC.Base.Monoid d) => GHC.Base.Monoid (Symantic.CLI.Schema.Schema d f k) instance (GHC.Base.Semigroup d, Data.String.IsString d) => Data.String.IsString (Symantic.CLI.Schema.Schema d f k) instance GHC.Show.Show (Symantic.CLI.Schema.Schema (Symantic.Document.Plain.Plain Data.Text.Internal.Builder.Builder) a k) instance Symantic.CLI.Schema.SchemaDoc d => Symantic.CLI.API.App (Symantic.CLI.Schema.Schema d) instance Symantic.CLI.Schema.SchemaDoc d => Symantic.CLI.API.Alt (Symantic.CLI.Schema.Schema d) instance Symantic.CLI.API.Pro (Symantic.CLI.Schema.Schema d) instance Symantic.CLI.Schema.SchemaDoc d => Symantic.CLI.API.AltApp (Symantic.CLI.Schema.Schema d) instance Symantic.CLI.Schema.SchemaDoc d => Symantic.CLI.API.CLI_Command (Symantic.CLI.Schema.Schema d) instance Symantic.CLI.Schema.SchemaDoc d => Symantic.CLI.API.CLI_Var (Symantic.CLI.Schema.Schema d) instance Symantic.CLI.Schema.SchemaDoc d => Symantic.CLI.API.CLI_Env (Symantic.CLI.Schema.Schema d) instance Symantic.CLI.Schema.SchemaDoc d => Symantic.CLI.API.CLI_Tag (Symantic.CLI.Schema.Schema d) instance Symantic.CLI.Schema.SchemaDoc d => Symantic.CLI.API.CLI_Help (Symantic.CLI.Schema.Schema d) module Symantic.CLI.Layout data Layout d f k Layout :: Schema d f k -> [d] -> (LayoutInh d -> State (LayoutState d) ()) -> Layout d f k -- | Synthetized (bottom-up) Schema. Useful for complex grammar -- rules or alternatives associated to the left of a -- response. [layoutSchema] :: Layout d f k -> Schema d f k -- | Synthetized (bottom-up) help. Useful in LayoutPerm to -- merge nested help and nesting help of the permutation. [layoutHelp] :: Layout d f k -> [d] [unLayout] :: Layout d f k -> LayoutInh d -> State (LayoutState d) () runLayout :: LayoutDoc d => Bool -> Layout d f k -> d newtype LayoutInh d LayoutInh :: [d] -> LayoutInh d [layoutInh_message] :: LayoutInh d -> [d] defLayoutInh :: LayoutInh d type LayoutState d = Diff (Forest (LayoutNode d)) -- | A continuation-passing-style constructor, (each constructor prepending -- something), augmented with Maybe to change the prepending -- according to what the following parts are. Used in <!> -- and alt to know if branches lead to at least one route (ie. -- contain at least one response). type Diff a = Maybe a -> Maybe a type LayoutDoc d = (SchemaDoc d, Justifiable d) runLayoutForest :: LayoutDoc d => Bool -> Forest (LayoutNode d) -> d runLayoutTree :: LayoutDoc d => Bool -> Tree (LayoutNode d) -> d runLayoutNode :: LayoutDoc d => Bool -> Tree (LayoutNode d) -> [d] data LayoutPerm d k a LayoutPerm :: [d] -> (LayoutInh d -> [([d], d)]) -> LayoutPerm d k a [layoutPerm_help] :: LayoutPerm d k a -> [d] [layoutPerm_elem] :: LayoutPerm d k a -> LayoutInh d -> [([d], d)] data LayoutNode d LayoutNode_Help :: [d] -> d -> LayoutNode d LayoutNode_Tags :: [([d], d)] -> LayoutNode d instance GHC.Show.Show d => GHC.Show.Show (Symantic.CLI.Layout.LayoutNode d) instance Symantic.CLI.Layout.LayoutDoc d => Symantic.CLI.API.App (Symantic.CLI.Layout.Layout d) instance Symantic.CLI.Layout.LayoutDoc d => Symantic.CLI.API.Alt (Symantic.CLI.Layout.Layout d) instance Symantic.CLI.API.Pro (Symantic.CLI.Layout.Layout d) instance (Symantic.CLI.Layout.LayoutDoc d, Symantic.Document.API.From Symantic.CLI.API.Name d) => Symantic.CLI.API.CLI_Command (Symantic.CLI.Layout.Layout d) instance (Symantic.CLI.Layout.LayoutDoc d, Symantic.Document.API.Justifiable d) => Symantic.CLI.API.CLI_Tag (Symantic.CLI.Layout.Layout d) instance Symantic.CLI.Layout.LayoutDoc d => Symantic.CLI.API.CLI_Var (Symantic.CLI.Layout.Layout d) instance Symantic.CLI.Layout.LayoutDoc d => Symantic.CLI.API.CLI_Env (Symantic.CLI.Layout.Layout d) instance Symantic.CLI.Layout.LayoutDoc d => Symantic.CLI.API.CLI_Help (Symantic.CLI.Layout.Layout d) instance Symantic.CLI.Layout.LayoutDoc d => Symantic.CLI.API.CLI_Response (Symantic.CLI.Layout.Layout d) instance (Symantic.CLI.Layout.LayoutDoc d, Symantic.Document.API.Justifiable d) => Symantic.CLI.API.Permutable (Symantic.CLI.Layout.Layout d) instance GHC.Base.Functor (Symantic.CLI.Layout.LayoutPerm d k) instance GHC.Base.Applicative (Symantic.CLI.Layout.LayoutPerm d k) instance Symantic.CLI.Layout.LayoutDoc d => Symantic.CLI.API.CLI_Help (Symantic.CLI.Layout.LayoutPerm d) module Symantic.CLI.Help data Help d f k Help :: (HelpInh d -> HelpResult d) -> Schema d f k -> Help d f k -- | The HelpResult of the current symantic. [help_result] :: Help d f k -> HelpInh d -> HelpResult d -- | The Schema of the current symantic. [help_schema] :: Help d f k -> Schema d f k runHelp :: SchemaDoc d => HelpInh d -> Help d f k -> d docHelp :: SchemaDoc d => Indentable d => SchemaDoc d => Help d f k -> d coerceHelp :: Help d f k -> Help d f' k' -- | Configuration inherited top-down. data HelpInh d HelpInh :: !Maybe d -> !Indent -> !Indent -> !SchemaInh d -> !Bool -> !Bool -> !Bool -> HelpInh d -- | The message inherited from helps. [helpInh_message] :: HelpInh d -> !Maybe d -- | Indentation for commands. [helpInh_command_indent] :: HelpInh d -> !Indent -- | Indentation for Tags. [helpInh_tag_indent] :: HelpInh d -> !Indent -- | The inherited SchemaInh for runSchema. [helpInh_schema] :: HelpInh d -> !SchemaInh d -- | Whether to include options without help in the listing. [helpInh_helpless_options] :: HelpInh d -> !Bool -- | Whether to print the name of the rule. [helpInh_command_rule] :: HelpInh d -> !Bool -- | Whether to print full help. [helpInh_full] :: HelpInh d -> !Bool defHelpInh :: SchemaDoc d => HelpInh d type HelpResult d = Forest (HelpNode, d) defHelpResult :: Monoid d => HelpResult d data HelpNode HelpNode_Message :: HelpNode HelpNode_Rule :: HelpNode HelpNode_Command :: HelpNode HelpNode_Tag :: HelpNode HelpNode_Env :: HelpNode runHelpNode :: SchemaDoc d => Tree (HelpNode, d) -> d -- | Introduce newline according to the HelpNodes put next to -- each others. runHelpNodes :: SchemaDoc d => HelpInh d -> Forest (HelpNode, d) -> d type HelpResponseArgs = SchemaResponseArgs data HelpPerm d k a HelpPerm :: (HelpInh d -> HelpResult d) -> SchemaPerm d k a -> HelpPerm d k a instance GHC.Show.Show Symantic.CLI.Help.HelpNode instance Symantic.CLI.Schema.SchemaDoc d => Symantic.CLI.API.Permutable (Symantic.CLI.Help.Help d) instance GHC.Base.Functor (Symantic.CLI.Help.HelpPerm d k) instance GHC.Base.Applicative (Symantic.CLI.Help.HelpPerm d k) instance Symantic.CLI.Schema.SchemaDoc d => Symantic.CLI.API.CLI_Help (Symantic.CLI.Help.HelpPerm d) instance GHC.Base.Semigroup d => GHC.Base.Semigroup (Symantic.CLI.Help.Help d f k) instance GHC.Base.Monoid d => GHC.Base.Monoid (Symantic.CLI.Help.Help d f k) instance Symantic.CLI.Schema.SchemaDoc d => Symantic.CLI.API.App (Symantic.CLI.Help.Help d) instance Symantic.CLI.Schema.SchemaDoc d => Symantic.CLI.API.Alt (Symantic.CLI.Help.Help d) instance Symantic.CLI.API.Pro (Symantic.CLI.Help.Help d) instance Symantic.CLI.Schema.SchemaDoc d => Symantic.CLI.API.AltApp (Symantic.CLI.Help.Help d) instance Symantic.CLI.Schema.SchemaDoc d => Symantic.CLI.API.CLI_Var (Symantic.CLI.Help.Help d) instance Symantic.CLI.Schema.SchemaDoc d => Symantic.CLI.API.CLI_Env (Symantic.CLI.Help.Help d) instance Symantic.CLI.Schema.SchemaDoc d => Symantic.CLI.API.CLI_Command (Symantic.CLI.Help.Help d) instance Symantic.CLI.Schema.SchemaDoc d => Symantic.CLI.API.CLI_Tag (Symantic.CLI.Help.Help d) instance Symantic.CLI.Schema.SchemaDoc d => Symantic.CLI.API.CLI_Help (Symantic.CLI.Help.Help d) instance Symantic.CLI.Schema.SchemaDoc d => Symantic.CLI.API.CLI_Response (Symantic.CLI.Help.Help d) module Symantic.CLI