getopt-generics-0.13.0.4: Create command line interfaces with ease
Safe HaskellNone
LanguageHaskell2010

WithCli.Pure

Synopsis

Documentation

withCliPure Source #

Arguments

:: WithCliPure function a 
=> String 
-> [Modifier] 
-> [String] 
-> function

The function parameter can be a function with arbitrary many parameters as long as they have an instance for HasArguments. You can choose the return type of function freely, withCliPure will return it wrapped in Result to account for parse errors, etc. (see Result).

-> Result a 

Pure variant of withCliModified.

class WithCliPure function output Source #

Minimal complete definition

run

Instances

Instances details
WithCliPure output output Source # 
Instance details

Defined in WithCli.Pure.Internal

Methods

run :: String -> Modifiers -> Result (Parser Unnormalized input) -> (input -> output) -> [String] -> Result output

(HasArguments input, WithCliPure function output) => WithCliPure (input -> function) output Source # 
Instance details

Defined in WithCli.Pure.Internal

Methods

run :: String -> Modifiers -> Result (Parser Unnormalized input0) -> (input0 -> input -> function) -> [String] -> Result output

data Result a Source #

Type to wrap results from withCliPure.

Constructors

Success a

The CLI was used correctly and a value of type a was successfully constructed.

Errors String

The CLI was used incorrectly. The Result contains error messages.

It can also happen that the data type you're trying to use isn't supported. See the README for details.

OutputAndExit String

The CLI was used with --help. The Result contains the help message.

Instances

Instances details
Monad Result Source # 
Instance details

Defined in WithCli.Result

Methods

(>>=) :: Result a -> (a -> Result b) -> Result b #

(>>) :: Result a -> Result b -> Result b #

return :: a -> Result a #

Functor Result Source # 
Instance details

Defined in WithCli.Result

Methods

fmap :: (a -> b) -> Result a -> Result b #

(<$) :: a -> Result b -> Result a #

Applicative Result Source # 
Instance details

Defined in WithCli.Result

Methods

pure :: a -> Result a

(<*>) :: Result (a -> b) -> Result a -> Result b

liftA2 :: (a -> b -> c) -> Result a -> Result b -> Result c

(*>) :: Result a -> Result b -> Result b

(<*) :: Result a -> Result b -> Result a

Eq a => Eq (Result a) Source # 
Instance details

Defined in WithCli.Result

Methods

(==) :: Result a -> Result a -> Bool

(/=) :: Result a -> Result a -> Bool

Ord a => Ord (Result a) Source # 
Instance details

Defined in WithCli.Result

Methods

compare :: Result a -> Result a -> Ordering

(<) :: Result a -> Result a -> Bool

(<=) :: Result a -> Result a -> Bool

(>) :: Result a -> Result a -> Bool

(>=) :: Result a -> Result a -> Bool

max :: Result a -> Result a -> Result a

min :: Result a -> Result a -> Result a

Show a => Show (Result a) Source # 
Instance details

Defined in WithCli.Result

Methods

showsPrec :: Int -> Result a -> ShowS

show :: Result a -> String

showList :: [Result a] -> ShowS

handleResult :: Result a -> IO a Source #

Handles an input of type Result a:

  • On Success a it returns the value a.
  • On OutputAndExit message it writes the message to stdout and throws ExitSuccess.
  • On Errors errs it writes the error messages to stderr and throws ExitFailure 1.

This is used by withCli to handle parse results.

class HasArguments a where Source #

Everything that can be used as an argument to your main function (see withCli) needs to have a HasArguments instance.

