HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Modulecmdargs-0.10.22Haskell2010

System.Console.CmdArgs.Implicit

This module provides simple command line argument processing. The main function of interest is cmdArgs. A simple example is:

data Sample = Sample {hello :: String} deriving (Show, Data, Typeable)
sample = Sample{hello = def &= help "World argument" &= opt "world"}
         &= summary "Sample v1"
main = print =<< cmdArgs sample

Attributes are used to control a number of behaviours:

Supported Types: Each field in the record must be one of the supported atomic types (String, Int, Integer, Float, Double, Bool, an enumeration, a tuple of atomic types) or a list ([]) or Maybe wrapping at atomic type.

Missing Fields: If a field is shared by multiple modes, it may be omitted in subsequent modes, and will default to the previous value.

Purity: Values created with annotations are not pure - the first time they are computed they will include the annotations, but subsequently they will not. If you wish to run the above example in a more robust way:

sample = cmdArgsMode $ Sample{hello = ... -- as before
main = print =<< cmdArgsRun sample

Even using this scheme, sometimes GHC's optimisations may share values who have the same annotation. To disable sharing you may need to specify {-# OPTIONS_GHC -fno-cse #-} in the module you define the flags.

Pure annotations: Alternatively, you may use pure annotations, which are referentially transparent, but less type safe and more verbose. The initial example may be written as:

sample = record Sample{} [hello := def += help "World argument" += opt "world"] += summary "Sample v1"

main = print =<< (cmdArgs_ sample :: IO Sample)

All the examples are written using impure annotations. To convert to pure annotations follow the rules:

Ctor {field1 = value1 &= ann1, field2 = value2} &= ann2 ==> record Ctor{} [field1 := value1 += ann1, field2 := value2] += ann2
Ctor (value1 &= ann1) value2 &= ann2 ==> record Ctor{} [atom value1 += ann1, atom value2] += ann2
modes [Ctor1{...}, Ctor2{...}] ==> modes_ [record Ctor1{} [...], record Ctor2{} [...]]
Ctor {field1 = enum [X &= ann, Y]} ==> record Ctor{} [enum_ field1 [atom X += ann, atom Y]]

If you are willing to use TemplateHaskell, you can write in the impure syntax, but have your code automatically translated to the pure style. For more details see System.Console.CmdArgs.Quote.

  • 4 types
  • 2 classes
  • 34 values
  • Packagecmdargs-0.10.22
  • Exports40
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceImplicit.hs

Running command lines

7 declarations
valuecmdArgsMode :: Data a => a -> Mode (CmdArgs a)
#

Take impurely annotated records and turn them in to a Mode value, that can make use of the System.Console.CmdArgs.Explicit functions (i.e. process).

Annotated records are impure, and will only contain annotations on their first use. The result of this function is pure, and can be reused.

valuecmdArgsRun :: Mode (CmdArgs a) -> IO a
#

Run a Mode structure. This function reads the command line arguments and then performs as follows:

  • If invalid arguments are given, it will display the error message and exit.

  • If --help is given, it will display the help message and exit.

  • If --version is given, it will display the version and exit.

  • In all other circumstances the program will return a value.

  • Additionally, if either --quiet or --verbose is given (see verbosity) it will set the verbosity (see setVerbosity).

datadata CmdArgs a
#

A structure to store the additional data relating to --help, --version, --quiet and --verbose.

Constructors

Instances5Functor, Eq, Data, Ord, Show
  • Functor CmdArgsDefined in cmdargs-0.10.22 · System.Console.CmdArgs.Implicit.Type
  • Eq a => Eq (CmdArgs a)Defined in cmdargs-0.10.22 · System.Console.CmdArgs.Implicit.Type
  • Data a => Data (CmdArgs a)Defined in cmdargs-0.10.22 · System.Console.CmdArgs.Implicit.Type
  • Ord a => Ord (CmdArgs a)Defined in cmdargs-0.10.22 · System.Console.CmdArgs.Implicit.Type
  • Show a => Show (CmdArgs a)Defined in cmdargs-0.10.22 · System.Console.CmdArgs.Implicit.Type

Constructing command lines

20 declarations

Attributes can work on a flag (inside a field), on a mode (outside the record), or on all modes (outside the modes call).

valueopt :: (Show a, Typeable a) => a -> Ann
#

Flag: "I want users to be able to omit the value associated with this flag."

Make the value of a flag optional. If --flag is given, it will be treated as --flag=this_argument.

{hello = def &= opt "foo"}
  -h --hello[=VALUE]    (default=foo)

Note that all flags in CmdArgs are optional, and if omitted will use their default value. Those annotated with opt also allow the flag to be present without an associated value. As an example:

{hello = "DEFAULT" &= opt "OPTIONAL"}
$ main
{hello = "DEFAULT"}
$ main --hello
{hello = "OPTIONAL"}
$ main --hello=VALUE
{hello = "VALUE"}
valueargs :: Ann
#

Flag: "Put non-flag arguments here."

All argument flags not captured by argPos are returned by args.

{hello = def &= args}
valuename :: String -> Ann
#

Flag: "Use this flag name for this field."

Add flags which trigger this option.

{hello = def &= name "foo"}
  -h --hello --foo=VALUE
valuehelp :: String -> Ann
#

Flag/Mode: "The help message is ..."

Descriptive text used in the help output.

{hello = def &= help "Help message"}
  -h --hello=VALUE      Help message
valuetyp :: String -> Ann
#

Flag: "For this flag, users need to give something of type ..."

The the type of a flag's value, usually upper case. Only used for the help message. Commonly the type will be FILE (typFile) or DIR (typDir).

{hello = def &= typ "MESSAGE"}
  -h --hello=MESSAGE
valuetypFile :: Ann
#

Flag: "Users must give a file for this flag's value."

Alias for typ FILE.

valuetypDir :: Ann
#

Flag: "Users must give a directory for this flag's value."

Alias for typ DIR.

valueargPos :: Int -> Ann
#

Flag: "Put the nth non-flag argument here."

This field should be used to store a particular argument position (0-based).

{hello = def &= argPos 0}
valuegroupname :: String -> Ann
#

Flag/Mode: "Give these flags/modes a group name in the help output."

This mode will be used for all following modes/flags, until the next groupname.

{hello = def &= groupname "Welcomes"}
Welcomes
  -h --hello=VALUE
valuedetails :: [String] -> Ann
#

Mode: "A longer description of this mode is ..."

Suffix to be added to the help message.

Sample{..} &= details ["More details on the website www.example.org"]
valuesummary :: String -> Ann
#

Modes: "My program name/version/copyright is ..."

One line summary of the entire program, the first line of --help and the only line of --version. If the string contains a version number component will also provide --numeric-version.

Sample{..} &= summary "CmdArgs v0.0, (C) Neil Mitchell 1981"
valueauto :: Ann
#

Mode: "If the user doesn't give a mode, use this one."

This mode is the default. If no mode is specified and a mode has this attribute then that mode is selected, otherwise an error is raised.

modes [Mode1{..}, Mode2{..} &= auto, Mode3{..}]
valueprogram :: String -> Ann
#

Modes: "My program executable is named ..."

This is the name of the program executable. Only used in the help message. Defaults to the type of the mode.

Sample{..} &= program "sample"
valueexplicit :: Ann
#

Flag: "Don't guess any names for this field."

A field should not have any flag names guessed for it. All flag names must be specified by flag.

{hello = def &= explicit &= name "foo"}
  --foo=VALUE
valueignore :: Ann
#

Flag/Mode: "Ignore this field, don't let the user set it."

A mode or field is not dealt with by CmdArgs.

{hello = def, extra = def &= ignore}
  --hello=VALUE
valueverbosity :: Ann
#

Modes: "My program needs verbosity flags."

Add --verbose and --quiet flags.

valuehelpArg :: [Ann] -> Ann
#

Modes: "Customise the help argument."

Add extra options to a help argument, such as help, name, ignore or explicit.

Sample{..} &= helpArg [explicit, name "h"]
valueverbosityArgs :: [Ann] -> [Ann] -> Ann
#

Modes: "Customise the verbosity arguments."

Add extra options to a verbosity arguments (--verbose and --quiet), such as help, name, ignore or explicit. The verbose options come first, followed by the quiet options.

Sample{..} &= verbosityArgs [ignore] [name "silent", explicit]
valuenoAtExpand :: Ann
#

Program: "Turn off @ expansion."

Usually arguments starting with @ are treated as a file containing a set of arguments. This annotation turns off that behaviour.

Sample{..} &= noAtExpand

Impure

value(&=) :: Data val => val -> Ann -> val
#

Add an annotation to a value. Note that if the value is evaluated more than once the annotation will only be available the first time.

valuemodes :: Data val => [val] -> val
#

Modes: "I want a program with multiple modes, like darcs or cabal."

Takes a list of modes, and creates a mode which includes them all. If you want one of the modes to be chosen by default, see auto.

data Modes = Mode1 | Mode2 | Mode3 deriving Data
cmdArgs $ modes [Mode1,Mode2,Mode3]
valueenum :: Data val => [val] -> val
#

Flag: "I want several different flags to set this one field to different values."

This annotation takes a type which is an enumeration, and provides multiple separate flags to set the field to each value. The first element in the list is used as the value of the field.

data State = On | Off deriving Data
data Mode = Mode {state :: State}
cmdArgs $ Mode {state = enum [On &= help "Turn on",Off &= help "Turn off"]}
  --on   Turn on
  --off  Turn off

This annotation can be used to allow multiple flags within a field:

data Mode = Mode {state :: [State]}
cmdArgs $ Mode {state = enum [[] &= ignore, [On] &= help "Turn on", [Off] &= help "Turn off"]}

Now --on --off would produce Mode [On,Off].

Pure

valuerecord :: Data a => a -> [Annotate ann] -> Annotate ann
#

Create a constructor/record. The first argument should be the type of field, the second should be a list of fields constructed originally defined by := or :=+.

This operation is not type safe, and may raise an exception at runtime if any field has the wrong type or label.

valueatom :: Data val => val -> Annotate ann
#

Lift a pure value to an annotation.

datadata Annotate ann
#

This type represents an annotated value. The type of the underlying value is not specified.

Constructors

  • forall c f. (Data c, Data f) => (c -> f) := finfix 3

    Construct a field, fieldname := value.

Re-exported for convenience

4 declarations

Provides a few opaque types (for writing type signatures), verbosity control, default values with def and the Data/Typeable type classes.

datadata Ann
#

The general type of annotations that can be associated with a value.

Instances4Eq, Data, Ord, Show
  • Eq AnnDefined in cmdargs-0.10.22 · System.Console.CmdArgs.Implicit.Ann
  • Data AnnDefined in cmdargs-0.10.22 · System.Console.CmdArgs.Implicit.Ann
  • Ord AnnDefined in cmdargs-0.10.22 · System.Console.CmdArgs.Implicit.Ann
  • Show AnnDefined in cmdargs-0.10.22 · System.Console.CmdArgs.Implicit.Ann
datadata Mode a
#

A mode. Do not use the Mode constructor directly, instead use mode to construct the Mode and then record updates. Each mode has three main features:

To produce the help information for a mode, either use helpText or show.

Instances3Remap, Show, Packer
  • Remap ModeDefined in cmdargs-0.10.22 · System.Console.CmdArgs.Explicit.Type
  • Show (Mode a)Defined in cmdargs-0.10.22 · System.Console.CmdArgs.Explicit.Help · orphan
  • Packer a => Packer (Mode a)Defined in cmdargs-0.10.22 · System.Console.CmdArgs.Helper
classclass Typeable a => Data a where
#

The Data class comprehends a fundamental primitive gfoldl for folding over constructor applications, say terms. This primitive can be instantiated in several ways to map over the immediate subterms of a term; see the gmap combinators later in this class. Indeed, a generic programmer does not necessarily need to use the ingenious gfoldl primitive but rather the intuitive gmap combinators. The gfoldl primitive is completed by means to query top-level constructors, to turn constructor representations into proper terms, and to list all possible datatype constructors. This completion allows us to serve generic programming scenarios like read, show, equality, term generation.

The combinators gmapT, gmapQ, gmapM, etc are all provided with default definitions in terms of gfoldl, leaving open the opportunity to provide datatype-specific definitions. (The inclusion of the gmap combinators as members of class Data allows the programmer or the compiler to derive specialised, and maybe more efficient code per datatype. Note: gfoldl is more higher-order than the gmap combinators. This is subject to ongoing benchmarking experiments. It might turn out that the gmap combinators will be moved out of the class Data.)

Conceptually, the definition of the gmap combinators in terms of the primitive gfoldl requires the identification of the gfoldl function arguments. Technically, we also need to identify the type constructor c for the construction of the result type from the folded term type.

In the definition of gmapQx combinators, we use phantom type constructors for the c in the type of gfoldl because the result type of a query does not involve the (polymorphic) type of the term argument. In the definition of gmapQl we simply use the plain constant type constructor because gfoldl is left-associative anyway and so it is readily suited to fold a left-associative binary operation over the immediate subterms. In the definition of gmapQr, extra effort is needed. We use a higher-order accumulation trick to mediate between left-associative constructor application vs. right-associative binary operation (e.g., (:)). When the query is meant to compute a value of type r, then the result type within generic folding is r -> r. So the result of folding is a function to which we finally pass the right unit.

With the -XDeriveDataTypeable option, GHC can generate instances of the Data class automatically. For example, given the declaration

data T a b = C1 a b | C2 deriving (Typeable, Data)

GHC will generate an instance that is equivalent to

instance (Data a, Data b) => Data (T a b) where
    gfoldl k z (C1 a b) = z C1 `k` a `k` b
    gfoldl k z C2       = z C2

    gunfold k z c = case constrIndex c of
                        1 -> k (k (z C1))
                        2 -> z C2

    toConstr (C1 _ _) = con_C1
    toConstr C2       = con_C2

    dataTypeOf _ = ty_T

con_C1 = mkConstr ty_T "C1" [] Prefix
con_C2 = mkConstr ty_T "C2" [] Prefix
ty_T   = mkDataType "Module.T" [con_C1, con_C2]

This is suitable for datatypes that are exported transparently.

Instances166Data, …
  • Data ByteArrayDefined in base-4.20.2.0 · Data.Array.Byte
  • Data ByteStringDefined in bytestring-0.12.2.0 · Data.ByteString.Internal.Type
  • Data ByteStringDefined in bytestring-0.12.2.0 · Data.ByteString.Lazy.Internal
  • Data ShortByteStringDefined in bytestring-0.12.2.0 · Data.ByteString.Short.Internal
  • Data AnnDefined in cmdargs-0.10.22 · System.Console.CmdArgs.Implicit.Ann
  • Data CmdArgsPrivateDefined in cmdargs-0.10.22 · System.Console.CmdArgs.Implicit.Type
  • Data VerbosityDefined in cmdargs-0.10.22 · System.Console.CmdArgs.Verbosity
  • Data IntegerDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • Data NaturalDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • Data VoidDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • Data AllDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • Data AnyDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • Data VersionDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • Data SpecConstrAnnotationDefined in ghc-internal-9.1003.0 · GHC.Internal.Exts
  • Data IntPtrDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • Data WordPtrDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • Data AssociativityDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • Data DecidedStrictnessDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • Data FixityDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • Data SourceStrictnessDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • Data SourceUnpackednessDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • Data Int16Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • Data Int32Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • Data Int64Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • Data Int8Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • Data Word16Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • Data Word32Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • Data Word64Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • Data Word8Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • Data BoolDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • Data CharDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • Data DoubleDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • Data FloatDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • Data IntDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • Data OrderingDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • Data WordDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • Data AnnLookupDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Data AnnTargetDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Data BangDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Data BndrVisDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Data BodyDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Data BytesDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Data CallconvDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Data ClauseDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Data ConDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Data DecDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Data DecidedStrictnessDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Data DerivClauseDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Data DerivStrategyDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Data DocLocDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Data ExpDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Data FamilyResultSigDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Data FixityDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Data FixityDirectionDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Data ForeignDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Data FunDepDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Data GuardDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Data InfoDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Data InjectivityAnnDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Data InlineDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Data LitDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Data LocDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Data MatchDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Data ModNameDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Data ModuleDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Data ModuleInfoDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Data NameDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Data NameFlavourDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Data NameSpaceDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Data NamespaceSpecifierDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Data OccNameDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Data OverlapDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Data PatDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Data PatSynArgsDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Data PatSynDirDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Data PhasesDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Data PkgNameDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Data PragmaDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Data RangeDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Data RoleDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Data RuleBndrDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Data RuleMatchDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Data SafetyDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Data SourceStrictnessDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Data SourceUnpackednessDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Data SpecificityDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Data StmtDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Data TyLitDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Data TySynEqnDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Data TypeDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Data TypeFamilyHeadDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Data CalendarDiffDaysDefined in time-1.12.2 · Data.Time.Calendar.CalendarDiffDays
  • Data DayDefined in time-1.12.2 · Data.Time.Calendar.Days
  • Data MonthDefined in time-1.12.2 · Data.Time.Calendar.Month
  • Data QuarterDefined in time-1.12.2 · Data.Time.Calendar.Quarter
  • Data QuarterOfYearDefined in time-1.12.2 · Data.Time.Calendar.Quarter
  • Data DayOfWeekDefined in time-1.12.2 · Data.Time.Calendar.Week
  • Data AbsoluteTimeDefined in time-1.12.2 · Data.Time.Clock.Internal.AbsoluteTime
  • Data DiffTimeDefined in time-1.12.2 · Data.Time.Clock.Internal.DiffTime
  • Data NominalDiffTimeDefined in time-1.12.2 · Data.Time.Clock.Internal.NominalDiffTime
  • Data SystemTimeDefined in time-1.12.2 · Data.Time.Clock.Internal.SystemTime
  • Data UTCTimeDefined in time-1.12.2 · Data.Time.Clock.Internal.UTCTime
  • Data UniversalTimeDefined in time-1.12.2 · Data.Time.Clock.Internal.UniversalTime
  • Data CalendarDiffTimeDefined in time-1.12.2 · Data.Time.LocalTime.Internal.CalendarDiffTime
  • Data LocalTimeDefined in time-1.12.2 · Data.Time.LocalTime.Internal.LocalTime
  • Data TimeOfDayDefined in time-1.12.2 · Data.Time.LocalTime.Internal.TimeOfDay
  • Data TimeZoneDefined in time-1.12.2 · Data.Time.LocalTime.Internal.TimeZone
  • Data ZonedTimeDefined in time-1.12.2 · Data.Time.LocalTime.Internal.ZonedTime
  • Data ()Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • Data a => Data (Complex a)Defined in base-4.20.2.0 · Data.Complex
  • Data a => Data (First a)Defined in base-4.20.2.0 · Data.Semigroup
  • Data a => Data (Last a)Defined in base-4.20.2.0 · Data.Semigroup
  • Data a => Data (Max a)Defined in base-4.20.2.0 · Data.Semigroup
  • Data a => Data (Min a)Defined in base-4.20.2.0 · Data.Semigroup
  • Data a => Data (CmdArgs a)Defined in cmdargs-0.10.22 · System.Console.CmdArgs.Implicit.Type
  • Data a => Data (NonEmpty a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • Data a => Data (Identity a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • Data a => Data (First a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • Data a => Data (Last a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • Data a => Data (Down a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • Data a => Data (Dual a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • Data a => Data (Product a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • Data a => Data (Sum a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • Data a => Data (ConstPtr a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • Data a => Data (ForeignPtr a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • Data a => Data (ZipList a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Functor.ZipList
  • Data a => Data (Maybe a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • Data a => Data (Ptr a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • Data a => Data (a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • Data a => Data [a]Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data

    For historical reasons, the constructor name used for (:) is "(:)". In a derived instance, it would be ":".

  • Data flag => Data (TyVarBndr flag)Defined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Data m => Data (WrappedMonoid m)Defined in base-4.20.2.0 · Data.Semigroup
  • Data p => Data (Par1 p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • Typeable s => Data (MutableByteArray s)Defined in base-4.20.2.0 · Data.Array.Byte
  • (Data a, Integral a) => Data (Ratio a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • Data p => Data (U1 p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • Data p => Data (V1 p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • Data t => Data (Proxy t)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • (Data a, Data b) => Data (Arg a b)Defined in base-4.20.2.0 · Data.Semigroup
  • (Data a, Data b) => Data (Either a b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • (Data a, Data b) => Data (a, b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • (Data a, Data b, Ix a) => Data (Array a b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • (Typeable k, Typeable a) => Data (Fixed a)Defined in base-4.20.2.0 · Data.Fixed
  • (Typeable m, Typeable a, Data (m a)) => Data (WrappedMonad m a)Defined in base-4.20.2.0 · Control.Applicative
  • (Data (f a), Data a, Typeable f) => Data (Ap f a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • (Data (f a), Data a, Typeable f) => Data (Alt f a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • (Data (f p), Typeable f, Data p) => Data (Rec1 f p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • (Data a, Data b, Data c) => Data (a, b, c)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • (Typeable a, Typeable b, Typeable c, Data (a b c)) => Data (WrappedArrow a b c)Defined in base-4.20.2.0 · Control.Applicative
  • (Typeable b, Typeable k, Data a) => Data (Constant a b)Defined in transformers-0.6.1.1 · Data.Functor.Constant
  • (Typeable k, Data a, Typeable b) => Data (Const a b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • (Coercible a b, Data a, Data b) => Data (Coercion a b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • (a ~ b, Data a) => Data (a :~: b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • (Data a, Data b, Data c, Data d) => Data (a, b, c, d)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • (Typeable a, Typeable f, Typeable g, Typeable k, Data (f a), Data (g a)) => Data (Product f g a)Defined in base-4.20.2.0 · Data.Functor.Product
  • (Typeable a, Typeable f, Typeable g, Typeable k, Data (f a), Data (g a)) => Data (Sum f g a)Defined in base-4.20.2.0 · Data.Functor.Sum
  • (Typeable f, Typeable g, Data p, Data (f p), Data (g p)) => Data ((:*:) f g p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • (Typeable f, Typeable g, Data p, Data (f p), Data (g p)) => Data ((:+:) f g p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • (Typeable i, Data p, Data c) => Data (K1 i c p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • (Typeable i, Typeable j, Typeable a, Typeable b, a ~~ b) => Data (a :~~: b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • (Data a, Data b, Data c, Data d, Data e) => Data (a, b, c, d, e)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • (Data p, Data (f p), Typeable c, Typeable i, Typeable f) => Data (M1 i c f p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • (Typeable a, Typeable f, Typeable g, Typeable k1, Typeable k2, Data (f (g a))) => Data (Compose f g a)Defined in base-4.20.2.0 · Data.Functor.Compose
  • (Typeable f, Typeable g, Data p, Data (f (g p))) => Data ((:.:) f g p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • (Data a, Data b, Data c, Data d, Data e, Data f) => Data (a, b, c, d, e, f)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • (Data a, Data b, Data c, Data d, Data e, Data f, Data g) => Data (a, b, c, d, e, f, g)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
classclass Typeable (a :: k) where
#

The class Typeable allows a concrete representation of a type to be calculated.