symantic-cli-2.3.3.20190711: Symantics for parsing and documenting a CLI

Safe HaskellNone
LanguageHaskell2010

Symantic.CLI.Schema

Contents

Synopsis

Type Schema

newtype Schema d f k Source #

Constructors

Schema 

Fields

Instances
SchemaDoc d => CLI_Help (Schema d) Source # 
Instance details

Defined in Symantic.CLI.Schema

Associated Types

type HelpConstraint (Schema d) d :: Constraint Source #

Methods

help :: HelpConstraint (Schema d) d0 => d0 -> Schema d f k -> Schema d f k Source #

program :: Name -> Schema d f k -> Schema d f k Source #

rule :: Name -> Schema d f k -> Schema d f k Source #

SchemaDoc d => CLI_Response (Schema d) Source # 
Instance details

Defined in Symantic.CLI.Schema

Associated Types

type ResponseConstraint (Schema d) a :: Constraint Source #

type ResponseArgs (Schema d) a :: Type Source #

type Response (Schema d) :: Type Source #

SchemaDoc d => CLI_Tag (Schema d) Source # 
Instance details

Defined in Symantic.CLI.Schema

Associated Types

type TagConstraint (Schema d) a :: Constraint Source #

Methods

tagged :: Tag -> Schema d f k -> Schema d f k Source #

endOpts :: Schema d k k Source #

short :: TagConstraint (Schema d) a => Char -> Schema d (a -> k) k -> Permutation (Schema d) k a Source #

long :: TagConstraint (Schema d) a => Name -> Schema d (a -> k) k -> Permutation (Schema d) k a Source #

option :: TagConstraint (Schema d) a => a -> Schema d (a -> k) k -> Permutation (Schema d) k a Source #

flag :: TagConstraint (Schema d) Bool => Tag -> Permutation (Schema d) k Bool Source #

shortOpt :: TagConstraint (Schema d) a => Char -> a -> Schema d (a -> k) k -> Permutation (Schema d) k a Source #

longOpt :: TagConstraint (Schema d) a => Name -> a -> Schema d (a -> k) k -> Permutation (Schema d) k a Source #

SchemaDoc d => CLI_Env (Schema d) Source # 
Instance details

Defined in Symantic.CLI.Schema

Associated Types

type EnvConstraint (Schema d) a :: Constraint Source #

Methods

env' :: EnvConstraint (Schema d) a => Name -> Schema d (a -> k) k Source #

SchemaDoc d => CLI_Var (Schema d) Source # 
Instance details

Defined in Symantic.CLI.Schema

Associated Types

type VarConstraint (Schema d) a :: Constraint Source #

Methods

var' :: VarConstraint (Schema d) a => Name -> Schema d (a -> k) k Source #

just :: a -> Schema d (a -> k) k Source #

nothing :: Schema d k k Source #

SchemaDoc d => CLI_Command (Schema d) Source # 
Instance details

Defined in Symantic.CLI.Schema

Methods

command :: Name -> Schema d a k -> Schema d a k Source #

SchemaDoc d => Permutable (Schema d) Source # 
Instance details

Defined in Symantic.CLI.Schema

Associated Types

type Permutation (Schema d) = (r :: Type -> Type -> Type) Source #

Methods

runPermutation :: Permutation (Schema d) k a -> Schema d (a -> k) k Source #

toPermutation :: Schema d (a -> k) k -> Permutation (Schema d) k a Source #

toPermDefault :: a -> Schema d (a -> k) k -> Permutation (Schema d) k a Source #

SchemaDoc d => AltApp (Schema d) Source # 
Instance details

Defined in Symantic.CLI.Schema

Methods

many0 :: Schema d (a -> k) k -> Schema d ([a] -> k) k Source #

many1 :: Schema d (a -> k) k -> Schema d ([a] -> k) k Source #

Pro (Schema d) Source # 
Instance details

Defined in Symantic.CLI.Schema

Methods

dimap :: (a -> b) -> (b -> a) -> Schema d (a -> k) k -> Schema d (b -> k) k Source #

SchemaDoc d => Alt (Schema d) Source # 
Instance details

Defined in Symantic.CLI.Schema

Methods

(<!>) :: Schema d a k -> Schema d b k -> Schema d (a :!: b) k Source #

alt :: Schema d a k -> Schema d a k -> Schema d a k Source #

opt :: Schema d (a -> k) k -> Schema d (Maybe a -> k) k Source #

SchemaDoc d => App (Schema d) Source # 
Instance details

Defined in Symantic.CLI.Schema

