optparse-generic-1.4.9: Auto-generate a command-line parser for your datatype
Safe HaskellSafe-Inferred
LanguageHaskell2010

Options.Generic

Description

This library auto-generates command-line parsers for data types using Haskell's built-in support for generic programming. The best way to understand how this library works is to walk through a few examples.

For example, suppose that you want to parse a record with named fields like this:

-- Example.hs

{-# LANGUAGE DeriveGeneric     #-}
{-# LANGUAGE OverloadedStrings #-}

import Options.Generic

data Example = Example { foo :: Int, bar :: Double }
    deriving (Generic, Show)

instance ParseRecord Example

main = do
    x <- getRecord "Test program"
    print (x :: Example)

Named fields translate to flags which you can provide in any order:

$ stack build optparse-generic
$ stack runghc Example.hs -- --bar 2.5 --foo 1
Example {foo = 1, bar = 2.5}

This also auto-generates --help output:

$ stack runghc Example.hs -- --help
Test program

Usage: Example.hs --foo INT --bar DOUBLE

Available options:
  -h,--help                Show this help text

You can also add help descriptions to each field, like this:

{-# LANGUAGE DataKinds         #-}
{-# LANGUAGE DeriveGeneric     #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TypeOperators     #-}

import Options.Generic

data Example = Example
    { foo :: Int    <?> "Documentation for the foo flag"
    , bar :: Double <?> "Documentation for the bar flag"
    } deriving (Generic, Show)

instance ParseRecord Example

main = do
    x <- getRecord "Test program"
    print (x :: Example)

... which produces the following --help output:

$ stack runghc Example.hs -- --help
Test program

Usage: Example.hs --foo INT --bar DOUBLE

Available options:
  -h,--help                Show this help text
  --foo INT                Documentation for the foo flag
  --bar DOUBLE             Documentation for the bar flag

However, any fields you document will be wrapped in the Helpful constructor:

$ stack runghc Example.hs -- --foo 1 --bar 2.5
Example {foo = Helpful {unHelpful = 1}, bar = Helpful {unHelpful = 2.5}}

To avoid this, while still being able to document your fields, you may generalize the definition of your record with a parameter w, and use unwrapRecord.

{-# LANGUAGE DataKinds          #-}
{-# LANGUAGE DeriveGeneric      #-}
{-# LANGUAGE FlexibleInstances  #-}  -- One more extension.
{-# LANGUAGE OverloadedStrings  #-}
{-# LANGUAGE StandaloneDeriving #-}  -- To derive Show
{-# LANGUAGE TypeOperators      #-}

import Options.Generic

data Example w = Example
    { foo :: w ::: Int    <?> "Documentation for the foo flag"
    , bar :: w ::: Double <?> "Documentation for the bar flag"
    } deriving (Generic)

instance ParseRecord (Example Wrapped)
deriving instance Show (Example Unwrapped)

main = do
    x <- unwrapRecord "Test program"
    print (x :: Example Unwrapped)

Example Unwrapped is equivalent to a record type with simple fields:

$ stack runghc Example.hs -- --foo 1 --bar 2.5
Example {foo = 1, bar = 2.5}

You can also add default values to each Readable field, like this:

{-# LANGUAGE DataKinds         #-}
{-# LANGUAGE DeriveGeneric     #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TypeOperators     #-}

import Options.Generic

data Example = Example
    { foo :: Int    <!> "1"
    , bar :: String <!> "hello"
    } deriving (Generic, Show)

instance ParseRecord Example

main = do
    x <- getRecord "Test program"
    print (x :: Example)

Default values will work alongside help descriptions and unwrapping.

For the following examples I encourage you to test what --help output they generate.

This library will also do the right thing if the fields have no labels:

data Example = Example Int Double deriving (Generic, Show)

Fields without labels translate into positional command-line arguments:

$ stack runghc Example.hs -- 1 2.5
Example 1 2.5

Certain types of fields are given special treatment, such as in this example:

data Example = Example
    { switch   :: Bool
    , list     :: [Int]
    , optional :: Maybe   Int
    , first    :: First   Int
    , last     :: Last    Int
    , sum      :: Sum     Int
    , product  :: Product Int
    } deriving (Generic, Show)

This gives the following behavior:

$ stack runghc Example.hs --
      --switch
      --optional 1
      --list    1 --list    2
      --first   1 --first   2
      --last    1 --last    2
      --sum     1 --sum     2
      --product 1 --product 2
Example {switch = True, list = [1,2], optional = Just 1, first = First 
{getFirst = Just 1}, last = Last {getLast = Just 2}, sum = Sum {getSum =
3}, product = Product {getProduct = 2}}

$ stack runghc Example.hs
Example {switch = False, list = [], optional = Nothing, first = First
{getFirst = Nothing}, second = Last {getLast = Nothing}, sum = Sum {getSum
= 0}, product = Product {getProduct = 1}}

If a datatype has multiple constructors:

data Example
    = Create { name :: Text, duration :: Maybe Int }
    | Kill   { name :: Text }
    deriving (Generic, Show)

... then they will translate into subcommands named after each constructor:

$ stack runghc Example.hs -- create --name foo --duration=60
Create {name = "foo", duration = Just 60}
$ stack runghc Example.hs -- kill --name foo
Kill {name = "foo"}

This library also provides out-of-the-box support for many existing types, like tuples and Either.

{-# LANGUAGE DeriveGeneric     #-}
{-# LANGUAGE OverloadedStrings #-}

import Options.Generic

main = do
    x <- getRecord "Test program"
    print (x :: Either Double Int)
$ stack runghc Example.hs -- left 1.0
Left 1.0
$ stack runghc Example.hs -- right 2
Right 2
main = do
    x <- getRecord "Test program"
    print (x :: (Double, Int))
$ stack runghc Example.hs -- 1.0 2
(1.0,2)

... and you can also just parse a single value:

main = do
    x <- getRecord "Test program"
    print (x :: Int)
$ stack runghc Example.hs -- 2
2

However, there are some types that this library cannot generate sensible command-line parsers for, such as:

  • recursive types:

    data Example = Example { foo :: Example }
  • records whose fields are other records

    data Outer = Outer { foo :: Inner } deriving (Show, Generic)
    data Inner = Inner { bar :: Int   } deriving (Show, Generic)
  • record fields with nested Maybes or nested lists

    data Example = Example { foo :: Maybe (Maybe Int) }
    data Example = Example { foo :: [[Int]]           }

If you try to auto-generate a parser for these types you will get an error at compile time that will look something like this:

    No instance for (ParseFields TheTypeOfYourField)
      arising from a use of ‘Options.Generic.$gdmparseRecord’
    In the expression: Options.Generic.$gdmparseRecord
    In an equation for ‘parseRecord’:
        parseRecord = Options.Generic.$gdmparseRecord
    In the instance declaration for ‘ParseRecord TheTypeOfYourRecord’

You can customize the library's default behavior using the parseRecordWithModifiers utility, like this:

{-# LANGUAGE DeriveGeneric     #-}
{-# LANGUAGE OverloadedStrings #-}

import Options.Generic

data Example = Example { foo :: Int, bar :: Double }
    deriving (Generic, Show)

modifiers :: Modifiers
modifiers = defaultModifiers
    { shortNameModifier = firstLetter
    }

instance ParseRecord Example where
    parseRecord = parseRecordWithModifiers modifiers

main = do
    x <- getRecord "Test program"
    print (x :: Example)
Synopsis

Parsers

getRecord Source #

Arguments

:: (MonadIO io, ParseRecord a) 
=> Text

Program description

-> io a 

Marshal any value that implements ParseRecord from the command line

If you need to modify the top-level ParserInfo or ParserPrefs use the getRecordWith function.

getRecordWith Source #

Arguments

:: (MonadIO io, ParseRecord a) 
=> InfoMod a

ParserInfo modifiers

-> PrefsMod

ParserPrefs modifiers

-> io a 

Marshal any value that implements ParseRecord from the command line

This is the lower-level sibling of 'getRecord and lets you modify the ParserInfo and ParserPrefs records.

getWithHelpWith Source #

Arguments

:: (MonadIO io, ParseRecord a) 
=> Text

Program description

-> PrefsMod

ParserPrefs modifiers

-> io (a, io ())

(options, io action to print help message)

Marshal any value that implements ParseRecord from the commmand line alongside an io action that prints the help message.

getWithHelp Source #

Arguments

:: (MonadIO io, ParseRecord a) 
=> Text

Program description

-> io (a, io ())

(options, io action to print help message)

Marshal any value that implements ParseRecord from the commmand line alongside an io action that prints the help message.

getRecordPure Source #

Arguments

:: ParseRecord a 
=> [Text]

Command-line arguments

-> Maybe a 

Pure version of getRecord

If you need to modify the parser's ParserInfo or ParserPrefs, use getRecordPureWith.

>>> :set -XOverloadedStrings
>>> getRecordPure ["1"] :: Maybe Int
Just 1
>>> getRecordPure ["1", "2"] :: Maybe [Int]
Just [1,2]
>>> getRecordPure ["Foo"] :: Maybe Int
Nothing

getRecordPureWith Source #

Arguments

:: ParseRecord a 
=> [Text]

Command-line arguments

-> InfoMod a

ParserInfo modifiers

-> PrefsMod

ParserPrefs modifiers

-> Maybe a 

Pure version of getRecordWith

Like getRecordWith, this is a sibling of 'getRecordPure and exposes the monoidal modifier structures for ParserInfo and ParserPrefs to you.

>>> :set -XOverloadedStrings
>>> getRecordPureWith ["1"] mempty mempty :: Maybe Int
Just 1
>>> getRecordPureWith ["1", "2"] mempty mempty :: Maybe [Int]
Just [1,2]
>>> getRecordPureWith ["Foo"] mempty mempty :: Maybe Int
Nothing

unwrapRecord :: (Functor io, MonadIO io, ParseRecord (f Wrapped), Unwrappable f) => Text -> io (f Unwrapped) Source #

Marshal any value that implements ParseRecord from the command line and unwrap its fields

unwrapWithHelp Source #

Arguments

:: (MonadIO io, ParseRecord (f Wrapped), Unwrappable f) 
=> Text

Program description

-> io (f Unwrapped, io ())

(options, io action to print help message)

Marshal any value that implements ParseRecord from the command line and unwrap its fields alongside an io action to print the help message

unwrapRecordPure Source #

Arguments

:: (ParseRecord (f Wrapped), Unwrappable f) 
=> [Text]

Command-line arguments

-> Maybe (f Unwrapped) 

Pure version of unwrapRecord

unwrap :: forall f. Unwrappable f => f Wrapped -> f Unwrapped Source #

Unwrap the fields of a constructor

class ParseRecord a where Source #

A class for types that can be parsed from the command line

This class has a default implementation for any type that implements Generic and you can derive Generic for many types by enabling the DeriveGeneric language extension

You can also use getOnly to create a ParseRecord instance from a ParseFields instance:

instance ParseRecord MyType where
    parseRecord = fmap getOnly parseRecord

Minimal complete definition

Nothing

Instances

Instances details
ParseRecord All Source # 
Instance details

Defined in Options.Generic

ParseRecord Any Source # 
Instance details

Defined in Options.Generic

ParseRecord Void Source # 
Instance details

Defined in Options.Generic

ParseRecord Int16 Source # 
Instance details

Defined in Options.Generic

ParseRecord Int32 Source # 
Instance details

Defined in Options.Generic

ParseRecord Int64 Source # 
Instance details

Defined in Options.Generic

ParseRecord Int8 Source # 
Instance details

Defined in Options.Generic

ParseRecord Word16 Source # 
Instance details

Defined in Options.Generic

ParseRecord Word32 Source # 
Instance details

Defined in Options.Generic

ParseRecord Word64 Source # 
Instance details

Defined in Options.Generic

ParseRecord Word8 Source # 
Instance details

Defined in Options.Generic

ParseRecord ByteString Source # 
Instance details

Defined in Options.Generic

ParseRecord ByteString Source # 
Instance details

Defined in Options.Generic

ParseRecord Ordering Source # 
Instance details

Defined in Options.Generic

ParseRecord FilePath Source # 
Instance details

Defined in Options.Generic

ParseRecord Text Source # 
Instance details

Defined in Options.Generic

ParseRecord Text Source # 
Instance details

Defined in Options.Generic

ParseRecord Day Source # 
Instance details

Defined in Options.Generic

ParseRecord Integer Source # 
Instance details

Defined in Options.Generic

ParseRecord Natural Source # 
Instance details

Defined in Options.Generic

ParseRecord () Source # 
Instance details

Defined in Options.Generic

Methods

parseRecord :: Parser () Source #

ParseRecord Bool Source # 
Instance details

Defined in Options.Generic

ParseRecord Char Source # 
Instance details

Defined in Options.Generic

ParseRecord Double Source # 
Instance details

Defined in Options.Generic

ParseRecord Float Source # 
Instance details

Defined in Options.Generic

ParseRecord Int Source # 
Instance details

Defined in Options.Generic

ParseFields a => ParseRecord (Only a) Source # 
Instance details

Defined in Options.Generic

ParseField a => ParseRecord (First a) Source # 
Instance details

Defined in Options.Generic

ParseField a => ParseRecord (Last a) Source # 
Instance details

Defined in Options.Generic

(Num a, ParseField a) => ParseRecord (Product a) Source # 
Instance details

Defined in Options.Generic

(Num a, ParseField a) => ParseRecord (Sum a) Source # 
Instance details

Defined in Options.Generic

Methods

parseRecord :: Parser (Sum a) Source #

ParseField a => ParseRecord (NonEmpty a) Source # 
Instance details

Defined in Options.Generic

ParseField a => ParseRecord (Maybe a) Source # 
Instance details

Defined in Options.Generic

ParseField a => ParseRecord [a] Source # 
Instance details

Defined in Options.Generic

Methods

parseRecord :: Parser [a] Source #

(ParseFields a, ParseFields b) => ParseRecord (Either a b) Source # 
Instance details

Defined in Options.Generic

Methods

parseRecord :: Parser (Either a b) Source #

(ParseFields a, KnownSymbol h) => ParseRecord (a <!> h) Source # 
Instance details

Defined in Options.Generic

Methods

parseRecord :: Parser (a <!> h) Source #

(ParseFields a, KnownSymbol h) => ParseRecord (a <#> h) Source # 
Instance details

Defined in Options.Generic

Methods

parseRecord :: Parser (a <#> h) Source #

(ParseFields a, KnownSymbol h) => ParseRecord (a <?> h) Source # 
Instance details

Defined in Options.Generic

Methods

parseRecord :: Parser (a <?> h) Source #

(ParseFields a, ParseFields b) => ParseRecord (a, b) Source # 
Instance details

Defined in Options.Generic

Methods

parseRecord :: Parser (a, b) Source #

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

Defined in Options.Generic

Methods

parseRecord :: Parser (a, b, c) Source #

(ParseFields a, ParseFields b, ParseFields c, ParseFields d) => ParseRecord (a, b, c, d) Source # 
Instance details

Defined in Options.Generic

Methods

parseRecord :: Parser (a, b, c, d) Source #

(ParseFields a, ParseFields b, ParseFields c, ParseFields d, ParseFields e) => ParseRecord (a, b, c, d, e) Source # 
Instance details

Defined in Options.Generic

Methods

parseRecord :: Parser (a, b, c, d, e) Source #

(ParseFields a, ParseFields b, ParseFields c, ParseFields d, ParseFields e, ParseFields f) => ParseRecord (a, b, c, d, e, f) Source # 
Instance details

Defined in Options.Generic

Methods

parseRecord :: Parser (a, b, c, d, e, f) Source #

(ParseFields a, ParseFields b, ParseFields c, ParseFields d, ParseFields e, ParseFields f, ParseFields g) => ParseRecord (a, b, c, d, e, f, g) Source # 
Instance details

Defined in Options.Generic

Methods

parseRecord :: Parser (a, b, c, d, e, f, g) Source #

class ParseRecord a => ParseFields a where Source #

A class for all types that can be parsed from zero or more arguments/options on the command line

parseFields has a default implementation for any type that implements ParseField

Minimal complete definition

Nothing

Methods

parseFields Source #

Arguments

:: Maybe Text

Help message

-> Maybe Text

Field label

-> Maybe Char

Short name

-> Maybe String

Default value

-> Parser a 

Instances

Instances details
ParseFields All Source # 
Instance details

Defined in Options.Generic

ParseFields Any Source # 
Instance details

Defined in Options.Generic

ParseFields Void Source # 
Instance details

Defined in Options.Generic

ParseFields Int16 Source # 
Instance details

Defined in Options.Generic

ParseFields Int32 Source # 
Instance details

Defined in Options.Generic

ParseFields Int64 Source # 
Instance details

Defined in Options.Generic

ParseFields Int8 Source # 
Instance details

Defined in Options.Generic

ParseFields Word16 Source # 
Instance details

Defined in Options.Generic

ParseFields Word32 Source # 
Instance details

Defined in Options.Generic

ParseFields Word64 Source # 
Instance details

Defined in Options.Generic

ParseFields Word8 Source # 
Instance details

Defined in Options.Generic

ParseFields ByteString Source # 
Instance details

Defined in Options.Generic

ParseFields ByteString Source # 
Instance details

Defined in Options.Generic

ParseFields Ordering Source # 
Instance details

Defined in Options.Generic

ParseFields FilePath Source # 
Instance details

Defined in Options.Generic

ParseFields Text Source # 
Instance details

Defined in Options.Generic

ParseFields Text Source # 
Instance details

Defined in Options.Generic

ParseFields Day Source # 
Instance details

Defined in Options.Generic

ParseFields Integer Source # 
Instance details

Defined in Options.Generic

ParseFields Natural Source # 
Instance details

Defined in Options.Generic

ParseFields () Source # 
Instance details

Defined in Options.Generic

ParseFields Bool Source # 
Instance details

Defined in Options.Generic

ParseFields Char Source # 
Instance details

Defined in Options.Generic

ParseFields Double Source # 
Instance details

Defined in Options.Generic

ParseFields Float Source # 
Instance details

Defined in Options.Generic

ParseFields Int Source # 
Instance details

Defined in Options.Generic

ParseField a => ParseFields (First a) Source # 
Instance details

Defined in Options.Generic

ParseField a => ParseFields (Last a) Source # 
Instance details

Defined in Options.Generic

(Num a, ParseField a) => ParseFields (Product a) Source # 
Instance details

Defined in Options.Generic

(Num a, ParseField a) => ParseFields (Sum a) Source # 
Instance details

Defined in Options.Generic

ParseField a => ParseFields (NonEmpty a) Source # 
Instance details

Defined in Options.Generic

ParseField a => ParseFields (Maybe a) Source # 
Instance details

Defined in Options.Generic

ParseField a => ParseFields [a] Source # 
Instance details

Defined in Options.Generic

(ParseFields a, KnownSymbol d) => ParseFields (a <!> d) Source # 
Instance details

Defined in Options.Generic

(ParseFields a, KnownSymbol c) => ParseFields (a <#> c) Source # 
Instance details

Defined in Options.Generic

(ParseFields a, KnownSymbol h) => ParseFields (a <?> h) Source # 
Instance details

Defined in Options.Generic

class ParseField a where Source #

A class for all record fields that can be parsed from exactly one option or argument on the command line

parseField has a default implementation for any type that implements Read and Typeable. You can derive Read for many types and you can derive Typeable for any type if you enable the DeriveDataTypeable language extension

Minimal complete definition

Nothing

Methods

parseField Source #

Arguments

:: Maybe Text

Help message

-> Maybe Text

Field label

-> Maybe Char

Short name

-> Maybe String

Default value

-> Parser a 

parseListOfField Source #

Arguments

:: Maybe Text

Help message

-> Maybe Text

Field label

-> Maybe Char

Short name

-> Maybe String

Default value

-> Parser [a] 

The only reason for this method is to provide a special case for handling Strings. All other instances should just fall back on the default implementation for parseListOfField

readField :: ReadM a Source #

default readField :: Read a => ReadM a Source #

metavar :: proxy a -> String Source #

default metavar :: Typeable a => proxy a -> String Source #

Instances

Instances details
ParseField All Source # 
Instance details

Defined in Options.Generic

ParseField Any Source # 
Instance details

Defined in Options.Generic

ParseField Void Source # 
Instance details

Defined in Options.Generic

ParseField Int16 Source # 
Instance details

Defined in Options.Generic

ParseField Int32 Source # 
Instance details

Defined in Options.Generic

ParseField Int64 Source # 
Instance details

Defined in Options.Generic

ParseField Int8 Source # 
Instance details

Defined in Options.Generic

ParseField Word16 Source # 
Instance details

Defined in Options.Generic

ParseField Word32 Source # 
Instance details

Defined in Options.Generic

ParseField Word64 Source # 
Instance details

Defined in Options.Generic

ParseField Word8 Source # 
Instance details

Defined in Options.Generic

ParseField ByteString Source # 
Instance details

Defined in Options.Generic

ParseField ByteString Source # 
Instance details

Defined in Options.Generic

ParseField Ordering Source # 
Instance details

Defined in Options.Generic

ParseField FilePath Source # 
Instance details

Defined in Options.Generic

ParseField Text Source # 
Instance details

Defined in Options.Generic

ParseField Text Source # 
Instance details

Defined in Options.Generic

ParseField Day Source # 
Instance details

Defined in Options.Generic

ParseField String Source # 
Instance details

Defined in Options.Generic

ParseField Integer Source # 
Instance details

Defined in Options.Generic

ParseField Natural Source # 
Instance details

Defined in Options.Generic

ParseField () Source # 
Instance details

Defined in Options.Generic

ParseField Bool Source # 
Instance details

Defined in Options.Generic

ParseField Char Source # 
Instance details

Defined in Options.Generic

ParseField Double Source # 
Instance details

Defined in Options.Generic

ParseField Float Source # 
Instance details

Defined in Options.Generic

ParseField Int Source # 
Instance details

Defined in Options.Generic

(ParseField a, KnownSymbol d) => ParseField (a <!> d) Source # 
Instance details

Defined in Options.Generic

(ParseField a, KnownSymbol c) => ParseField (a <#> c) Source # 
Instance details

Defined in Options.Generic

(ParseField a, KnownSymbol h) => ParseField (a <?> h) Source # 
Instance details

Defined in Options.Generic

newtype Only a Source #

The 1-tuple type or single-value "collection".

This type is structurally equivalent to the Identity type, but its intent is more about serving as the anonymous 1-tuple type missing from Haskell for attaching typeclass instances.

Parameter usage example:

encodeSomething (Only (42::Int))

Result usage example:

xs <- decodeSomething
forM_ xs $ \(Only id) -> {- ... -}

Constructors

Only 

Fields

Instances

Instances details
Functor Only 
Instance details

Defined in Data.Tuple.Only

Methods

fmap :: (a -> b) -> Only a -> Only b Source #

(<$) :: a -> Only b -> Only a Source #

Data a => Data (Only a) 
Instance details

Defined in Data.Tuple.Only

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Only a -> c (Only a) Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Only a) Source #

toConstr :: Only a -> Constr Source #

dataTypeOf :: Only a -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Only a)) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Only a)) Source #

gmapT :: (forall b. Data b => b -> b) -> Only a -> Only a Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Only a -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Only a -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> Only a -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Only a -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Only a -> m (Only a) Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Only a -> m (Only a) Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Only a -> m (Only a) Source #

Generic (Only a) 
Instance details

Defined in Data.Tuple.Only

Associated Types

type Rep (Only a) :: Type -> Type Source #

Methods

from :: Only a -> Rep (Only a) x Source #

to :: Rep (Only a) x -> Only a Source #

Read a => Read (Only a) 
Instance details

Defined in Data.Tuple.Only

Show a => Show (Only a) 
Instance details

Defined in Data.Tuple.Only

Methods

showsPrec :: Int -> Only a -> ShowS Source #

show :: Only a -> String Source #

showList :: [Only a] -> ShowS Source #

NFData a => NFData (Only a) 
Instance details

Defined in Data.Tuple.Only

Methods

rnf :: Only a -> () Source #

Eq a => Eq (Only a) 
Instance details

Defined in Data.Tuple.Only

Methods

(==) :: Only a -> Only a -> Bool Source #

(/=) :: Only a -> Only a -> Bool Source #

Ord a => Ord (Only a) 
Instance details

Defined in Data.Tuple.Only

Methods

compare :: Only a -> Only a -> Ordering Source #

(<) :: Only a -> Only a -> Bool Source #

(<=) :: Only a -> Only a -> Bool Source #

(>) :: Only a -> Only a -> Bool Source #

(>=) :: Only a -> Only a -> Bool Source #

max :: Only a -> Only a -> Only a Source #

min :: Only a -> Only a -> Only a Source #

ParseFields a => ParseRecord (Only a) Source # 
Instance details

Defined in Options.Generic

type Rep (Only a) 
Instance details

Defined in Data.Tuple.Only

type Rep (Only a) = D1 ('MetaData "Only" "Data.Tuple.Only" "Only-0.1-Ad3df0UHaox7lGDhjDzPkc" 'True) (C1 ('MetaCons "Only" 'PrefixI 'True) (S1 ('MetaSel ('Just "fromOnly") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)))

getOnly :: Only a -> a Source #

This is a convenience function that you can use if you want to create a ParseRecord instance that just defers to the ParseFields instance for the same type:

instance ParseRecord MyType where
    parseRecord = fmap getOnly parseRecord

data Modifiers Source #

Options for customizing derived ParseRecord implementations for Generic types

You can either create the Modifiers record directly:

modifiers :: Modifiers
modifiers = Modifiers
    { fieldNameModifier       = ...
    , constructorNameModifier = ...
    , shortNameModifier       = ...
    }

... or you can tweak the defaultModifiers:

modifiers :: Modifiers
modifiers = defaultModifiers { fieldNameModifier = ... }

... or you can use/tweak a predefined Modifier, like lispCaseModifiers

The parseRecordWithModifiers function uses this Modifiers record when generating a Generic implementation of ParseRecord

Constructors

Modifiers 

Fields

parseRecordWithModifiers :: (Generic a, GenericParseRecord (Rep a)) => Modifiers -> Parser a Source #

Use parseRecordWithModifiers when you want to tweak the behavior of a derived ParseRecord implementation, like this:

myModifiers :: Modifiers
myModifiers = defaultModifiers { constructorNameModifier = id }

instance ParseRecord MyType where
    parseRecord = parseRecordWithModifiers myModifiers

This will still require that you derive Generic for your type to automate most of the implementation, but the Modifiers that you pass will change how the implementation generates the command line interface

defaultModifiers :: Modifiers Source #

These are the default modifiers used if you derive a Generic implementation. You can customize this and pass the result to parseRecordWithModifiers if you would like to modify the derived implementation:

myModifiers :: Modifiers
myModifiers = defaultModifiers { constructorNameModifier = id }

instance ParseRecord MyType where
    parseRecord = parseRecordWithModifiers myModifiers

lispCaseModifiers :: Modifiers Source #

Convert field and constructor names from CamelCase to lisp-case.

Leading underscores are dropped, allowing one to use option names which are Haskell keywords or otherwise conflicting identifiers.

BuildCommand -> build-command
someFlag -> --some-flag
_type -> --type
_splitAt -> --split-at

firstLetter :: String -> Maybe Char Source #

Use this for the shortNameModifier field of the Modifiers record if you want to use the first letter of each option as the short name

class GenericParseRecord f where Source #

Instances

Instances details
GenericParseRecord (U1 :: Type -> Type) Source # 
Instance details

Defined in Options.Generic

GenericParseRecord (V1 :: Type -> Type) Source # 
Instance details

Defined in Options.Generic

(GenericParseRecord f, GenericParseRecord g) => GenericParseRecord (f :*: g) Source # 
Instance details

Defined in Options.Generic

(GenericParseRecord (f :+: g), GenericParseRecord (h :+: i)) => GenericParseRecord ((f :+: g) :+: (h :+: i)) Source # 
Instance details

Defined in Options.Generic

Methods

genericParseRecord :: Modifiers -> Parser (((f :+: g) :+: (h :+: i)) p) Source #

(Constructor c, GenericParseRecord (f :+: g), GenericParseRecord h) => GenericParseRecord ((f :+: g) :+: M1 C c h) Source # 
Instance details

Defined in Options.Generic

Methods

genericParseRecord :: Modifiers -> Parser (((f :+: g) :+: M1 C c h) p) Source #

(Constructor c, GenericParseRecord f, GenericParseRecord (g :+: h)) => GenericParseRecord (M1 C c f :+: (g :+: h)) Source # 
Instance details

Defined in Options.Generic

Methods

genericParseRecord :: Modifiers -> Parser ((M1 C c f :+: (g :+: h)) p) Source #

(Constructor c1, Constructor c2, GenericParseRecord f1, GenericParseRecord f2) => GenericParseRecord (M1 C c1 f1 :+: M1 C c2 f2) Source # 
Instance details

Defined in Options.Generic

Methods

genericParseRecord :: Modifiers -> Parser ((M1 C c1 f1 :+: M1 C c2 f2) p) Source #

GenericParseRecord f => GenericParseRecord (M1 C c f) Source # 
Instance details

Defined in Options.Generic

GenericParseRecord f => GenericParseRecord (M1 D c f) Source # 
Instance details

Defined in Options.Generic

(Selector s, ParseFields a) => GenericParseRecord (M1 S s (K1 i a :: Type -> Type)) Source # 
Instance details

Defined in Options.Generic

Methods

genericParseRecord :: Modifiers -> Parser (M1 S s (K1 i a) p) Source #

Help

newtype (field :: *) <?> (help :: Symbol) Source #

Use this to annotate a field with a type-level string (i.e. a Symbol) representing the help description for that field:

data Example = Example
    { foo :: Int    <?> "Documentation for the foo flag"
    , bar :: Double <?> "Documentation for the bar flag"
    } deriving (Generic, Show)

Constructors

Helpful 

Fields

Instances

Instances details
(KnownSymbol help, Data field) => Data (field <?> help) Source # 
Instance details

Defined in Options.Generic

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> (field <?> help) -> c (field <?> help) Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (field <?> help) Source #

toConstr :: (field <?> help) -> Constr Source #

dataTypeOf :: (field <?> help) -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (field <?> help)) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (field <?> help)) Source #

gmapT :: (forall b. Data b => b -> b) -> (field <?> help) -> field <?> help Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> (field <?> help) -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> (field <?> help) -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> (field <?> help) -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> (field <?> help) -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> (field <?> help) -> m (field <?> help) Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> (field <?> help) -> m (field <?> help) Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> (field <?> help) -> m (field <?> help) Source #

Generic (field <?> help) Source # 
Instance details

Defined in Options.Generic

Associated Types

type Rep (field <?> help) :: Type -> Type Source #

Methods

from :: (field <?> help) -> Rep (field <?> help) x Source #

to :: Rep (field <?> help) x -> field <?> help Source #

Show field => Show (field <?> help) Source # 
Instance details

Defined in Options.Generic

Methods

showsPrec :: Int -> (field <?> help) -> ShowS Source #

show :: (field <?> help) -> String Source #

showList :: [field <?> help] -> ShowS Source #

(ParseField a, KnownSymbol h) => ParseField (a <?> h) Source # 
Instance details

Defined in Options.Generic

(ParseFields a, KnownSymbol h) => ParseFields (a <?> h) Source # 
Instance details

Defined in Options.Generic

(ParseFields a, KnownSymbol h) => ParseRecord (a <?> h) Source # 
Instance details

Defined in Options.Generic

Methods

parseRecord :: Parser (a <?> h) Source #

type Rep (field <?> help) Source # 
Instance details

Defined in Options.Generic

type Rep (field <?> help) = D1 ('MetaData "<?>" "Options.Generic" "optparse-generic-1.4.9-6SojbfhHUQ171z3U9MM193" 'True) (C1 ('MetaCons "Helpful" 'PrefixI 'True) (S1 ('MetaSel ('Just "unHelpful") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 field)))

newtype (field :: *) <!> (value :: Symbol) Source #

Use this to annotate a field with a type-level string (i.e. a Symbol) representing the default value for that field:

data Example = Example
    { foo :: Int    <!> "1"
    , bar :: Double <!> "0.5"
    } deriving (Generic, Show)

Constructors

DefValue 

Fields

Instances

Instances details
(KnownSymbol value, Data field) => Data (field <!> value) Source # 
Instance details

Defined in Options.Generic

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> (field <!> value) -> c (field <!> value) Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (field <!> value) Source #

toConstr :: (field <!> value) -> Constr Source #

dataTypeOf :: (field <!> value) -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (field <!> value)) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (field <!> value)) Source #

gmapT :: (forall b. Data b => b -> b) -> (field <!> value) -> field <!> value Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> (field <!> value) -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> (field <!> value) -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> (field <!> value) -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> (field <!> value) -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> (field <!> value) -> m (field <!> value) Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> (field <!> value) -> m (field <!> value) Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> (field <!> value) -> m (field <!> value) Source #

Generic (field <!> value) Source # 
Instance details

Defined in Options.Generic

Associated Types

type Rep (field <!> value) :: Type -> Type Source #

Methods

from :: (field <!> value) -> Rep (field <!> value) x Source #

to :: Rep (field <!> value) x -> field <!> value Source #

Show field => Show (field <!> value) Source # 
Instance details

Defined in Options.Generic

Methods

showsPrec :: Int -> (field <!> value) -> ShowS Source #

show :: (field <!> value) -> String Source #

showList :: [field <!> value] -> ShowS Source #

(ParseField a, KnownSymbol d) => ParseField (a <!> d) Source # 
Instance details

Defined in Options.Generic

(ParseFields a, KnownSymbol d) => ParseFields (a <!> d) Source # 
Instance details

Defined in Options.Generic

(ParseFields a, KnownSymbol h) => ParseRecord (a <!> h) Source # 
Instance details

Defined in Options.Generic

Methods

parseRecord :: Parser (a <!> h) Source #

type Rep (field <!> value) Source # 
Instance details

Defined in Options.Generic

type Rep (field <!> value) = D1 ('MetaData "<!>" "Options.Generic" "optparse-generic-1.4.9-6SojbfhHUQ171z3U9MM193" 'True) (C1 ('MetaCons "DefValue" 'PrefixI 'True) (S1 ('MetaSel ('Just "unDefValue") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 field)))

newtype (field :: *) <#> (value :: Symbol) Source #

Use this to annotate a field with a type-level char (i.e. a Symbol) representing the short name of the field (only the first character of the symbol is used):

data Example = Example
    { foo :: Int    <#> "f"
    , bar :: Double <#> "b"
    } deriving (Generic, Show)

Constructors

ShortName 

Fields

Instances

Instances details
(KnownSymbol value, Data field) => Data (field <#> value) Source # 
Instance details

Defined in Options.Generic

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> (field <#> value) -> c (field <#> value) Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (field <#> value) Source #

toConstr :: (field <#> value) -> Constr Source #

dataTypeOf :: (field <#> value) -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (field <#> value)) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (field <#> value)) Source #

gmapT :: (forall b. Data b => b -> b) -> (field <#> value) -> field <#> value Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> (field <#> value) -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> (field <#> value) -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> (field <#> value) -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> (field <#> value) -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> (field <#> value) -> m (field <#> value) Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> (field <#> value) -> m (field <#> value) Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> (field <#> value) -> m (field <#> value) Source #

Generic (field <#> value) Source # 
Instance details

Defined in Options.Generic

Associated Types

type Rep (field <#> value) :: Type -> Type Source #

Methods

from :: (field <#> value) -> Rep (field <#> value) x Source #

to :: Rep (field <#> value) x -> field <#> value Source #

Show field => Show (field <#> value) Source # 
Instance details

Defined in Options.Generic

Methods

showsPrec :: Int -> (field <#> value) -> ShowS Source #

show :: (field <#> value) -> String Source #

showList :: [field <#> value] -> ShowS Source #

(ParseField a, KnownSymbol c) => ParseField (a <#> c) Source # 
Instance details

Defined in Options.Generic

(ParseFields a, KnownSymbol c) => ParseFields (a <#> c) Source # 
Instance details

Defined in Options.Generic

(ParseFields a, KnownSymbol h) => ParseRecord (a <#> h) Source # 
Instance details

Defined in Options.Generic

Methods

parseRecord :: Parser (a <#> h) Source #

type Rep (field <#> value) Source # 
Instance details

Defined in Options.Generic

type Rep (field <#> value) = D1 ('MetaData "<#>" "Options.Generic" "optparse-generic-1.4.9-6SojbfhHUQ171z3U9MM193" 'True) (C1 ('MetaCons "ShortName" 'PrefixI 'True) (S1 ('MetaSel ('Just "unShortName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 field)))

type family wrap ::: wrapped infixr 0 Source #

A type family to extract fields wrapped using (<?>)

Instances

Instances details
type Unwrapped ::: wrapped Source # 
Instance details

Defined in Options.Generic

type Unwrapped ::: wrapped
type Wrapped ::: wrapped Source # 
Instance details

Defined in Options.Generic

type Wrapped ::: wrapped = wrapped

data Wrapped Source #

Flag to keep fields wrapped

Instances

Instances details
type Wrapped ::: wrapped Source # 
Instance details

Defined in Options.Generic

type Wrapped ::: wrapped = wrapped

data Unwrapped Source #

Flag to unwrap fields annotated using (<?>)

Instances

Instances details
Data Unwrapped Source # 
Instance details

Defined in Options.Generic

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Unwrapped -> c Unwrapped Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Unwrapped Source #

toConstr :: Unwrapped -> Constr Source #

dataTypeOf :: Unwrapped -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Unwrapped) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Unwrapped) Source #

gmapT :: (forall b. Data b => b -> b) -> Unwrapped -> Unwrapped Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Unwrapped -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Unwrapped -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> Unwrapped -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Unwrapped -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Unwrapped -> m Unwrapped Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Unwrapped -> m Unwrapped Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Unwrapped -> m Unwrapped Source #

type Unwrapped ::: wrapped Source # 
Instance details

Defined in Options.Generic

type Unwrapped ::: wrapped

type Unwrappable f = (Generic (f Wrapped), Generic (f Unwrapped), GenericUnwrappable (Rep (f Wrapped)) (Rep (f Unwrapped))) Source #

Constraint for types whose fields can be unwrapped

Re-exports

class Generic a Source #

Representable types of kind *. This class is derivable in GHC with the DeriveGeneric flag on.

A Generic instance must satisfy the following laws:

from . toid
to . fromid

Minimal complete definition

from, to

Instances

Instances details
Generic All 
Instance details

Defined in Data.Semigroup.Internal

Associated Types

type Rep All :: Type -> Type Source #

Methods

from :: All -> Rep All x Source #

to :: Rep All x -> All Source #

Generic Any 
Instance details

Defined in Data.Semigroup.Internal

Associated Types

type Rep Any :: Type -> Type Source #

Methods

from :: Any -> Rep Any x Source #

to :: Rep Any x -> Any Source #

Generic Version 
Instance details

Defined in Data.Version

Associated Types

type Rep Version :: Type -> Type Source #

Generic Void 
Instance details

Defined in Data.Void

Associated Types

type Rep Void :: Type -> Type Source #

Methods

from :: Void -> Rep Void x Source #

to :: Rep Void x -> Void Source #

Generic Fingerprint 
Instance details

Defined in GHC.Generics

Associated Types

type Rep Fingerprint :: Type -> Type Source #

Generic Associativity 
Instance details

Defined in GHC.Generics

Associated Types

type Rep Associativity :: Type -> Type Source #

Generic DecidedStrictness 
Instance details

Defined in GHC.Generics

Associated Types

type Rep DecidedStrictness :: Type -> Type Source #

Generic Fixity 
Instance details

Defined in GHC.Generics

Associated Types

type Rep Fixity :: Type -> Type Source #

Generic SourceStrictness 
Instance details

Defined in GHC.Generics

Associated Types

type Rep SourceStrictness :: Type -> Type Source #

Generic SourceUnpackedness 
Instance details

Defined in GHC.Generics

Associated Types

type Rep SourceUnpackedness :: Type -> Type Source #

Generic ExitCode 
Instance details

Defined in GHC.IO.Exception

Associated Types

type Rep ExitCode :: Type -> Type Source #

Generic CCFlags 
Instance details

Defined in GHC.RTS.Flags

Associated Types

type Rep CCFlags :: Type -> Type Source #

Generic ConcFlags 
Instance details

Defined in GHC.RTS.Flags

Associated Types

type Rep ConcFlags :: Type -> Type Source #

Generic DebugFlags 
Instance details

Defined in GHC.RTS.Flags

Associated Types

type Rep DebugFlags :: Type -> Type Source #

Generic DoCostCentres 
Instance details

Defined in GHC.RTS.Flags

Associated Types

type Rep DoCostCentres :: Type -> Type Source #

Generic DoHeapProfile 
Instance details

Defined in GHC.RTS.Flags

Associated Types

type Rep DoHeapProfile :: Type -> Type Source #

Generic DoTrace 
Instance details

Defined in GHC.RTS.Flags

Associated Types

type Rep DoTrace :: Type -> Type Source #

Generic GCFlags 
Instance details

Defined in GHC.RTS.Flags

Associated Types

type Rep GCFlags :: Type -> Type Source #

Generic GiveGCStats 
Instance details

Defined in GHC.RTS.Flags

Associated Types

type Rep GiveGCStats :: Type -> Type Source #

Generic MiscFlags 
Instance details

Defined in GHC.RTS.Flags

Associated Types

type Rep MiscFlags :: Type -> Type Source #

Generic ParFlags 
Instance details

Defined in GHC.RTS.Flags

Associated Types

type Rep ParFlags :: Type -> Type Source #

Generic ProfFlags 
Instance details

Defined in GHC.RTS.Flags

Associated Types

type Rep ProfFlags :: Type -> Type Source #

Generic RTSFlags 
Instance details

Defined in GHC.RTS.Flags

Associated Types

type Rep RTSFlags :: Type -> Type Source #

Generic TickyFlags 
Instance details

Defined in GHC.RTS.Flags

Associated Types

type Rep TickyFlags :: Type -> Type Source #

Generic TraceFlags 
Instance details

Defined in GHC.RTS.Flags

Associated Types

type Rep TraceFlags :: Type -> Type Source #

Generic SrcLoc 
Instance details

Defined in GHC.Generics

Associated Types

type Rep SrcLoc :: Type -> Type Source #

Generic GeneralCategory 
Instance details

Defined in GHC.Generics

Associated Types

type Rep GeneralCategory :: Type -> Type Source #

Generic ForeignSrcLang 
Instance details

Defined in GHC.ForeignSrcLang.Type

Associated Types

type Rep ForeignSrcLang :: Type -> Type Source #

Generic Extension 
Instance details

Defined in GHC.LanguageExtensions.Type

Associated Types

type Rep Extension :: Type -> Type Source #

Generic Ordering 
Instance details

Defined in GHC.Generics

Associated Types

type Rep Ordering :: Type -> Type Source #

Generic AnnLookup 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep AnnLookup :: Type -> Type Source #

Generic AnnTarget 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep AnnTarget :: Type -> Type Source #

Generic Bang 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Bang :: Type -> Type Source #

Methods

from :: Bang -> Rep Bang x Source #

to :: Rep Bang x -> Bang Source #

Generic Body 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Body :: Type -> Type Source #

Methods

from :: Body -> Rep Body x Source #

to :: Rep Body x -> Body Source #

Generic Bytes 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Bytes :: Type -> Type Source #

Methods

from :: Bytes -> Rep Bytes x Source #

to :: Rep Bytes x -> Bytes Source #

Generic Callconv 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Callconv :: Type -> Type Source #

Generic Clause 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Clause :: Type -> Type Source #

Generic Con 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Con :: Type -> Type Source #

Methods

from :: Con -> Rep Con x Source #

to :: Rep Con x -> Con Source #

Generic Dec 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Dec :: Type -> Type Source #

Methods

from :: Dec -> Rep Dec x Source #

to :: Rep Dec x -> Dec Source #

Generic DecidedStrictness 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep DecidedStrictness :: Type -> Type Source #

Generic DerivClause 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep DerivClause :: Type -> Type Source #

Generic DerivStrategy 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep DerivStrategy :: Type -> Type Source #

Generic DocLoc 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep DocLoc :: Type -> Type Source #

Generic Exp 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Exp :: Type -> Type Source #

Methods

from :: Exp -> Rep Exp x Source #

to :: Rep Exp x -> Exp Source #

Generic FamilyResultSig 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep FamilyResultSig :: Type -> Type Source #

Generic Fixity 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Fixity :: Type -> Type Source #

Generic FixityDirection 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep FixityDirection :: Type -> Type Source #

Generic Foreign 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Foreign :: Type -> Type Source #

Generic FunDep 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep FunDep :: Type -> Type Source #

Generic Guard 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Guard :: Type -> Type Source #

Methods

from :: Guard -> Rep Guard x Source #

to :: Rep Guard x -> Guard Source #

Generic Info 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Info :: Type -> Type Source #

Methods

from :: Info -> Rep Info x Source #

to :: Rep Info x -> Info Source #

Generic InjectivityAnn 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep InjectivityAnn :: Type -> Type Source #

Generic Inline 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Inline :: Type -> Type Source #

Generic Lit 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Lit :: Type -> Type Source #

Methods

from :: Lit -> Rep Lit x Source #

to :: Rep Lit x -> Lit Source #

Generic Loc 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Loc :: Type -> Type Source #

Methods

from :: Loc -> Rep Loc x Source #

to :: Rep Loc x -> Loc Source #

Generic Match 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Match :: Type -> Type Source #

Methods

from :: Match -> Rep Match x Source #

to :: Rep Match x -> Match Source #

Generic ModName 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep ModName :: Type -> Type Source #

Generic Module 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Module :: Type -> Type Source #

Generic ModuleInfo 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep ModuleInfo :: Type -> Type Source #

Generic Name 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Name :: Type -> Type Source #

Methods

from :: Name -> Rep Name x Source #

to :: Rep Name x -> Name Source #

Generic NameFlavour 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep NameFlavour :: Type -> Type Source #

Generic NameSpace 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep NameSpace :: Type -> Type Source #

Generic OccName 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep OccName :: Type -> Type Source #

Generic Overlap 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Overlap :: Type -> Type Source #

Generic Pat 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Pat :: Type -> Type Source #

Methods

from :: Pat -> Rep Pat x Source #

to :: Rep Pat x -> Pat Source #

Generic PatSynArgs 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep PatSynArgs :: Type -> Type Source #

Generic PatSynDir 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep PatSynDir :: Type -> Type Source #

Generic Phases 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Phases :: Type -> Type Source #

Generic PkgName 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep PkgName :: Type -> Type Source #

Generic Pragma 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Pragma :: Type -> Type Source #

Generic Range 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Range :: Type -> Type Source #

Methods

from :: Range -> Rep Range x Source #

to :: Rep Range x -> Range Source #

Generic Role 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Role :: Type -> Type Source #

Methods

from :: Role -> Rep Role x Source #

to :: Rep Role x -> Role Source #

Generic RuleBndr 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep RuleBndr :: Type -> Type Source #

Generic RuleMatch 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep RuleMatch :: Type -> Type Source #

Generic Safety 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Safety :: Type -> Type Source #

Generic SourceStrictness 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep SourceStrictness :: Type -> Type Source #

Generic SourceUnpackedness 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep SourceUnpackedness :: Type -> Type Source #

Generic Specificity 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Specificity :: Type -> Type Source #

Generic Stmt 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Stmt :: Type -> Type Source #

Methods

from :: Stmt -> Rep Stmt x Source #

to :: Rep Stmt x -> Stmt Source #

Generic TyLit 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep TyLit :: Type -> Type Source #

Methods

from :: TyLit -> Rep TyLit x Source #

to :: Rep TyLit x -> TyLit Source #

Generic TySynEqn 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep TySynEqn :: Type -> Type Source #

Generic Type 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep Type :: Type -> Type Source #

Methods

from :: Type -> Rep Type x Source #

to :: Rep Type x -> Type Source #

Generic TypeFamilyHead 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep TypeFamilyHead :: Type -> Type Source #

Generic () 
Instance details

Defined in GHC.Generics

Associated Types

type Rep () :: Type -> Type Source #

Methods

from :: () -> Rep () x Source #

to :: Rep () x -> () Source #

Generic Bool 
Instance details

Defined in GHC.Generics

Associated Types

type Rep Bool :: Type -> Type Source #

Methods

from :: Bool -> Rep Bool x Source #

to :: Rep Bool x -> Bool Source #

Generic (Only a) 
Instance details

Defined in Data.Tuple.Only

Associated Types

type Rep (Only a) :: Type -> Type Source #

Methods

from :: Only a -> Rep (Only a) x Source #

to :: Rep (Only a) x -> Only a Source #

Generic (ZipList a) 
Instance details

Defined in Control.Applicative

Associated Types

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

Methods

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

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

Generic (Complex a) 
Instance details

Defined in Data.Complex

Associated Types

type Rep (Complex a) :: Type -> Type Source #

Methods

from :: Complex a -> Rep (Complex a) x Source #

to :: Rep (Complex a) x -> Complex a Source #

Generic (Identity a) 
Instance details

Defined in Data.Functor.Identity

Associated Types

type Rep (Identity a) :: Type -> Type Source #

Methods

from :: Identity a -> Rep (Identity a) x Source #

to :: Rep (Identity a) x -> Identity a Source #

Generic (First a) 
Instance details

Defined in Data.Monoid

Associated Types

type Rep (First a) :: Type -> Type Source #

Methods

from :: First a -> Rep (First a) x Source #

to :: Rep (First a) x -> First a Source #

Generic (Last a) 
Instance details

Defined in Data.Monoid

Associated Types

type Rep (Last a) :: Type -> Type Source #

Methods

from :: Last a -> Rep (Last a) x Source #

to :: Rep (Last a) x -> Last a Source #

Generic (Down a) 
Instance details

Defined in GHC.Generics

Associated Types

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

Methods

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

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

Generic (First a) 
Instance details

Defined in Data.Semigroup

Associated Types

type Rep (First a) :: Type -> Type Source #

Methods

from :: First a -> Rep (First a) x Source #

to :: Rep (First a) x -> First a Source #

Generic (Last a) 
Instance details

Defined in Data.Semigroup

Associated Types

type Rep (Last a) :: Type -> Type Source #

Methods

from :: Last a -> Rep (Last a) x Source #

to :: Rep (Last a) x -> Last a Source #

Generic (Max a) 
Instance details

Defined in Data.Semigroup

Associated Types

type Rep (Max a) :: Type -> Type Source #

Methods

from :: Max a -> Rep (Max a) x Source #

to :: Rep (Max a) x -> Max a Source #

Generic (Min a) 
Instance details

Defined in Data.Semigroup

Associated Types

type Rep (Min a) :: Type -> Type Source #

Methods

from :: Min a -> Rep (Min a) x Source #

to :: Rep (Min a) x -> Min a Source #

Generic (WrappedMonoid m) 
Instance details

Defined in Data.Semigroup

Associated Types

type Rep (WrappedMonoid m) :: Type -> Type Source #

Generic (Dual a) 
Instance details

Defined in Data.Semigroup.Internal

Associated Types

type Rep (Dual a) :: Type -> Type Source #

Methods

from :: Dual a -> Rep (Dual a) x Source #

to :: Rep (Dual a) x -> Dual a Source #

Generic (Endo a) 
Instance details

Defined in Data.Semigroup.Internal

Associated Types

type Rep (Endo a) :: Type -> Type Source #

Methods

from :: Endo a -> Rep (Endo a) x Source #

to :: Rep (Endo a) x -> Endo a Source #

Generic (Product a) 
Instance details

Defined in Data.Semigroup.Internal

Associated Types

type Rep (Product a) :: Type -> Type Source #

Methods

from :: Product a -> Rep (Product a) x Source #

to :: Rep (Product a) x -> Product a Source #

Generic (Sum a) 
Instance details

Defined in Data.Semigroup.Internal

Associated Types

type Rep (Sum a) :: Type -> Type Source #

Methods

from :: Sum a -> Rep (Sum a) x Source #

to :: Rep (Sum a) x -> Sum a Source #

Generic (Par1 p) 
Instance details

Defined in GHC.Generics

Associated Types

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

Methods

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

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

Generic (Digit a) 
Instance details

Defined in Data.Sequence.Internal

Associated Types

type Rep (Digit a) :: Type -> Type Source #

Methods

from :: Digit a -> Rep (Digit a) x Source #

to :: Rep (Digit a) x -> Digit a Source #

Generic (Elem a) 
Instance details

Defined in Data.Sequence.Internal

Associated Types

type Rep (Elem a) :: Type -> Type Source #

Methods

from :: Elem a -> Rep (Elem a) x Source #

to :: Rep (Elem a) x -> Elem a Source #

Generic (FingerTree a) 
Instance details

Defined in Data.Sequence.Internal

Associated Types

type Rep (FingerTree a) :: Type -> Type Source #

Methods

from :: FingerTree a -> Rep (FingerTree a) x Source #

to :: Rep (FingerTree a) x -> FingerTree a Source #

Generic (Node a) 
Instance details

Defined in Data.Sequence.Internal

Associated Types

type Rep (Node a) :: Type -> Type Source #

Methods

from :: Node a -> Rep (Node a) x Source #

to :: Rep (Node a) x -> Node a Source #

Generic (ViewL a) 
Instance details

Defined in Data.Sequence.Internal

Associated Types

type Rep (ViewL a) :: Type -> Type Source #

Methods

from :: ViewL a -> Rep (ViewL a) x Source #

to :: Rep (ViewL a) x -> ViewL a Source #

Generic (ViewR a) 
Instance details

Defined in Data.Sequence.Internal

Associated Types

type Rep (ViewR a) :: Type -> Type Source #

Methods

from :: ViewR a -> Rep (ViewR a) x Source #

to :: Rep (ViewR a) x -> ViewR a Source #

Generic (Tree a) 
Instance details

Defined in Data.Tree

Associated Types

type Rep (Tree a) :: Type -> Type Source #

Methods

from :: Tree a -> Rep (Tree a) x Source #

to :: Rep (Tree a) x -> Tree a Source #

Generic (TyVarBndr flag) 
Instance details

Defined in Language.Haskell.TH.Syntax

Associated Types

type Rep (TyVarBndr flag) :: Type -> Type Source #

Methods

from :: TyVarBndr flag -> Rep (TyVarBndr flag) x Source #

to :: Rep (TyVarBndr flag) x -> TyVarBndr flag Source #

Generic (NonEmpty a) 
Instance details

Defined in GHC.Generics

Associated Types

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

Methods

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

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

Generic (Maybe a) 
Instance details

Defined in GHC.Generics

Associated Types

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

Methods

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

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

Generic (a) 
Instance details

Defined in GHC.Generics

Associated Types

type Rep (a) :: Type -> Type Source #

Methods

from :: (a) -> Rep (a) x Source #

to :: Rep (a) x -> (a) Source #

Generic [a] 
Instance details

Defined in GHC.Generics

Associated Types

type Rep [a] :: Type -> Type Source #

Methods

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

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

Generic (WrappedMonad m a) 
Instance details

Defined in Control.Applicative

Associated Types

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

Methods

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

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

Generic (Either a b) 
Instance details

Defined in GHC.Generics

Associated Types

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

Methods

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

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

Generic (Proxy t) 
Instance details

Defined in GHC.Generics

Associated Types

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

Methods

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

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

Generic (Arg a b) 
Instance details

Defined in Data.Semigroup

Associated Types

type Rep (Arg a b) :: Type -> Type Source #

Methods

from :: Arg a b -> Rep (Arg a b) x Source #

to :: Rep (Arg a b) x -> Arg a b Source #

Generic (U1 p) 
Instance details

Defined in GHC.Generics

Associated Types

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

Methods

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

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

Generic (V1 p) 
Instance details

Defined in GHC.Generics

Associated Types

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

Methods

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

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

Generic (field <!> value) Source # 
Instance details

Defined in Options.Generic

Associated Types

type Rep (field <!> value) :: Type -> Type Source #

Methods

from :: (field <!> value) -> Rep (field <!> value) x Source #

to :: Rep (field <!> value) x -> field <!> value Source #

Generic (field <#> value) Source # 
Instance details

Defined in Options.Generic

Associated Types

type Rep (field <#> value) :: Type -> Type Source #

Methods

from :: (field <#> value) -> Rep (field <#> value) x Source #

to :: Rep (field <#> value) x -> field <#> value Source #

Generic (field <?> help) Source # 
Instance details

Defined in Options.Generic

Associated Types

type Rep (field <?> help) :: Type -> Type Source #

Methods

from :: (field <?> help) -> Rep (field <?> help) x Source #

to :: Rep (field <?> help) x -> field <?> help Source #

Generic (a, b) 
Instance details

Defined in GHC.Generics

Associated Types

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

Methods

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

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

Generic (WrappedArrow a b c) 
Instance details

Defined in Control.Applicative

Associated Types

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

Methods

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

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

Generic (Kleisli m a b) 
Instance details

Defined in Control.Arrow

Associated Types

type Rep (Kleisli m a b) :: Type -> Type Source #

Methods

from :: Kleisli m a b -> Rep (Kleisli m a b) x Source #

to :: Rep (Kleisli m a b) x -> Kleisli m a b Source #

Generic (Const a b) 
Instance details

Defined in Data.Functor.Const

Associated Types

type Rep (Const a b) :: Type -> Type Source #

Methods

from :: Const a b -> Rep (Const a b) x Source #

to :: Rep (Const a b) x -> Const a b Source #

Generic (Ap f a) 
Instance details

Defined in Data.Monoid

Associated Types

type Rep (Ap f a) :: Type -> Type Source #

Methods

from :: Ap f a -> Rep (Ap f a) x Source #

to :: Rep (Ap f a) x -> Ap f a Source #

Generic (Alt f a) 
Instance details

Defined in Data.Semigroup.Internal

Associated Types

type Rep (Alt f a) :: Type -> Type Source #

Methods

from :: Alt f a -> Rep (Alt f a) x Source #

to :: Rep (Alt f a) x -> Alt f a Source #

Generic (Rec1 f p) 
Instance details

Defined in GHC.Generics

Associated Types

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

Methods

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

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

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

Defined in GHC.Generics

Associated Types

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

Methods

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

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

Generic (URec Char p) 
Instance details

Defined in GHC.Generics

Associated Types

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

Methods

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

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

Generic (URec Double p) 
Instance details

Defined in GHC.Generics

Associated Types

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

Methods

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

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

Generic (URec Float p) 
Instance details

Defined in GHC.Generics

Associated Types

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

Methods

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

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

Generic (URec Int p) 
Instance details

Defined in GHC.Generics

Associated Types

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

Methods

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

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

Generic (URec Word p) 
Instance details

Defined in GHC.Generics

Associated Types

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

Methods

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

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

Generic (a, b, c) 
Instance details

Defined in GHC.Generics

Associated Types

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

Methods

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

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

Generic (Product f g a) 
Instance details

Defined in Data.Functor.Product

Associated Types

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

Methods

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

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

Generic (Sum f g a) 
Instance details

Defined in Data.Functor.Sum

Associated Types

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

Methods

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

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

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

Defined in GHC.Generics

Associated Types

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

Methods

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

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

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

Defined in GHC.Generics

Associated Types

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

Methods

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

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

Generic (K1 i c p) 
Instance details

Defined in GHC.Generics

Associated Types

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

Methods

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

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

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

Defined in GHC.Generics

Associated Types

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

Methods

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

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

Generic (Compose f g a) 
Instance details

Defined in Data.Functor.Compose

Associated Types

type Rep (Compose f g a) :: Type -> Type Source #

Methods

from :: Compose f g a -> Rep (Compose f g a) x Source #

to :: Rep (Compose f g a) x -> Compose f g a Source #

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

Defined in GHC.Generics

Associated Types

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

Methods

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

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

Generic (M1 i c f p) 
Instance details

Defined in GHC.Generics

Associated Types

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

Methods

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

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

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

Defined in GHC.Generics

Associated Types

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

Methods

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

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

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 Source #

Methods

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

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

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 Source #

Methods

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

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

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

Defined in GHC.Generics

Associated Types

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

Methods

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

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

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

Defined in GHC.Generics

Associated Types

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

Methods

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

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

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

Defined in GHC.Generics

Associated Types

type Rep (a, b, c, d, e, f, g, h, i, j) :: Type -> Type Source #

Methods

from :: (a, b, c, d, e, f, g, h, i, j) -> Rep (a, b, c, d, e, f, g, h, i, j) x Source #

to :: Rep (a, b, c, d, e, f, g, h, i, j) x -> (a, b, c, d, e, f, g, h, i, j) Source #

Generic (a, b, c, d, e, f, g, h, i, j, k) 
Instance details

Defined in GHC.Generics

Associated Types

type Rep (a, b, c, d, e, f, g, h, i, j, k) :: Type -> Type Source #

Methods

from :: (a, b, c, d, e, f, g, h, i, j, k) -> Rep (a, b, c, d, e, f, g, h, i, j, k) x Source #

to :: Rep (a, b, c, d, e, f, g, h, i, j, k) x -> (a, b, c, d, e, f, g, h, i, j, k) Source #

Generic (a, b, c, d, e, f, g, h, i, j, k, l) 
Instance details

Defined in GHC.Generics

Associated Types

type Rep (a, b, c, d, e, f, g, h, i, j, k, l) :: Type -> Type Source #

Methods

from :: (a, b, c, d, e, f, g, h, i, j, k, l) -> Rep (a, b, c, d, e, f, g, h, i, j, k, l) x Source #

to :: Rep (a, b, c, d, e, f, g, h, i, j, k, l) x -> (a, b, c, d, e, f, g, h, i, j, k, l) Source #

Generic (a, b, c, d, e, f, g, h, i, j, k, l, m) 
Instance details

Defined in GHC.Generics

Associated Types

type Rep (a, b, c, d, e, f, g, h, i, j, k, l, m) :: Type -> Type Source #

Methods

from :: (a, b, c, d, e, f, g, h, i, j, k, l, m) -> Rep (a, b, c, d, e, f, g, h, i, j, k, l, m) x Source #

to :: Rep (a, b, c, d, e, f, g, h, i, j, k, l, m) x -> (a, b, c, d, e, f, g, h, i, j, k, l, m) Source #

Generic (a, b, c, d, e, f, g, h, i, j, k, l, m, n) 
Instance details

Defined in GHC.Generics

Associated Types

type Rep (a, b, c, d, e, f, g, h, i, j, k, l, m, n) :: Type -> Type Source #

Methods

from :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> Rep (a, b, c, d, e, f, g, h, i, j, k, l, m, n) x Source #

to :: Rep (a, b, c, d, e, f, g, h, i, j, k, l, m, n) x -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n) Source #

Generic (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) 
Instance details

Defined in GHC.Generics

Associated Types

type Rep (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) :: Type -> Type Source #

Methods

from :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> Rep (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) x Source #

to :: Rep (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) x -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) Source #

data Text Source #

A space efficient, packed, unboxed Unicode text type.

Instances

Instances details
ParseField Text Source # 
Instance details

Defined in Options.Generic

ParseFields Text Source # 
Instance details

Defined in Options.Generic

ParseRecord Text Source # 
Instance details

Defined in Options.Generic

type Item Text 
Instance details

Defined in Data.Text

type Item Text = Char

newtype All Source #

Boolean monoid under conjunction (&&).

>>> getAll (All True <> mempty <> All False)
False
>>> getAll (mconcat (map (\x -> All (even x)) [2,4,6,7,8]))
False

Constructors

All 

Fields

Instances

Instances details
Data All

Since: base-4.8.0.0

Instance details

Defined in Data.Data

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> All -> c All Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c All Source #

toConstr :: All -> Constr Source #

dataTypeOf :: All -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c All) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c All) Source #

gmapT :: (forall b. Data b => b -> b) -> All -> All Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> All -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> All -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> All -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> All -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> All -> m All Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> All -> m All Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> All -> m All Source #

Monoid All

Since: base-2.1

Instance details

Defined in Data.Semigroup.Internal

Semigroup All

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup.Internal

Methods

(<>) :: All -> All -> All Source #

sconcat :: NonEmpty All -> All Source #

stimes :: Integral b => b -> All -> All Source #

Bounded All

Since: base-2.1

Instance details

Defined in Data.Semigroup.Internal

Generic All 
Instance details

Defined in Data.Semigroup.Internal

Associated Types

type Rep All :: Type -> Type Source #

Methods

from :: All -> Rep All x Source #

to :: Rep All x -> All Source #

Read All

Since: base-2.1

Instance details

Defined in Data.Semigroup.Internal

Show All

Since: base-2.1

Instance details

Defined in Data.Semigroup.Internal

Eq All

Since: base-2.1

Instance details

Defined in Data.Semigroup.Internal

Methods

(==) :: All -> All -> Bool Source #

(/=) :: All -> All -> Bool Source #

Ord All

Since: base-2.1

Instance details

Defined in Data.Semigroup.Internal

Methods

compare :: All -> All -> Ordering Source #

(<) :: All -> All -> Bool Source #

(<=) :: All -> All -> Bool Source #

(>) :: All -> All -> Bool Source #

(>=) :: All -> All -> Bool Source #

max :: All -> All -> All Source #

min :: All -> All -> All Source #

ParseField All Source # 
Instance details

Defined in Options.Generic

ParseFields All Source # 
Instance details

Defined in Options.Generic

ParseRecord All Source # 
Instance details

Defined in Options.Generic

type Rep All

Since: base-4.7.0.0

Instance details

Defined in Data.Semigroup.Internal

type Rep All = D1 ('MetaData "All" "Data.Semigroup.Internal" "base" 'True) (C1 ('MetaCons "All" 'PrefixI 'True) (S1 ('MetaSel ('Just "getAll") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool)))

newtype Any Source #

Boolean monoid under disjunction (||).

>>> getAny (Any True <> mempty <> Any False)
True
>>> getAny (mconcat (map (\x -> Any (even x)) [2,4,6,7,8]))
True

Constructors

Any 

Fields

Instances

Instances details
Data Any

Since: base-4.8.0.0

Instance details

Defined in Data.Data

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Any -> c Any Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Any Source #

toConstr :: Any -> Constr Source #

dataTypeOf :: Any -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Any) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Any) Source #

gmapT :: (forall b. Data b => b -> b) -> Any -> Any Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Any -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Any -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> Any -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Any -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Any -> m Any Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Any -> m Any Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Any -> m Any Source #

Monoid Any

Since: base-2.1

Instance details

Defined in Data.Semigroup.Internal

Semigroup Any

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup.Internal

Methods

(<>) :: Any -> Any -> Any Source #

sconcat :: NonEmpty Any -> Any Source #

stimes :: Integral b => b -> Any -> Any Source #

Bounded Any

Since: base-2.1

Instance details

Defined in Data.Semigroup.Internal

Generic Any 
Instance details

Defined in Data.Semigroup.Internal

Associated Types

type Rep Any :: Type -> Type Source #

Methods

from :: Any -> Rep Any x Source #

to :: Rep Any x -> Any Source #

Read Any

Since: base-2.1

Instance details

Defined in Data.Semigroup.Internal

Show Any

Since: base-2.1

Instance details

Defined in Data.Semigroup.Internal

Eq Any

Since: base-2.1

Instance details

Defined in Data.Semigroup.Internal

Methods

(==) :: Any -> Any -> Bool Source #

(/=) :: Any -> Any -> Bool Source #

Ord Any

Since: base-2.1

Instance details

Defined in Data.Semigroup.Internal

Methods

compare :: Any -> Any -> Ordering Source #

(<) :: Any -> Any -> Bool Source #

(<=) :: Any -> Any -> Bool Source #

(>) :: Any -> Any -> Bool Source #

(>=) :: Any -> Any -> Bool Source #

max :: Any -> Any -> Any Source #

min :: Any -> Any -> Any Source #

ParseField Any Source # 
Instance details

Defined in Options.Generic

ParseFields Any Source # 
Instance details

Defined in Options.Generic

ParseRecord Any Source # 
Instance details

Defined in Options.Generic

type Rep Any

Since: base-4.7.0.0

Instance details

Defined in Data.Semigroup.Internal

type Rep Any = D1 ('MetaData "Any" "Data.Semigroup.Internal" "base" 'True) (C1 ('MetaCons "Any" 'PrefixI 'True) (S1 ('MetaSel ('Just "getAny") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool)))

newtype First a Source #

Maybe monoid returning the leftmost non-Nothing value.

First a is isomorphic to Alt Maybe a, but precedes it historically.

>>> getFirst (First (Just "hello") <> First Nothing <> First (Just "world"))
Just "hello"

Constructors

First 

Fields

Instances

Instances details
Foldable First

Since: base-4.8.0.0

Instance details

Defined in Data.Foldable

Methods

fold :: Monoid m => First m -> m Source #

foldMap :: Monoid m => (a -> m) -> First a -> m Source #

foldMap' :: Monoid m => (a -> m) -> First a -> m Source #

foldr :: (a -> b -> b) -> b -> First a -> b Source #

foldr' :: (a -> b -> b) -> b -> First a -> b Source #

foldl :: (b -> a -> b) -> b -> First a -> b Source #

foldl' :: (b -> a -> b) -> b -> First a -> b Source #

foldr1 :: (a -> a -> a) -> First a -> a Source #

foldl1 :: (a -> a -> a) -> First a -> a Source #

toList :: First a -> [a] Source #

null :: First a -> Bool Source #

length :: First a -> Int Source #

elem :: Eq a => a -> First a -> Bool Source #

maximum :: Ord a => First a -> a Source #

minimum :: Ord a => First a -> a Source #

sum :: Num a => First a -> a Source #

product :: Num a => First a -> a Source #

Traversable First

Since: base-4.8.0.0

Instance details

Defined in Data.Traversable

Methods

traverse :: Applicative f => (a -> f b) -> First a -> f (First b) Source #

sequenceA :: Applicative f => First (f a) -> f (First a) Source #

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

sequence :: Monad m => First (m a) -> m (First a) Source #

Applicative First

Since: base-4.8.0.0

Instance details

Defined in Data.Monoid

Methods

pure :: a -> First a Source #

(<*>) :: First (a -> b) -> First a -> First b Source #

liftA2 :: (a -> b -> c) -> First a -> First b -> First c Source #

(*>) :: First a -> First b -> First b Source #

(<*) :: First a -> First b -> First a Source #

Functor First

Since: base-4.8.0.0

Instance details

Defined in Data.Monoid

Methods

fmap :: (a -> b) -> First a -> First b Source #

(<$) :: a -> First b -> First a Source #

Monad First

Since: base-4.8.0.0

Instance details

Defined in Data.Monoid

Methods

(>>=) :: First a -> (a -> First b) -> First b Source #

(>>) :: First a -> First b -> First b Source #

return :: a -> First a Source #

Data a => Data (First a)

Since: base-4.8.0.0

Instance details

Defined in Data.Data

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> First a -> c (First a) Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (First a) Source #

toConstr :: First a -> Constr Source #

dataTypeOf :: First a -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (First a)) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (First a)) Source #

gmapT :: (forall b. Data b => b -> b) -> First a -> First a Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> First a -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> First a -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> First a -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> First a -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> First a -> m (First a) Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> First a -> m (First a) Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> First a -> m (First a) Source #

Monoid (First a)

Since: base-2.1

Instance details

Defined in Data.Monoid

Methods

mempty :: First a Source #

mappend :: First a -> First a -> First a Source #

mconcat :: [First a] -> First a Source #

Semigroup (First a)

Since: base-4.9.0.0

Instance details

Defined in Data.Monoid

Methods

(<>) :: First a -> First a -> First a Source #

sconcat :: NonEmpty (First a) -> First a Source #

stimes :: Integral b => b -> First a -> First a Source #

Generic (First a) 
Instance details

Defined in Data.Monoid

Associated Types

type Rep (First a) :: Type -> Type Source #

Methods

from :: First a -> Rep (First a) x Source #

to :: Rep (First a) x -> First a Source #

Read a => Read (First a)

Since: base-2.1

Instance details

Defined in Data.Monoid

Show a => Show (First a)

Since: base-2.1

Instance details

Defined in Data.Monoid

Eq a => Eq (First a)

Since: base-2.1

Instance details

Defined in Data.Monoid

Methods

(==) :: First a -> First a -> Bool Source #

(/=) :: First a -> First a -> Bool Source #

Ord a => Ord (First a)

Since: base-2.1

Instance details

Defined in Data.Monoid

Methods

compare :: First a -> First a -> Ordering Source #

(<) :: First a -> First a -> Bool Source #

(<=) :: First a -> First a -> Bool Source #

(>) :: First a -> First a -> Bool Source #

(>=) :: First a -> First a -> Bool Source #

max :: First a -> First a -> First a Source #

min :: First a -> First a -> First a Source #

ParseField a => ParseFields (First a) Source # 
Instance details

Defined in Options.Generic

ParseField a => ParseRecord (First a) Source # 
Instance details

Defined in Options.Generic

Generic1 First 
Instance details

Defined in Data.Monoid

Associated Types

type Rep1 First :: k -> Type Source #

Methods

from1 :: forall (a :: k). First a -> Rep1 First a Source #

to1 :: forall (a :: k). Rep1 First a -> First a Source #

type Rep (First a)

Since: base-4.7.0.0

Instance details

Defined in Data.Monoid

type Rep (First a) = D1 ('MetaData "First" "Data.Monoid" "base" 'True) (C1 ('MetaCons "First" 'PrefixI 'True) (S1 ('MetaSel ('Just "getFirst") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe a))))
type Rep1 First

Since: base-4.7.0.0

Instance details

Defined in Data.Monoid

type Rep1 First = D1 ('MetaData "First" "Data.Monoid" "base" 'True) (C1 ('MetaCons "First" 'PrefixI 'True) (S1 ('MetaSel ('Just "getFirst") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec1 Maybe)))

newtype Last a Source #

Maybe monoid returning the rightmost non-Nothing value.

Last a is isomorphic to Dual (First a), and thus to Dual (Alt Maybe a)

>>> getLast (Last (Just "hello") <> Last Nothing <> Last (Just "world"))
Just "world"

Constructors

Last 

Fields

Instances

Instances details
Foldable Last

Since: base-4.8.0.0

Instance details

Defined in Data.Foldable

Methods

fold :: Monoid m => Last m -> m Source #

foldMap :: Monoid m => (a -> m) -> Last a -> m Source #

foldMap' :: Monoid m => (a -> m) -> Last a -> m Source #

foldr :: (a -> b -> b) -> b -> Last a -> b Source #

foldr' :: (a -> b -> b) -> b -> Last a -> b Source #

foldl :: (b -> a -> b) -> b -> Last a -> b Source #

foldl' :: (b -> a -> b) -> b -> Last a -> b Source #

foldr1 :: (a -> a -> a) -> Last a -> a Source #

foldl1 :: (a -> a -> a) -> Last a -> a Source #

toList :: Last a -> [a] Source #

null :: Last a -> Bool Source #

length :: Last a -> Int Source #

elem :: Eq a => a -> Last a -> Bool Source #

maximum :: Ord a => Last a -> a Source #

minimum :: Ord a => Last a -> a Source #

sum :: Num a => Last a -> a Source #

product :: Num a => Last a -> a Source #

Traversable Last

Since: base-4.8.0.0

Instance details

Defined in Data.Traversable

Methods

traverse :: Applicative f => (a -> f b) -> Last a -> f (Last b) Source #

sequenceA :: Applicative f => Last (f a) -> f (Last a) Source #

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

sequence :: Monad m => Last (m a) -> m (Last a) Source #

Applicative Last

Since: base-4.8.0.0

Instance details

Defined in Data.Monoid

Methods

pure :: a -> Last a Source #

(<*>) :: Last (a -> b) -> Last a -> Last b Source #

liftA2 :: (a -> b -> c) -> Last a -> Last b -> Last c Source #

(*>) :: Last a -> Last b -> Last b Source #

(<*) :: Last a -> Last b -> Last a Source #

Functor Last

Since: base-4.8.0.0

Instance details

Defined in Data.Monoid

Methods

fmap :: (a -> b) -> Last a -> Last b Source #

(<$) :: a -> Last b -> Last a Source #

Monad Last

Since: base-4.8.0.0

Instance details

Defined in Data.Monoid

Methods

(>>=) :: Last a -> (a -> Last b) -> Last b Source #

(>>) :: Last a -> Last b -> Last b Source #

return :: a -> Last a Source #

Data a => Data (Last a)

Since: base-4.8.0.0

Instance details

Defined in Data.Data

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Last a -> c (Last a) Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Last a) Source #

toConstr :: Last a -> Constr Source #

dataTypeOf :: Last a -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Last a)) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Last a)) Source #

gmapT :: (forall b. Data b => b -> b) -> Last a -> Last a Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Last a -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Last a -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> Last a -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Last a -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Last a -> m (Last a) Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Last a -> m (Last a) Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Last a -> m (Last a) Source #

Monoid (Last a)

Since: base-2.1

Instance details

Defined in Data.Monoid

Methods

mempty :: Last a Source #

mappend :: Last a -> Last a -> Last a Source #

mconcat :: [Last a] -> Last a Source #

Semigroup (Last a)

Since: base-4.9.0.0

Instance details

Defined in Data.Monoid

Methods

(<>) :: Last a -> Last a -> Last a Source #

sconcat :: NonEmpty (Last a) -> Last a Source #

stimes :: Integral b => b -> Last a -> Last a Source #

Generic (Last a) 
Instance details

Defined in Data.Monoid

Associated Types

type Rep (Last a) :: Type -> Type Source #

Methods

from :: Last a -> Rep (Last a) x Source #

to :: Rep (Last a) x -> Last a Source #

Read a => Read (Last a)

Since: base-2.1

Instance details

Defined in Data.Monoid

Show a => Show (Last a)

Since: base-2.1

Instance details

Defined in Data.Monoid

Methods

showsPrec :: Int -> Last a -> ShowS Source #

show :: Last a -> String Source #

showList :: [Last a] -> ShowS Source #

Eq a => Eq (Last a)

Since: base-2.1

Instance details

Defined in Data.Monoid

Methods

(==) :: Last a -> Last a -> Bool Source #

(/=) :: Last a -> Last a -> Bool Source #

Ord a => Ord (Last a)

Since: base-2.1

Instance details

Defined in Data.Monoid

Methods

compare :: Last a -> Last a -> Ordering Source #

(<) :: Last a -> Last a -> Bool Source #

(<=) :: Last a -> Last a -> Bool Source #

(>) :: Last a -> Last a -> Bool Source #

(>=) :: Last a -> Last a -> Bool Source #

max :: Last a -> Last a -> Last a Source #

min :: Last a -> Last a -> Last a Source #

ParseField a => ParseFields (Last a) Source # 
Instance details

Defined in Options.Generic

ParseField a => ParseRecord (Last a) Source # 
Instance details

Defined in Options.Generic

Generic1 Last 
Instance details

Defined in Data.Monoid

Associated Types

type Rep1 Last :: k -> Type Source #

Methods

from1 :: forall (a :: k). Last a -> Rep1 Last a Source #

to1 :: forall (a :: k). Rep1 Last a -> Last a Source #

type Rep (Last a)

Since: base-4.7.0.0

Instance details

Defined in Data.Monoid

type Rep (Last a) = D1 ('MetaData "Last" "Data.Monoid" "base" 'True) (C1 ('MetaCons "Last" 'PrefixI 'True) (S1 ('MetaSel ('Just "getLast") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe a))))
type Rep1 Last

Since: base-4.7.0.0

Instance details

Defined in Data.Monoid

type Rep1 Last = D1 ('MetaData "Last" "Data.Monoid" "base" 'True) (C1 ('MetaCons "Last" 'PrefixI 'True) (S1 ('MetaSel ('Just "getLast") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec1 Maybe)))

newtype Sum a Source #

Monoid under addition.

>>> getSum (Sum 1 <> Sum 2 <> mempty)
3

Constructors

Sum 

Fields

Instances

Instances details
Foldable Sum

Since: base-4.8.0.0

Instance details

Defined in Data.Foldable

Methods

fold :: Monoid m => Sum m -> m Source #

foldMap :: Monoid m => (a -> m) -> Sum a -> m Source #

foldMap' :: Monoid m => (a -> m) -> Sum a -> m Source #

foldr :: (a -> b -> b) -> b -> Sum a -> b Source #

foldr' :: (a -> b -> b) -> b -> Sum a -> b Source #

foldl :: (b -> a -> b) -> b -> Sum a -> b Source #

foldl' :: (b -> a -> b) -> b -> Sum a -> b Source #

foldr1 :: (a -> a -> a) -> Sum a -> a Source #

foldl1 :: (a -> a -> a) -> Sum a -> a Source #

toList :: Sum a -> [a] Source #

null :: Sum a -> Bool Source #

length :: Sum a -> Int Source #

elem :: Eq a => a -> Sum a -> Bool Source #

maximum :: Ord a => Sum a -> a Source #

minimum :: Ord a => Sum a -> a Source #

sum :: Num a => Sum a -> a Source #

product :: Num a => Sum a -> a Source #

Traversable Sum

Since: base-4.8.0.0

Instance details

Defined in Data.Traversable

Methods

traverse :: Applicative f => (a -> f b) -> Sum a -> f (Sum b) Source #

sequenceA :: Applicative f => Sum (f a) -> f (Sum a) Source #

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

sequence :: Monad m => Sum (m a) -> m (Sum a) Source #

Applicative Sum

Since: base-4.8.0.0

Instance details

Defined in Data.Semigroup.Internal

Methods

pure :: a -> Sum a Source #

(<*>) :: Sum (a -> b) -> Sum a -> Sum b Source #

liftA2 :: (a -> b -> c) -> Sum a -> Sum b -> Sum c Source #

(*>) :: Sum a -> Sum b -> Sum b Source #

(<*) :: Sum a -> Sum b -> Sum a Source #

Functor Sum

Since: base-4.8.0.0

Instance details

Defined in Data.Semigroup.Internal

Methods

fmap :: (a -> b) -> Sum a -> Sum b Source #

(<$) :: a -> Sum b -> Sum a Source #

Monad Sum

Since: base-4.8.0.0

Instance details

Defined in Data.Semigroup.Internal

Methods

(>>=) :: Sum a -> (a -> Sum b) -> Sum b Source #

(>>) :: Sum a -> Sum b -> Sum b Source #

return :: a -> Sum a Source #

Data a => Data (Sum a)

Since: base-4.8.0.0

Instance details

Defined in Data.Data

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Sum a -> c (Sum a) Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Sum a) Source #

toConstr :: Sum a -> Constr Source #

dataTypeOf :: Sum a -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Sum a)) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Sum a)) Source #

gmapT :: (forall b. Data b => b -> b) -> Sum a -> Sum a Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Sum a -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Sum a -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> Sum a -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Sum a -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Sum a -> m (Sum a) Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Sum a -> m (Sum a) Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Sum a -> m (Sum a) Source #

Num a => Monoid (Sum a)

Since: base-2.1

Instance details

Defined in Data.Semigroup.Internal

Methods

mempty :: Sum a Source #

mappend :: Sum a -> Sum a -> Sum a Source #

mconcat :: [Sum a] -> Sum a Source #

Num a => Semigroup (Sum a)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup.Internal

Methods

(<>) :: Sum a -> Sum a -> Sum a Source #

sconcat :: NonEmpty (Sum a) -> Sum a Source #

stimes :: Integral b => b -> Sum a -> Sum a Source #

Bounded a => Bounded (Sum a)

Since: base-2.1

Instance details

Defined in Data.Semigroup.Internal

Generic (Sum a) 
Instance details

Defined in Data.Semigroup.Internal

Associated Types

type Rep (Sum a) :: Type -> Type Source #

Methods

from :: Sum a -> Rep (Sum a) x Source #

to :: Rep (Sum a) x -> Sum a Source #

Num a => Num (Sum a)

Since: base-4.7.0.0

Instance details

Defined in Data.Semigroup.Internal

Methods

(+) :: Sum a -> Sum a -> Sum a Source #

(-) :: Sum a -> Sum a -> Sum a Source #

(*) :: Sum a -> Sum a -> Sum a Source #

negate :: Sum a -> Sum a Source #

abs :: Sum a -> Sum a Source #

signum :: Sum a -> Sum a Source #

fromInteger :: Integer -> Sum a Source #

Read a => Read (Sum a)

Since: base-2.1

Instance details

Defined in Data.Semigroup.Internal

Show a => Show (Sum a)

Since: base-2.1

Instance details

Defined in Data.Semigroup.Internal

Methods

showsPrec :: Int -> Sum a -> ShowS Source #

show :: Sum a -> String Source #

showList :: [Sum a] -> ShowS Source #

Eq a => Eq (Sum a)

Since: base-2.1

Instance details

Defined in Data.Semigroup.Internal

Methods

(==) :: Sum a -> Sum a -> Bool Source #

(/=) :: Sum a -> Sum a -> Bool Source #

Ord a => Ord (Sum a)

Since: base-2.1

Instance details

Defined in Data.Semigroup.Internal

Methods

compare :: Sum a -> Sum a -> Ordering Source #

(<) :: Sum a -> Sum a -> Bool Source #

(<=) :: Sum a -> Sum a -> Bool Source #

(>) :: Sum a -> Sum a -> Bool Source #

(>=) :: Sum a -> Sum a -> Bool Source #

max :: Sum a -> Sum a -> Sum a Source #

min :: Sum a -> Sum a -> Sum a Source #

(Num a, ParseField a) => ParseFields (Sum a) Source # 
Instance details

Defined in Options.Generic

(Num a, ParseField a) => ParseRecord (Sum a) Source # 
Instance details

Defined in Options.Generic

Methods

parseRecord :: Parser (Sum a) Source #

Generic1 Sum 
Instance details

Defined in Data.Semigroup.Internal

Associated Types

type Rep1 Sum :: k -> Type Source #

Methods

from1 :: forall (a :: k). Sum a -> Rep1 Sum a Source #

to1 :: forall (a :: k). Rep1 Sum a -> Sum a Source #

type Rep (Sum a)

Since: base-4.7.0.0

Instance details

Defined in Data.Semigroup.Internal

type Rep (Sum a) = D1 ('MetaData "Sum" "Data.Semigroup.Internal" "base" 'True) (C1 ('MetaCons "Sum" 'PrefixI 'True) (S1 ('MetaSel ('Just "getSum") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)))
type Rep1 Sum

Since: base-4.7.0.0

Instance details

Defined in Data.Semigroup.Internal

type Rep1 Sum = D1 ('MetaData "Sum" "Data.Semigroup.Internal" "base" 'True) (C1 ('MetaCons "Sum" 'PrefixI 'True) (S1 ('MetaSel ('Just "getSum") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) Par1))

newtype Product a Source #

Monoid under multiplication.

>>> getProduct (Product 3 <> Product 4 <> mempty)
12

Constructors

Product 

Fields

Instances

Instances details
Foldable Product

Since: base-4.8.0.0

Instance details

Defined in Data.Foldable

Methods

fold :: Monoid m => Product m -> m Source #

foldMap :: Monoid m => (a -> m) -> Product a -> m Source #

foldMap' :: Monoid m => (a -> m) -> Product a -> m Source #

foldr :: (a -> b -> b) -> b -> Product a -> b Source #

foldr' :: (a -> b -> b) -> b -> Product a -> b Source #

foldl :: (b -> a -> b) -> b -> Product a -> b Source #

foldl' :: (b -> a -> b) -> b -> Product a -> b Source #

foldr1 :: (a -> a -> a) -> Product a -> a Source #

foldl1 :: (a -> a -> a) -> Product a -> a Source #

toList :: Product a -> [a] Source #

null :: Product a -> Bool Source #

length :: Product a -> Int Source #

elem :: Eq a => a -> Product a -> Bool Source #

maximum :: Ord a => Product a -> a Source #

minimum :: Ord a => Product a -> a Source #

sum :: Num a => Product a -> a Source #

product :: Num a => Product a -> a Source #

Traversable Product

Since: base-4.8.0.0

Instance details

Defined in Data.Traversable

Methods

traverse :: Applicative f => (a -> f b) -> Product a -> f (Product b) Source #

sequenceA :: Applicative f => Product (f a) -> f (Product a) Source #

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

sequence :: Monad m => Product (m a) -> m (Product a) Source #

Applicative Product

Since: base-4.8.0.0

Instance details

Defined in Data.Semigroup.Internal

Methods

pure :: a -> Product a Source #

(<*>) :: Product (a -> b) -> Product a -> Product b Source #

liftA2 :: (a -> b -> c) -> Product a -> Product b -> Product c Source #

(*>) :: Product a -> Product b -> Product b Source #

(<*) :: Product a -> Product b -> Product a Source #

Functor Product

Since: base-4.8.0.0

Instance details

Defined in Data.Semigroup.Internal

Methods

fmap :: (a -> b) -> Product a -> Product b Source #

(<$) :: a -> Product b -> Product a Source #

Monad Product

Since: base-4.8.0.0

Instance details

Defined in Data.Semigroup.Internal

Methods

(>>=) :: Product a -> (a -> Product b) -> Product b Source #

(>>) :: Product a -> Product b -> Product b Source #

return :: a -> Product a Source #

Data a => Data (Product a)

Since: base-4.8.0.0

Instance details

Defined in Data.Data

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Product a -> c (Product a) Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Product a) Source #

toConstr :: Product a -> Constr Source #

dataTypeOf :: Product a -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Product a)) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Product a)) Source #

gmapT :: (forall b. Data b => b -> b) -> Product a -> Product a Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Product a -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Product a -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> Product a -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Product a -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Product a -> m (Product a) Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Product a -> m (Product a) Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Product a -> m (Product a) Source #

Num a => Monoid (Product a)

Since: base-2.1

Instance details

Defined in Data.Semigroup.Internal

Num a => Semigroup (Product a)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup.Internal

Methods

(<>) :: Product a -> Product a -> Product a Source #

sconcat :: NonEmpty (Product a) -> Product a Source #

stimes :: Integral b => b -> Product a -> Product a Source #

Bounded a => Bounded (Product a)

Since: base-2.1

Instance details

Defined in Data.Semigroup.Internal

Generic (Product a) 
Instance details

Defined in Data.Semigroup.Internal

Associated Types

type Rep (Product a) :: Type -> Type Source #

Methods

from :: Product a -> Rep (Product a) x Source #

to :: Rep (Product a) x -> Product a Source #

Num a => Num (Product a)

Since: base-4.7.0.0

Instance details

Defined in Data.Semigroup.Internal

Read a => Read (Product a)

Since: base-2.1

Instance details

Defined in Data.Semigroup.Internal

Show a => Show (Product a)

Since: base-2.1

Instance details

Defined in Data.Semigroup.Internal

Eq a => Eq (Product a)

Since: base-2.1

Instance details

Defined in Data.Semigroup.Internal

Methods

(==) :: Product a -> Product a -> Bool Source #

(/=) :: Product a -> Product a -> Bool Source #

Ord a => Ord (Product a)

Since: base-2.1

Instance details

Defined in Data.Semigroup.Internal

(Num a, ParseField a) => ParseFields (Product a) Source # 
Instance details

Defined in Options.Generic

(Num a, ParseField a) => ParseRecord (Product a) Source # 
Instance details

Defined in Options.Generic

Generic1 Product 
Instance details

Defined in Data.Semigroup.Internal

Associated Types

type Rep1 Product :: k -> Type Source #

Methods

from1 :: forall (a :: k). Product a -> Rep1 Product a Source #

to1 :: forall (a :: k). Rep1 Product a -> Product a Source #

type Rep (Product a)

Since: base-4.7.0.0

Instance details

Defined in Data.Semigroup.Internal

type Rep (Product a) = D1 ('MetaData "Product" "Data.Semigroup.Internal" "base" 'True) (C1 ('MetaCons "Product" 'PrefixI 'True) (S1 ('MetaSel ('Just "getProduct") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)))
type Rep1 Product

Since: base-4.7.0.0

Instance details

Defined in Data.Semigroup.Internal

type Rep1 Product = D1 ('MetaData "Product" "Data.Semigroup.Internal" "base" 'True) (C1 ('MetaCons "Product" 'PrefixI 'True) (S1 ('MetaSel ('Just "getProduct") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) Par1))