HasArguments also allows to conjure up instances for record types to create more complex command line interfaces. Here's an example:

 {-# LANGUAGE DeriveAnyClass #-}
 {-# LANGUAGE DeriveGeneric #-}

 import WithCli

 data Options
   = Options {
     port :: Int,
     daemonize :: Bool,
     config :: Maybe FilePath
   }
   deriving (Show, Generic, HasArguments)

 main :: IO ()
 main = withCli run

 run :: Options -> IO ()
 run = print

In a shell this program behaves like this:

 $ program --port 8080 --config some/path
 Options {port = 8080, daemonize = False, config = Just "some/path"}
 $ program  --port 8080 --daemonize
 Options {port = 8080, daemonize = True, config = Nothing}
 $ program --port foo
 cannot parse as INTEGER: foo
 # exit-code 1
 $ program
 missing option: --port=INTEGER
 # exit-code 1
 $ program --help
 program [OPTIONS]
       --port=INTEGER
       --daemonize
       --config=STRING (optional)
   -h  --help                      show help and exit

Minimal complete definition

Nothing

Methods

argumentsParser :: Modifiers -> Maybe String -> Result (Parser Unnormalized a) Source #

default argumentsParser :: (Generic a, GTo a, GDatatypeInfo a, All2 HasArguments (GCode a)) => Modifiers -> Maybe String -> Result (Parser Unnormalized a) Source #

Instances

Instances details
HasArguments Bool Source # 
Instance details

Defined in WithCli.HasArguments

Methods

argumentsParser :: Modifiers -> Maybe String -> Result (Parser Unnormalized Bool) Source #

HasArguments Double Source # 
Instance details

Defined in WithCli.HasArguments

Methods

argumentsParser :: Modifiers -> Maybe String -> Result (Parser Unnormalized Double) Source #

HasArguments Float Source # 
Instance details

Defined in WithCli.HasArguments

Methods

argumentsParser :: Modifiers -> Maybe String -> Result (Parser Unnormalized Float) Source #

HasArguments Int Source # 
Instance details

Defined in WithCli.HasArguments

Methods

argumentsParser :: Modifiers -> Maybe String -> Result (Parser Unnormalized Int) Source #

HasArguments String Source # 
Instance details

Defined in WithCli.HasArguments

Methods

argumentsParser :: Modifiers -> Maybe String -> Result (Parser Unnormalized String) Source #

Argument a => HasArguments [a] Source # 
Instance details

Defined in WithCli.HasArguments

Methods

argumentsParser :: Modifiers -> Maybe String -> Result (Parser Unnormalized [a]) Source #

Argument a => HasArguments (Maybe a) Source # 
Instance details

Defined in WithCli.HasArguments

Methods

argumentsParser :: Modifiers -> Maybe String -> Result (Parser Unnormalized (Maybe a)) Source #

(HasArguments a, HasArguments b) => HasArguments (a, b) Source # 
Instance details

Defined in WithCli.HasArguments

Methods

argumentsParser :: Modifiers -> Maybe String -> Result (Parser Unnormalized (a, b)) Source #

(HasArguments a, HasArguments b, HasArguments c) => HasArguments (a, b, c) Source # 
Instance details

Defined in WithCli.HasArguments

Methods

argumentsParser :: Modifiers -> Maybe String -> Result (Parser Unnormalized (a, b, c)) Source #

atomicArgumentsParser :: forall a. Argument a => Modifiers -> Maybe String -> Result (Parser Unnormalized a) Source #

Useful for implementing your own instances of HasArguments on top of a custom Argument instance.

class Argument a where Source #

Argument is a typeclass for things that can be parsed as atomic values from single command line arguments, e.g. strings (and filenames) and numbers.

Occasionally you might want to declare your own instance for additional type safety and for providing a more informative command argument type. Here's an example:

 {-# LANGUAGE DeriveDataTypeable #-}

 import WithCli

 data File = File FilePath
   deriving (Show, Typeable)

 instance Argument File where
   argumentType Proxy = "custom-file-type"
   parseArgument f = Just (File f)

 instance HasArguments File where
   argumentsParser = atomicArgumentsParser

 main :: IO ()
 main = withCli run

 run :: File -> IO ()
 run = print

And this is how the above program behaves:

 $ program --help
 program [OPTIONS] custom-file-type
   -h  --help  show help and exit
 $ program some/file
 File "some/file"

Instances

Instances details
Argument Double Source # 
Instance details

Defined in WithCli.Argument

Methods

argumentType :: Proxy Double -> String Source #

parseArgument :: String -> Maybe Double Source #

Argument Float Source # 
Instance details

Defined in WithCli.Argument

Methods

argumentType :: Proxy Float -> String Source #

parseArgument :: String -> Maybe Float Source #

Argument Int Source # 
Instance details

Defined in WithCli.Argument

Methods

argumentType :: Proxy Int -> String Source #

parseArgument :: String -> Maybe Int Source #

Argument Integer Source # 
Instance details

Defined in WithCli.Argument

Methods

argumentType :: Proxy Integer -> String Source #

parseArgument :: String -> Maybe Integer Source #

Argument String Source # 
Instance details

Defined in WithCli.Argument

Modifiers

data Modifier Source #

Modifiers can be used to customize the command line parser.

Constructors

AddShortOption String Char

AddShortOption fieldName c adds the Char c as a short option for the field addressed by fieldName.

RenameOption String String

RenameOption fieldName customName renames the option generated through the fieldName by customName.

RenameOptions (String -> Maybe String)

RenameOptions f renames all options with the given functions. In case the function returns Nothing the original field name is used.

Can be used together with stripPrefix.

UseForPositionalArguments String String

UseForPositionalArguments fieldName argumentType fills the field addressed by fieldName with the positional arguments (i.e. arguments that don't correspond to a flag). The field has to have type [String].

argumentType is used as the type of the positional arguments in the help output.

AddOptionHelp String String

AddOptionHelp fieldName helpText adds a help text for the option fieldName.

AddVersionFlag String

AddVersionFlag version adds a --version flag.

Useful Re-exports

class Generic a #

Minimal complete definition

from, to

Instances

Instances details
Generic Bool 
Instance details

Defined in GHC.Generics

Associated Types

type Rep Bool :: Type -> Type

Methods

from :: Bool -> Rep Bool x

to :: Rep Bool x -> Bool

Generic Ordering 
Instance details

Defined in GHC.Generics

Associated Types

type Rep Ordering :: Type -> Type

Methods

from :: Ordering -> Rep Ordering x

to :: Rep Ordering x -> Ordering

Generic Exp 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Exp :: Type -> Type

Methods

from :: Exp -> Rep Exp x

to :: Rep Exp x -> Exp

Generic Match 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Match :: Type -> Type

Methods

from :: Match -> Rep Match x

to :: Rep Match x -> Match

Generic Clause 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Clause :: Type -> Type

Methods

from :: Clause -> Rep Clause x

to :: Rep Clause x -> Clause

Generic Pat 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Pat :: Type -> Type

Methods

from :: Pat -> Rep Pat x

to :: Rep Pat x -> Pat

Generic Type 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Type :: Type -> Type

Methods

from :: Type -> Rep Type x

to :: Rep Type x -> Type

Generic Dec 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Dec :: Type -> Type

Methods

from :: Dec -> Rep Dec x

to :: Rep Dec x -> Dec

Generic Name 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Name :: Type -> Type

Methods

from :: Name -> Rep Name x

to :: Rep Name x -> Name

Generic FunDep 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep FunDep :: Type -> Type

Methods

from :: FunDep -> Rep FunDep x

to :: Rep FunDep x -> FunDep

Generic InjectivityAnn 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep InjectivityAnn :: Type -> Type

Methods

from :: InjectivityAnn -> Rep InjectivityAnn x

to :: Rep InjectivityAnn x -> InjectivityAnn

Generic Overlap 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Overlap :: Type -> Type

Methods

from :: Overlap -> Rep Overlap x

to :: Rep Overlap x -> Overlap

Generic () 
Instance details

Defined in GHC.Generics

Associated Types

type Rep () :: Type -> Type

Methods

from :: () -> Rep () x

to :: Rep () x -> ()

Generic ExitCode 
Instance details

Defined in GHC.IO.Exception

Associated Types

type Rep ExitCode :: Type -> Type

Methods

from :: ExitCode -> Rep ExitCode x

to :: Rep ExitCode x -> ExitCode

Generic Void 
Instance details

Defined in Data.Void

Associated Types

type Rep Void :: Type -> Type

Methods

from :: Void -> Rep Void x

to :: Rep Void x -> Void

Generic Version 
Instance details

Defined in Data.Version

Associated Types

type Rep Version :: Type -> Type

Methods

from :: Version -> Rep Version x

to :: Rep Version x -> Version

Generic SourceUnpackedness 
Instance details

Defined in GHC.Generics

Associated Types

type Rep SourceUnpackedness :: Type -> Type

Generic SourceStrictness 
Instance details

Defined in GHC.Generics

Associated Types

type Rep SourceStrictness :: Type -> Type

Generic DecidedStrictness 
Instance details

Defined in GHC.Generics

Associated Types

type Rep DecidedStrictness :: Type -> Type

Generic Associativity 
Instance details

Defined in GHC.Generics

Associated Types

type Rep Associativity :: Type -> Type

Generic Fixity 
Instance details

Defined in GHC.Generics

Associated Types

type Rep Fixity :: Type -> Type

Methods

from :: Fixity -> Rep Fixity x

to :: Rep Fixity x -> Fixity

Generic ForeignSrcLang 
Instance details

Defined in GHC.ForeignSrcLang.Type

Associated Types

type Rep ForeignSrcLang :: Type -> Type

Methods

from :: ForeignSrcLang -> Rep ForeignSrcLang x

to :: Rep ForeignSrcLang x -> ForeignSrcLang

Generic Extension 
Instance details

Defined in GHC.LanguageExtensions.Type

Associated Types

type Rep Extension :: Type -> Type

Methods

from :: Extension -> Rep Extension x

to :: Rep Extension x -> Extension

Generic Mode 
Instance details

Defined in Text.PrettyPrint.Annotated.HughesPJ

Associated Types

type Rep Mode :: Type -> Type

Methods

from :: Mode -> Rep Mode x

to :: Rep Mode x -> Mode

Generic Style 
Instance details

Defined in Text.PrettyPrint.Annotated.HughesPJ

Associated Types

type Rep Style :: Type -> Type

Methods

from :: Style -> Rep Style x

to :: Rep Style x -> Style

Generic TextDetails 
Instance details

Defined in Text.PrettyPrint.Annotated.HughesPJ

Associated Types

type Rep TextDetails :: Type -> Type

Methods

from :: TextDetails -> Rep TextDetails x

to :: Rep TextDetails x -> TextDetails

Generic Doc 
Instance details

Defined in Text.PrettyPrint.HughesPJ

Associated Types

type Rep Doc :: Type -> Type

Methods

from :: Doc -> Rep Doc x

to :: Rep Doc x -> Doc

Generic AnnLookup 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep AnnLookup :: Type -> Type

Methods

from :: AnnLookup -> Rep AnnLookup x

to :: Rep AnnLookup x -> AnnLookup

Generic AnnTarget 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep AnnTarget :: Type -> Type

Methods

from :: AnnTarget -> Rep AnnTarget x

to :: Rep AnnTarget x -> AnnTarget

Generic Bang 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Bang :: Type -> Type

Methods

from :: Bang -> Rep Bang x

to :: Rep Bang x -> Bang

Generic Body 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Body :: Type -> Type

Methods

from :: Body -> Rep Body x

to :: Rep Body x -> Body

Generic Callconv 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Callconv :: Type -> Type

Methods

from :: Callconv -> Rep Callconv x

to :: Rep Callconv x -> Callconv

Generic Con 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Con :: Type -> Type

Methods

from :: Con -> Rep Con x

to :: Rep Con x -> Con

Generic DecidedStrictness 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep DecidedStrictness :: Type -> Type

Methods

from :: DecidedStrictness -> Rep DecidedStrictness x

to :: Rep DecidedStrictness x -> DecidedStrictness

Generic DerivClause 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep DerivClause :: Type -> Type

Methods

from :: DerivClause -> Rep DerivClause x

to :: Rep DerivClause x -> DerivClause

Generic DerivStrategy 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep DerivStrategy :: Type -> Type

Methods

from :: DerivStrategy -> Rep DerivStrategy x

to :: Rep DerivStrategy x -> DerivStrategy

Generic FamilyResultSig 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep FamilyResultSig :: Type -> Type

Methods

from :: FamilyResultSig -> Rep FamilyResultSig x

to :: Rep FamilyResultSig x -> FamilyResultSig

Generic Fixity 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Fixity :: Type -> Type

Methods

from :: Fixity -> Rep Fixity x

to :: Rep Fixity x -> Fixity

Generic FixityDirection 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep FixityDirection :: Type -> Type

Methods

from :: FixityDirection -> Rep FixityDirection x

to :: Rep FixityDirection x -> FixityDirection

Generic Foreign 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Foreign :: Type -> Type

Methods

from :: Foreign -> Rep Foreign x

to :: Rep Foreign x -> Foreign

Generic Guard 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Guard :: Type -> Type

Methods

from :: Guard -> Rep Guard x

to :: Rep Guard x -> Guard

Generic Info 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Info :: Type -> Type

Methods

from :: Info -> Rep Info x

to :: Rep Info x -> Info

Generic Inline 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Inline :: Type -> Type

Methods

from :: Inline -> Rep Inline x

to :: Rep Inline x -> Inline

Generic Lit 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Lit :: Type -> Type

Methods

from :: Lit -> Rep Lit x

to :: Rep Lit x -> Lit

Generic Loc 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Loc :: Type -> Type

Methods

from :: Loc -> Rep Loc x

to :: Rep Loc x -> Loc

Generic ModName 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep ModName :: Type -> Type

Methods

from :: ModName -> Rep ModName x

to :: Rep ModName x -> ModName

Generic Module 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Module :: Type -> Type

Methods

from :: Module -> Rep Module x

to :: Rep Module x -> Module

Generic ModuleInfo 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep ModuleInfo :: Type -> Type

Methods

from :: ModuleInfo -> Rep ModuleInfo x

to :: Rep ModuleInfo x -> ModuleInfo

Generic NameFlavour 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep NameFlavour :: Type -> Type

Methods

from :: NameFlavour -> Rep NameFlavour x

to :: Rep NameFlavour x -> NameFlavour

Generic NameSpace 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep NameSpace :: Type -> Type

Methods

from :: NameSpace -> Rep NameSpace x

to :: Rep NameSpace x -> NameSpace

Generic OccName 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep OccName :: Type -> Type

Methods

from :: OccName -> Rep OccName x

to :: Rep OccName x -> OccName

Generic PatSynArgs 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep PatSynArgs :: Type -> Type

Methods

from :: PatSynArgs -> Rep PatSynArgs x

to :: Rep PatSynArgs x -> PatSynArgs

Generic PatSynDir 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep PatSynDir :: Type -> Type

Methods

from :: PatSynDir -> Rep PatSynDir x

to :: Rep PatSynDir x -> PatSynDir

Generic Phases 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Phases :: Type -> Type

Methods

from :: Phases -> Rep Phases x

to :: Rep Phases x -> Phases

Generic PkgName 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep PkgName :: Type -> Type

Methods

from :: PkgName -> Rep PkgName x

to :: Rep PkgName x -> PkgName

Generic Pragma 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Pragma :: Type -> Type

Methods

from :: Pragma -> Rep Pragma x

to :: Rep Pragma x -> Pragma

Generic Range 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Range :: Type -> Type

Methods

from :: Range -> Rep Range x

to :: Rep Range x -> Range

Generic Role 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Role :: Type -> Type

Methods

from :: Role -> Rep Role x

to :: Rep Role x -> Role

Generic RuleBndr 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep RuleBndr :: Type -> Type

Methods

from :: RuleBndr -> Rep RuleBndr x

to :: Rep RuleBndr x -> RuleBndr

Generic RuleMatch 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep RuleMatch :: Type -> Type

Methods

from :: RuleMatch -> Rep RuleMatch x

to :: Rep RuleMatch x -> RuleMatch

Generic Safety 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Safety :: Type -> Type

Methods

from :: Safety -> Rep Safety x

to :: Rep Safety x -> Safety

Generic SourceStrictness 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep SourceStrictness :: Type -> Type

Methods

from :: SourceStrictness -> Rep SourceStrictness x

to :: Rep SourceStrictness x -> SourceStrictness

Generic SourceUnpackedness 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep SourceUnpackedness :: Type -> Type

Methods

from :: SourceUnpackedness -> Rep SourceUnpackedness x

to :: Rep SourceUnpackedness x -> SourceUnpackedness

Generic Stmt 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Stmt :: Type -> Type

Methods

from :: Stmt -> Rep Stmt x

to :: Rep Stmt x -> Stmt

Generic TyLit 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep TyLit :: Type -> Type

Methods

from :: TyLit -> Rep TyLit x

to :: Rep TyLit x -> TyLit

Generic TySynEqn 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep TySynEqn :: Type -> Type

Methods

from :: TySynEqn -> Rep TySynEqn x

to :: Rep TySynEqn x -> TySynEqn

Generic TyVarBndr 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep TyVarBndr :: Type -> Type

Methods

from :: TyVarBndr -> Rep TyVarBndr x

to :: Rep TyVarBndr x -> TyVarBndr

Generic TypeFamilyHead 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep TypeFamilyHead :: Type -> Type

Methods

from :: TypeFamilyHead -> Rep TypeFamilyHead x

to :: Rep TypeFamilyHead x -> TypeFamilyHead

Generic ConstructorInfo 
Instance details

Defined in Language.Haskell.TH.Datatype

Associated Types

type Rep ConstructorInfo :: Type -> Type

Methods

from :: ConstructorInfo -> Rep ConstructorInfo x

to :: Rep ConstructorInfo x -> ConstructorInfo

Generic ConstructorVariant 
Instance details

Defined in Language.Haskell.TH.Datatype

Associated Types

type Rep ConstructorVariant :: Type -> Type

Methods

from :: ConstructorVariant -> Rep ConstructorVariant x

to :: Rep ConstructorVariant x -> ConstructorVariant

Generic DatatypeInfo 
Instance details

Defined in Language.Haskell.TH.Datatype

Associated Types

type Rep DatatypeInfo :: Type -> Type

Methods

from :: DatatypeInfo -> Rep DatatypeInfo x

to :: Rep DatatypeInfo x -> DatatypeInfo

Generic DatatypeVariant 
Instance details

Defined in Language.Haskell.TH.Datatype

Associated Types

type Rep DatatypeVariant :: Type -> Type

Methods

from :: DatatypeVariant -> Rep DatatypeVariant x

to :: Rep DatatypeVariant x -> DatatypeVariant

Generic FieldStrictness 
Instance details

Defined in Language.Haskell.TH.Datatype

Associated Types

type Rep FieldStrictness :: Type -> Type

Methods

from :: FieldStrictness -> Rep FieldStrictness x

to :: Rep FieldStrictness x -> FieldStrictness

Generic Strictness 
Instance details

Defined in Language.Haskell.TH.Datatype

Associated Types

type Rep Strictness :: Type -> Type

Methods

from :: Strictness -> Rep Strictness x

to :: Rep Strictness x -> Strictness

Generic Unpackedness 
Instance details

Defined in Language.Haskell.TH.Datatype

Associated Types

type Rep Unpackedness :: Type -> Type

Methods

from :: Unpackedness -> Rep Unpackedness x

to :: Rep Unpackedness x -> Unpackedness

Generic [a] 
Instance details

Defined in GHC.Generics

Associated Types

type Rep [a] :: Type -> Type

Methods

from :: [a] -> Rep [a] x

to :: Rep [a] x -> [a]

Generic (Maybe a) 
Instance details

Defined in GHC.Generics

Associated Types

type Rep (Maybe a) :: Type -> Type

Methods

from :: Maybe a -> Rep (Maybe a) x

to :: Rep (Maybe a) x -> Maybe a

Generic (Par1 p) 
Instance details

Defined in GHC.Generics

Associated Types

type Rep (Par1 p) :: Type -> Type

Methods

from :: Par1 p -> Rep (Par1 p) x

to :: Rep (Par1 p) x -> Par1 p

Generic (NonEmpty a) 
Instance details

Defined in GHC.Generics

Associated Types

type Rep (NonEmpty a) :: Type -> Type

Methods

from :: NonEmpty a -> Rep (NonEmpty a) x

to :: Rep (NonEmpty a) x -> NonEmpty a

Generic (Down a) 
Instance details

Defined in GHC.Generics

Associated Types

type Rep (Down a) :: Type -> Type

Methods

from :: Down a -> Rep (Down a) x

to :: Rep (Down a) x -> Down a

Generic (ZipList a) 
Instance details

Defined in Control.Applicative

Associated Types

type Rep (ZipList a) :: Type -> Type

Methods

from :: ZipList a -> Rep (ZipList a) x

to :: Rep (ZipList a) x -> ZipList a

Generic (I a) 
Instance details

Defined in Data.SOP.BasicFunctors

Associated Types

type Rep (I a) :: Type -> Type

Methods

from :: I a -> Rep (I a) x

to :: Rep (I a) x -> I a

Generic (Doc a) 
Instance details

Defined in Text.PrettyPrint.Annotated.HughesPJ

Associated Types

type Rep (Doc a) :: Type -> Type

Methods

from :: Doc a -> Rep (Doc a) x

to :: Rep (Doc a) x -> Doc a

Generic (Either a b) 
Instance details

Defined in GHC.Generics

Associated Types

type Rep (Either a b) :: Type -> Type

Methods

from :: Either a b -> Rep (Either a b) x

to :: Rep (Either a b) x -> Either a b

Generic (V1 p) 
Instance details

Defined in GHC.Generics

Associated Types

type Rep (V1 p) :: Type -> Type

Methods

from :: V1 p -> Rep (V1 p) x

to :: Rep (V1 p) x -> V1 p

Generic (U1 p) 
Instance details

Defined in GHC.Generics

Associated Types

type Rep (U1 p) :: Type -> Type

Methods

from :: U1 p -> Rep (U1 p) x

to :: Rep (U1 p) x -> U1 p

Generic (a, b) 
Instance details

Defined in GHC.Generics

Associated Types

type Rep (a, b) :: Type -> Type

Methods

from :: (a, b) -> Rep (a, b) x

to :: Rep (a, b) x -> (a, b)

Generic (Proxy t) 
Instance details

Defined in GHC.Generics

Associated Types

type Rep (Proxy t) :: Type -> Type

Methods

from :: Proxy t -> Rep (Proxy t) x

to :: Rep (Proxy t) x -> Proxy t

Generic (WrappedMonad m a) 
Instance details

Defined in Control.Applicative

Associated Types

type Rep (WrappedMonad m a) :: Type -> Type

Methods

from :: WrappedMonad m a -> Rep (WrappedMonad m a) x

to :: Rep (WrappedMonad m a) x -> WrappedMonad m a

Generic (Rec1 f p) 
Instance details

Defined in GHC.Generics

Associated Types

type Rep (Rec1 f p) :: Type -> Type

Methods

from :: Rec1 f p -> Rep (Rec1 f p) x

to :: Rep (Rec1 f p) x -> Rec1 f p

Generic (URec (Ptr ()) p) 
Instance details

Defined in GHC.Generics

Associated Types

type Rep (URec (Ptr ()) p) :: Type -> Type

Methods

from :: URec (Ptr ()) p -> Rep (URec (Ptr ()) p) x

to :: Rep (URec (Ptr ()) p) x -> URec (Ptr ()) p

Generic (URec Char p) 
Instance details

Defined in GHC.Generics

Associated Types

type Rep (URec Char p) :: Type -> Type

Methods

from :: URec Char p -> Rep (URec Char p) x

to :: Rep (URec Char p) x -> URec Char p

Generic (URec Double p) 
Instance details

Defined in GHC.Generics

Associated Types

type Rep (URec Double p) :: Type -> Type

Methods

from :: URec Double p -> Rep (URec Double p) x

to :: Rep (URec Double p) x -> URec Double p

Generic (URec Float p) 
Instance details

Defined in GHC.Generics

Associated Types

type Rep (URec Float p) :: Type -> Type

Methods

from :: URec Float p -> Rep (URec Float p) x

to :: Rep (URec Float p) x -> URec Float p

Generic (URec Int p) 
Instance details

Defined in GHC.Generics

Associated Types

type Rep (URec Int p) :: Type -> Type

Methods

from :: URec Int p -> Rep (URec Int p) x

to :: Rep (URec Int p) x -> URec Int p

Generic (URec Word p) 
Instance details

Defined in GHC.Generics

Associated Types

type Rep (URec Word p) :: Type -> Type

Methods

from :: URec Word p -> Rep (URec Word p) x

to :: Rep (URec Word p) x -> URec Word p

Generic (a, b, c) 
Instance details

Defined in GHC.Generics

Associated Types

type Rep (a, b, c) :: Type -> Type

Methods

from :: (a, b, c) -> Rep (a, b, c) x

to :: Rep (a, b, c) x -> (a, b, c)

Generic (WrappedArrow a b c) 
Instance details

Defined in Control.Applicative

Associated Types

type Rep (WrappedArrow a b c) :: Type -> Type

Methods

from :: WrappedArrow a b c -> Rep (WrappedArrow a b c) x

to :: Rep (WrappedArrow a b c) x -> WrappedArrow a b c

Generic (K a b) 
Instance details

Defined in Data.SOP.BasicFunctors

Associated Types

type Rep (K a b) :: Type -> Type

Methods

from :: K a b -> Rep (K a b) x

to :: Rep (K a b) x -> K a b

Generic (K1 i c p) 
Instance details

Defined in GHC.Generics

Associated Types

type Rep (K1 i c p) :: Type -> Type

Methods

from :: K1 i c p -> Rep (K1 i c p) x

to :: Rep (K1 i c p) x -> K1 i c p

Generic ((f :+: g) p) 
Instance details

Defined in GHC.Generics

Associated Types

type Rep ((f :+: g) p) :: Type -> Type

Methods

from :: (f :+: g) p -> Rep ((f :+: g) p) x

to :: Rep ((f :+: g) p) x -> (f :+: g) p

Generic ((f :*: g) p) 
Instance details

Defined in GHC.Generics

Associated Types

type Rep ((f :*: g) p) :: Type -> Type

Methods

from :: (f :*: g) p -> Rep ((f :*: g) p) x

to :: Rep ((f :*: g) p) x -> (f :*: g) p

Generic (a, b, c, d) 
Instance details

Defined in GHC.Generics

Associated Types

type Rep (a, b, c, d) :: Type -> Type

Methods

from :: (a, b, c, d) -> Rep (a, b, c, d) x

to :: Rep (a, b, c, d) x -> (a, b, c, d)

Generic (Sum f g a) 
Instance details

Defined in Data.Functor.Sum

Associated Types

type Rep (Sum f g a) :: Type -> Type

Methods

from :: Sum f g a -> Rep (Sum f g a) x

to :: Rep (Sum f g a) x -> Sum f g a

Generic (Product f g a) 
Instance details

Defined in Data.Functor.Product

Associated Types

type Rep (Product f g a) :: Type -> Type

Methods

from :: Product f g a -> Rep (Product f g a) x

to :: Rep (Product f g a) x -> Product f g a

Generic (M1 i c f p) 
Instance details

Defined in GHC.Generics

Associated Types

type Rep (M1 i c f p) :: Type -> Type

Methods

from :: M1 i c f p -> Rep (M1 i c f p) x

to :: Rep (M1 i c f p) x -> M1 i c f p

Generic ((f :.: g) p) 
Instance details

Defined in GHC.Generics

Associated Types

type Rep ((f :.: g) p) :: Type -> Type

Methods

from :: (f :.: g) p -> Rep ((f :.: g) p) x

to :: Rep ((f :.: g) p) x -> (f :.: g) p

Generic (a, b, c, d, e) 
Instance details

Defined in GHC.Generics

Associated Types

type Rep (a, b, c, d, e) :: Type -> Type

Methods

from :: (a, b, c, d, e) -> Rep (a, b, c, d, e) x

to :: Rep (a, b, c, d, e) x -> (a, b, c, d, e)

Generic ((f :.: g) p) 
Instance details

Defined in Data.SOP.BasicFunctors

Associated Types

type Rep ((f :.: g) p) :: Type -> Type

Methods

from :: (f :.: g) p -> Rep ((f :.: g) p) x

to :: Rep ((f :.: g) p) x -> (f :.: g) p

Generic (a, b, c, d, e, f) 
Instance details

Defined in GHC.Generics

Associated Types

type Rep (a, b, c, d, e, f) :: Type -> Type

Methods

from :: (a, b, c, d, e, f) -> Rep (a, b, c, d, e, f) x

to :: Rep (a, b, c, d, e, f) x -> (a, b, c, d, e, f)

Generic (a, b, c, d, e, f, g) 
Instance details

Defined in GHC.Generics

Associated Types

type Rep (a, b, c, d, e, f, g) :: Type -> Type

Methods

from :: (a, b, c, d, e, f, g) -> Rep (a, b, c, d, e, f, g) x

to :: Rep (a, b, c, d, e, f, g) x -> (a, b, c, d, e, f, g)

class Typeable (a :: k) #

Minimal complete definition

typeRep#

data Proxy (t :: k) #

Constructors

Proxy 

Instances

Instances details
Generic1 (Proxy :: k -> Type) 
Instance details

Defined in GHC.Generics

Associated Types

type Rep1 Proxy :: k -> Type

Methods

from1 :: forall (a :: k0). Proxy a -> Rep1 Proxy a

to1 :: forall (a :: k0). Rep1 Proxy a -> Proxy a

Monad (Proxy :: Type -> Type) 
Instance details

Defined in Data.Proxy

Methods

(>>=) :: Proxy a -> (a -> Proxy b) -> Proxy b #

(>>) :: Proxy a -> Proxy b -> Proxy b #

return :: a -> Proxy a #

Functor (Proxy :: Type -> Type) 
Instance details

Defined in Data.Proxy

Methods

fmap :: (a -> b) -> Proxy a -> Proxy b #

(<$) :: a -> Proxy b -> Proxy a #

Applicative (Proxy :: Type -> Type) 
Instance details

Defined in Data.Proxy

Methods

pure :: a -> Proxy a

(<*>) :: Proxy (a -> b) -> Proxy a -> Proxy b

liftA2 :: (a -> b -> c) -> Proxy a -> Proxy b -> Proxy c

(*>) :: Proxy a -> Proxy b -> Proxy b

(<*) :: Proxy a -> Proxy b -> Proxy a

Foldable (Proxy :: Type -> Type) 
Instance details

Defined in Data.Foldable

Methods

fold :: Monoid m => Proxy m -> m

foldMap :: Monoid m => (a -> m) -> Proxy a -> m

foldMap' :: Monoid m => (a -> m) -> Proxy a -> m

foldr :: (a -> b -> b) -> b -> Proxy a -> b

foldr' :: (a -> b -> b) -> b -> Proxy a -> b

foldl :: (b -> a -> b) -> b -> Proxy a -> b

foldl' :: (b -> a -> b) -> b -> Proxy a -> b

foldr1 :: (a -> a -> a) -> Proxy a -> a

foldl1 :: (a -> a -> a) -> Proxy a -> a

toList :: Proxy a -> [a]

null :: Proxy a -> Bool

length :: Proxy a -> Int

elem :: Eq a => a -> Proxy a -> Bool

maximum :: Ord a => Proxy a -> a

minimum :: Ord a => Proxy a -> a

sum :: Num a => Proxy a -> a

product :: Num a => Proxy a -> a

Traversable (Proxy :: Type -> Type) 
Instance details

Defined in Data.Traversable

Methods

traverse :: Applicative f => (a -> f b) -> Proxy a -> f (Proxy b)

sequenceA :: Applicative f => Proxy (f a) -> f (Proxy a)

mapM :: Monad m => (a -> m b) -> Proxy a -> m (Proxy b) #

sequence :: Monad m => Proxy (m a) -> m (Proxy a) #

MonadPlus (Proxy :: Type -> Type) 
Instance details

Defined in Data.Proxy

Methods

mzero :: Proxy a #

mplus :: Proxy a -> Proxy a -> Proxy a #

Alternative (Proxy :: Type -> Type) 
Instance details

Defined in Data.Proxy

Methods

empty :: Proxy a

(<|>) :: Proxy a -> Proxy a -> Proxy a

some :: Proxy a -> Proxy [a]

many :: Proxy a -> Proxy [a]

Bounded (Proxy t) 
Instance details

Defined in Data.Proxy

Methods

minBound :: Proxy t

maxBound :: Proxy t

Enum (Proxy s) 
Instance details

Defined in Data.Proxy

Methods

succ :: Proxy s -> Proxy s

pred :: Proxy s -> Proxy s

toEnum :: Int -> Proxy s

fromEnum :: Proxy s -> Int

enumFrom :: Proxy s -> [Proxy s]

enumFromThen :: Proxy s -> Proxy s -> [Proxy s]

enumFromTo :: Proxy s -> Proxy s -> [Proxy s]

enumFromThenTo :: Proxy s -> Proxy s -> Proxy s -> [Proxy s]

Eq (Proxy s) 
Instance details

Defined in Data.Proxy

Methods

(==) :: Proxy s -> Proxy s -> Bool

(/=) :: Proxy s -> Proxy s -> Bool

Ord (Proxy s) 
Instance details

Defined in Data.Proxy

Methods

compare :: Proxy s -> Proxy s -> Ordering

(<) :: Proxy s -> Proxy s -> Bool

(<=) :: Proxy s -> Proxy s -> Bool

(>) :: Proxy s -> Proxy s -> Bool

(>=) :: Proxy s -> Proxy s -> Bool

max :: Proxy s -> Proxy s -> Proxy s

min :: Proxy s -> Proxy s -> Proxy s

Read (Proxy t) 
Instance details

Defined in Data.Proxy

Methods

readsPrec :: Int -> ReadS (Proxy t) #

readList :: ReadS [Proxy t] #

readPrec :: ReadPrec (Proxy t) #

readListPrec :: ReadPrec [Proxy t] #

Show (Proxy s) 
Instance details

Defined in Data.Proxy

Methods

showsPrec :: Int -> Proxy s -> ShowS

show :: Proxy s -> String

showList :: [Proxy s] -> ShowS

Ix (Proxy s) 
Instance details

Defined in Data.Proxy

Methods

range :: (Proxy s, Proxy s) -> [Proxy s]

index :: (Proxy s, Proxy s) -> Proxy s -> Int

unsafeIndex :: (Proxy s, Proxy s) -> Proxy s -> Int

inRange :: (Proxy s, Proxy s) -> Proxy s -> Bool

rangeSize :: (Proxy s, Proxy s) -> Int

unsafeRangeSize :: (Proxy s, Proxy s) -> Int

Generic (Proxy t) 
Instance details

Defined in GHC.Generics

Associated Types

type Rep (Proxy t) :: Type -> Type

Methods

from :: Proxy t -> Rep (Proxy t) x

to :: Rep (Proxy t) x -> Proxy t

Semigroup (Proxy s) 
Instance details

Defined in Data.Proxy

Methods

(<>) :: Proxy s -> Proxy s -> Proxy s #

sconcat :: NonEmpty (Proxy s) -> Proxy s #

stimes :: Integral b => b -> Proxy s -> Proxy s #

Monoid (Proxy s) 
Instance details

Defined in Data.Proxy

Methods

mempty :: Proxy s #

mappend :: Proxy s -> Proxy s -> Proxy s #

mconcat :: [Proxy s] -> Proxy s #

type Rep1 (Proxy :: k -> Type) 
Instance details

Defined in GHC.Generics

type Rep1 (Proxy :: k -> Type) = D1 ('MetaData "Proxy" "Data.Proxy" "base" 'False) (C1 ('MetaCons "Proxy" 'PrefixI 'False) (U1 :: k -> Type))
type Rep (Proxy t) 
Instance details

Defined in GHC.Generics

type Rep (Proxy t) = D1 ('MetaData "Proxy" "Data.Proxy" "base" 'False) (C1 ('MetaCons "Proxy" 'PrefixI 'False) (U1 :: Type -> Type))
type Code (Proxy t) 
Instance details

Defined in Generics.SOP.Instances

type Code (Proxy t) = '['[] :: [Type]]
type DatatypeInfoOf (Proxy t) 
Instance details

Defined in Generics.SOP.Instances

type DatatypeInfoOf (Proxy t) = 'ADT "Data.Proxy" "Proxy" '['Constructor "Proxy"] '['[] :: [StrictnessInfo]]