Methods

(<.>) :: Schema d a b -> Schema d b c -> Schema d a c Source #

Show (Schema (Plain Builder) a k) Source # 
Instance details

Defined in Symantic.CLI.Schema

(Semigroup d, IsString d) => IsString (Schema d f k) Source # 
Instance details

Defined in Symantic.CLI.Schema

Methods

fromString :: String -> Schema d f k #

Semigroup d => Semigroup (Schema d f k) Source # 
Instance details

Defined in Symantic.CLI.Schema

Methods

(<>) :: Schema d f k -> Schema d f k -> Schema d f k #

sconcat :: NonEmpty (Schema d f k) -> Schema d f k #

stimes :: Integral b => b -> Schema d f k -> Schema d f k #

(Semigroup d, Monoid d) => Monoid (Schema d f k) Source # 
Instance details

Defined in Symantic.CLI.Schema

Methods

mempty :: Schema d f k #

mappend :: Schema d f k -> Schema d f k -> Schema d f k #

mconcat :: [Schema d f k] -> Schema d f k #

type Response (Schema d) Source # 
Instance details

Defined in Symantic.CLI.Schema

type Response (Schema d) = ()
type Permutation (Schema d) Source # 
Instance details

Defined in Symantic.CLI.Schema

type HelpConstraint (Schema d) d' Source # 
Instance details

Defined in Symantic.CLI.Schema

type HelpConstraint (Schema d) d' = d ~ d'
type ResponseConstraint (Schema d) a Source # 
Instance details

Defined in Symantic.CLI.Schema

type ResponseConstraint (Schema d) a = ()
type ResponseArgs (Schema d) a Source # 
Instance details

Defined in Symantic.CLI.Schema

type TagConstraint (Schema d) a Source # 
Instance details

Defined in Symantic.CLI.Schema

type TagConstraint (Schema d) a = ()
type EnvConstraint (Schema d) a Source # 
Instance details

Defined in Symantic.CLI.Schema

type EnvConstraint (Schema d) a = ()
type VarConstraint (Schema d) a Source # 
Instance details

Defined in Symantic.CLI.Schema

type VarConstraint (Schema d) a = ()

runSchema :: Monoid d => Schema d f k -> SchemaInh d -> d Source #

docSchema :: Monoid d => SchemaDoc d => Schema d f k -> d Source #

coerceSchema :: Schema d f k -> Schema d f' k' Source #

Class SchemaDoc

Type SchemaInh

data SchemaInh d Source #

Inherited top-down.

Constructors

SchemaInh 

Fields

pairIfNeeded :: SchemaDoc d => (Infix, Side) -> Infix -> d -> d Source #

docOrH :: Spaceable d => From (Word Char) d => d Source #

docOrV :: Spaceable d => From (Word Char) d => d Source #

Type SchemaPerm

data SchemaPerm d k a Source #

Constructors

SchemaPerm 

Fields

Instances
SchemaDoc d => CLI_Help (SchemaPerm d) Source # 
Instance details

Defined in Symantic.CLI.Schema

Associated Types

type HelpConstraint (SchemaPerm d) d :: Constraint Source #

Methods

help :: HelpConstraint (SchemaPerm d) d0 => d0 -> SchemaPerm d f k -> SchemaPerm d f k Source #

program :: Name -> SchemaPerm d f k -> SchemaPerm d f k Source #

rule :: Name -> SchemaPerm d f k -> SchemaPerm d f k Source #

Functor (SchemaPerm d k) Source # 
Instance details

Defined in Symantic.CLI.Schema

Methods

fmap :: (a -> b) -> SchemaPerm d k a -> SchemaPerm d k b #

(<$) :: a -> SchemaPerm d k b -> SchemaPerm d k a #

Applicative (SchemaPerm d k) Source # 
Instance details

Defined in Symantic.CLI.Schema

Methods

pure :: a -> SchemaPerm d k a #

(<*>) :: SchemaPerm d k (a -> b) -> SchemaPerm d k a -> SchemaPerm d k b #

liftA2 :: (a -> b -> c) -> SchemaPerm d k a -> SchemaPerm d k b -> SchemaPerm d k c #

(*>) :: SchemaPerm d k a -> SchemaPerm d k b -> SchemaPerm d k b #

(<*) :: SchemaPerm d k a -> SchemaPerm d k b -> SchemaPerm d k a #

type HelpConstraint (SchemaPerm d) d' Source # 
Instance details

Defined in Symantic.CLI.Schema

type HelpConstraint (SchemaPerm d) d' = d ~ d'