-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Backports of GHC deriving extensions
--   
--   <tt>deriving-compat</tt> provides Template Haskell functions that
--   mimic <tt>deriving</tt> extensions that were introduced or modified in
--   recent versions of GHC. Currently, the following
--   typeclasses/extensions are covered:
--   
--   <ul>
--   <li>Deriving <tt>Bounded</tt></li>
--   <li>Deriving <tt>Enum</tt></li>
--   <li>Deriving <tt>Ix</tt></li>
--   <li>Deriving <tt>Eq</tt></li>
--   <li>Deriving <tt>Ord</tt></li>
--   <li>Deriving <tt>Read</tt></li>
--   <li>Deriving <tt>Show</tt></li>
--   <li><pre>DeriveFoldable</pre></li>
--   <li><pre>DeriveFunctor</pre></li>
--   <li><pre>DeriveTraversable</pre></li>
--   <li><tt>GeneralizedNewtypeDeriving</tt> (with GHC 8.2 or later)</li>
--   <li><tt>DerivingVia</tt> (with GHC 8.2 or later)</li>
--   </ul>
--   
--   See the <a>Data.Deriving</a> module for a full list of backported
--   changes.
--   
--   In addition, <tt>deriving-compat</tt> also provides some additional
--   <tt>deriving</tt> functionality that has not yet been merged into
--   upstream GHC. Aside from the GHC <tt>deriving</tt> extensions
--   mentioned above, <tt>deriving-compat</tt> also permits deriving
--   instances of classes in the <tt>Data.Functor.Classes</tt> module,
--   covering the <tt>Eq1</tt>, <tt>Eq2</tt>, <tt>Ord1</tt>, <tt>Ord2</tt>,
--   <tt>Read1</tt>, <tt>Read2</tt>, <tt>Show1</tt>, and <tt>Show2</tt>
--   classes. This extra functionality is outside of the main scope of
--   <tt>deriving-compat</tt>, as it does not backport extensions that
--   exist in today's GHC. Nevertheless, the underlying Template Haskell
--   machinery needed to derive <tt>Eq</tt> and friends extends very
--   naturally to <tt>Eq1</tt> and friends, so this extra functionality is
--   included in <tt>deriving-compat</tt> as a convenience.
--   
--   Note that some recent GHC typeclasses/extensions are not covered by
--   this package:
--   
--   <ul>
--   <li><pre>DeriveDataTypeable</pre></li>
--   <li><tt>DeriveGeneric</tt>, which was introducted in GHC 7.2 for
--   deriving <tt>Generic</tt> instances, and modified in GHC 7.6 to allow
--   derivation of <tt>Generic1</tt> instances. Use
--   <tt>Generics.Deriving.TH</tt> from <tt><a>generic-deriving</a></tt> to
--   derive <tt>Generic(1)</tt> using Template Haskell.</li>
--   <li><tt>DeriveLift</tt>, which was introduced in GHC 8.0 for deriving
--   <tt>Lift</tt> instances. Use <tt>Language.Haskell.TH.Lift</tt> from
--   <tt><a>th-lift</a></tt> to derive <tt>Lift</tt> using Template
--   Haskell.</li>
--   <li>The <tt>Bifunctor</tt> typeclass, which was introduced in GHC
--   7.10, as well as the <tt>Bifoldable</tt> and <tt>Bitraversable</tt>
--   typeclasses, which were introduced in GHC 8.2. Use
--   <tt>Data.Bifunctor.TH</tt> from <tt><a>bifunctors</a></tt> to derive
--   these typeclasses using Template Haskell.</li>
--   </ul>
@package deriving-compat
@version 0.6.6


-- | Template Haskell-related utilities.
--   
--   Note: this is an internal module, and as such, the API presented here
--   is not guaranteed to be stable, even between minor releases of this
--   library.
module Data.Deriving.Internal
applySubstitutionKind :: Map Name Kind -> Type -> Type
substNameWithKind :: Name -> Kind -> Type -> Type
substNamesWithKindStar :: [Name] -> Type -> Type

-- | A type-level modifier intended to be used in conjunction with
--   <tt>deriveVia</tt>. Refer to the documentation for <tt>deriveVia</tt>
--   for more details.
data a `Via` b
infix 0 `Via`
fmapConst :: f b -> (a -> b) -> f a -> f b
replaceConst :: f a -> a -> f b -> f a
foldrConst :: b -> (a -> b -> b) -> b -> t a -> b
foldMapConst :: m -> (a -> m) -> t a -> m
nullConst :: Bool -> t a -> Bool
traverseConst :: f (t b) -> (a -> f b) -> t a -> f (t b)
eqConst :: Bool -> a -> a -> Bool
eq1Const :: Bool -> f a -> f a -> Bool
liftEqConst :: Bool -> (a -> b -> Bool) -> f a -> f b -> Bool
liftEq2Const :: Bool -> (a -> b -> Bool) -> (c -> d -> Bool) -> f a c -> f b d -> Bool
compareConst :: Ordering -> a -> a -> Ordering
ltConst :: Bool -> a -> a -> Bool
compare1Const :: Ordering -> f a -> f a -> Ordering
liftCompareConst :: Ordering -> (a -> b -> Ordering) -> f a -> f b -> Ordering
liftCompare2Const :: Ordering -> (a -> b -> Ordering) -> (c -> d -> Ordering) -> f a c -> f b d -> Ordering
readsPrecConst :: ReadS a -> Int -> ReadS a
readPrecConst :: ReadPrec a -> ReadPrec a
readsPrec1Const :: ReadS (f a) -> Int -> ReadS (f a)
liftReadsPrecConst :: ReadS (f a) -> (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (f a)
liftReadPrecConst :: ReadPrec (f a) -> ReadPrec a -> ReadPrec [a] -> ReadPrec (f a)
liftReadsPrec2Const :: ReadS (f a b) -> (Int -> ReadS a) -> ReadS [a] -> (Int -> ReadS b) -> ReadS [b] -> Int -> ReadS (f a b)
liftReadPrec2Const :: ReadPrec (f a b) -> ReadPrec a -> ReadPrec [a] -> ReadPrec b -> ReadPrec [b] -> ReadPrec (f a b)
showsPrecConst :: ShowS -> Int -> a -> ShowS
showsPrec1Const :: ShowS -> Int -> f a -> ShowS
liftShowsPrecConst :: ShowS -> (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> f a -> ShowS
liftShowsPrec2Const :: ShowS -> (Int -> a -> ShowS) -> ([a] -> ShowS) -> (Int -> b -> ShowS) -> ([b] -> ShowS) -> Int -> f a b -> ShowS

-- | Whether a type is not of kind *, is of kind *, or is a kind variable.
data StarKindStatus
NotKindStar :: StarKindStatus
KindStar :: StarKindStatus
IsKindVar :: Name -> StarKindStatus

-- | Does a Type have kind * or k (for some kind variable k)?
canRealizeKindStar :: Type -> StarKindStatus

-- | Returns <a>Just</a> the kind variable <a>Name</a> of a
--   <a>StarKindStatus</a> if it exists. Otherwise, returns <a>Nothing</a>.
starKindStatusToName :: StarKindStatus -> Maybe Name

-- | Concat together all of the StarKindStatuses that are IsKindVar and
--   extract the kind variables' Names out.
catKindVarNames :: [StarKindStatus] -> [Name]
class ClassRep a
arity :: ClassRep a => a -> Int
allowExQuant :: ClassRep a => a -> Bool
fullClassName :: ClassRep a => a -> Name
classConstraint :: ClassRep a => a -> Int -> Maybe Name
buildTypeInstance :: ClassRep a => a -> Name -> Cxt -> [Type] -> DatatypeVariant -> Q (Cxt, Type)

-- | Attempt to derive a constraint on a Type. If successful, return Just
--   the constraint and any kind variable names constrained to *.
--   Otherwise, return Nothing and the empty list.
--   
--   See Note [Type inference in derived instances] for the heuristics used
--   to come up with constraints.
deriveConstraint :: ClassRep a => a -> Type -> (Maybe Pred, [Name])
checkExistentialContext :: ClassRep a => a -> TyVarMap b -> Cxt -> Name -> Q c -> Q c

-- | The given datatype has no constructors, and we don't know what to do
--   with it.
noConstructorsError :: Q a

-- | Either the given data type doesn't have enough type variables, or one
--   of the type variables to be eta-reduced cannot realize kind *.
derivingKindError :: ClassRep a => a -> Name -> Q b

-- | The last type variable appeared in a contravariant position when
--   deriving Functor.
contravarianceError :: Name -> Q a

-- | A constructor has a function argument in a derived Foldable or
--   Traversable instance.
noFunctionsError :: Name -> Q a

-- | One of the last type variables cannot be eta-reduced (see the
--   canEtaReduce function for the criteria it would have to meet).
etaReductionError :: Type -> Q a

-- | The data type has a DatatypeContext which mentions one of the
--   eta-reduced type variables.
datatypeContextError :: Name -> Type -> Q a

-- | The data type has an existential constraint which mentions one of the
--   eta-reduced type variables.
existentialContextError :: Name -> Q a

-- | The data type mentions one of the n eta-reduced type variables in a
--   place other than the last nth positions of a data type in a
--   constructor's field.
outOfPlaceTyVarError :: ClassRep a => a -> Name -> Q b
enumerationError :: String -> Q a
enumerationOrProductError :: String -> Q a
enumerationErrorStr :: String -> String
typeDataError :: Name -> Q a

-- | A mapping of type variable Names to their auxiliary function Names.
type TyVarMap a = Map Name (OneOrTwoNames a)
type TyVarMap1 = TyVarMap One
type TyVarMap2 = TyVarMap Two
data OneOrTwoNames a
[OneName] :: Name -> OneOrTwoNames One
[TwoNames] :: Name -> Name -> OneOrTwoNames Two
data One
data Two
interleave :: [a] -> [a] -> [a]

-- | <a>filterByList</a> takes a list of Bools and a list of some elements
--   and filters out these elements for which the corresponding value in
--   the list of Bools is False. This function does not check whether the
--   lists have equal length.
filterByList :: [Bool] -> [a] -> [a]

-- | <a>filterByLists</a> takes a list of Bools and two lists as input, and
--   outputs a new list consisting of elements from the last two input
--   lists. For each Bool in the list, if it is <a>True</a>, then it takes
--   an element from the former list. If it is <a>False</a>, it takes an
--   element from the latter list. The elements taken correspond to the
--   index of the Bool in its list. For example:
--   
--   <pre>
--   filterByLists [True, False, True, False] "abcd" "wxyz" = "axcz"
--   </pre>
--   
--   This function does not check whether the lists have equal length.
filterByLists :: [Bool] -> [a] -> [a] -> [a]

-- | <a>partitionByList</a> takes a list of Bools and a list of some
--   elements and partitions the list according to the list of Bools.
--   Elements corresponding to <a>True</a> go to the left; elements
--   corresponding to <a>False</a> go to the right. For example,
--   <tt>partitionByList [True, False, True] [1,2,3] == ([1,3], [2])</tt>
--   This function does not check whether the lists have equal length.
partitionByList :: [Bool] -> [a] -> ([a], [a])
integerE :: Int -> Q Exp

-- | Returns True if a Type has kind *.
hasKindStar :: Type -> Bool
isStarOrVar :: Kind -> Bool

-- | <tt>hasKindVarChain n kind</tt> Checks if <tt>kind</tt> is of the form
--   k_0 -&gt; k_1 -&gt; ... -&gt; k_(n-1), where k0, k1, ..., and k_(n-1)
--   can be * or kind variables.
hasKindVarChain :: Int -> Type -> Maybe [Name]

-- | If a Type is a SigT, returns its kind signature. Otherwise, return *.
tyKind :: Type -> Kind
zipWithAndUnzipM :: Monad m => (a -> b -> m (c, d)) -> [a] -> [b] -> m ([c], [d])
zipWith3AndUnzipM :: Monad m => (a -> b -> c -> m (d, e)) -> [a] -> [b] -> [c] -> m ([d], [e])
thd3 :: (a, b, c) -> c
unsnoc :: [a] -> Maybe ([a], a)
isNullaryCon :: ConstructorInfo -> Bool

-- | Returns the number of fields for the constructor.
conArity :: ConstructorInfo -> Int

-- | Returns <a>True</a> if it's a datatype with exactly one,
--   non-existential constructor.
isProductType :: NonEmpty ConstructorInfo -> Bool

-- | Returns <a>True</a> if it's a datatype with one or more nullary,
--   non-GADT constructors.
isEnumerationType :: NonEmpty ConstructorInfo -> Bool

-- | Returns <a>False</a> if we're dealing with existential quantification
--   or GADTs.
isVanillaCon :: ConstructorInfo -> Bool

-- | Generate a list of fresh names with a common prefix, and numbered
--   suffixes.
newNameList :: String -> Int -> Q [Name]

-- | Extracts the kind from a TyVarBndr.
tvbKind :: TyVarBndr_ flag -> Kind

-- | Convert a TyVarBndr to a Type.
tvbToType :: TyVarBndr_ flag -> Type

-- | Applies a typeclass constraint to a type.
applyClass :: Name -> Name -> Pred
createKindChain :: Int -> Kind

-- | Checks to see if the last types in a data family instance can be
--   safely eta- reduced (i.e., dropped), given the other types. This
--   checks for three conditions:
--   
--   <ol>
--   <li>All of the dropped types are type variables</li>
--   <li>All of the dropped types are distinct</li>
--   <li>None of the remaining types mention any of the dropped types</li>
--   </ol>
canEtaReduce :: [Type] -> [Type] -> Bool

-- | Extract the Name from a type constructor. If the argument Type is not
--   a type variable, throw an error.
conTToName :: Type -> Name

-- | Extract Just the Name from a type variable. If the argument Type is
--   not a type variable, return Nothing.
varTToName_maybe :: Type -> Maybe Name

-- | Extract the Name from a type variable. If the argument Type is not a
--   type variable, throw an error.
varTToName :: Type -> Name

-- | Peel off a kind signature from a Type (if it has one).
unSigT :: Type -> Type

-- | Is the given type a variable?
isTyVar :: Type -> Bool

-- | Detect if a Name in a list of provided Names occurs as an argument to
--   some type family. This makes an effort to exclude <i>oversaturated</i>
--   arguments to type families. For instance, if one declared the
--   following type family:
--   
--   <pre>
--   type family F a :: Type -&gt; Type
--   </pre>
--   
--   Then in the type <tt>F a b</tt>, we would consider <tt>a</tt> to be an
--   argument to <tt>F</tt>, but not <tt>b</tt>.
isInTypeFamilyApp :: [Name] -> Type -> [Type] -> Q Bool

-- | Are all of the items in a list (which have an ordering) distinct?
--   
--   This uses Set (as opposed to nub) for better asymptotic time
--   complexity.
allDistinct :: Ord a => [a] -> Bool

-- | Does the given type mention any of the Names in the list?
mentionsName :: Type -> [Name] -> Bool

-- | Does an instance predicate mention any of the Names in the list?
predMentionsName :: Pred -> [Name] -> Bool

-- | Construct a type via curried application.
applyTy :: Type -> [Type] -> Type

-- | Fully applies a type constructor to its type variables.
applyTyCon :: Name -> [Type] -> Type

-- | Split an applied type into its individual components. For example,
--   this:
--   
--   <pre>
--   Either Int Char
--   </pre>
--   
--   would split to this:
--   
--   <pre>
--   [Either, Int, Char]
--   </pre>
unapplyTy :: Type -> (Type, [Type])

-- | Split a type signature by the arrows on its spine. For example, this:
--   
--   <pre>
--   forall a b. (a ~ b) =&gt; (a -&gt; b) -&gt; Char -&gt; ()
--   </pre>
--   
--   would split to this:
--   
--   <pre>
--   (a ~ b, [a -&gt; b, Char, ()])
--   </pre>
uncurryTy :: Type -> (Cxt, [Type])

-- | Like uncurryType, except on a kind level.
uncurryKind :: Kind -> [Kind]
untagExpr :: [(Name, Name)] -> Q Exp -> Q Exp
tag2ConExpr :: Type -> Q Exp
primOrdFunTbl :: Map Name (Name, Name, Name, Name, Name)
removeClassApp :: Type -> Type
freshen :: Name -> Q Name
freshenType :: Type -> Q Type
enumFromToExpr :: Q Exp -> Q Exp -> Q Exp
primOpAppExpr :: Q Exp -> Name -> Q Exp -> Q Exp

-- | Checks if a <a>Name</a> represents a tuple type constructor (other
--   than <tt>()</tt>)
isNonUnitTuple :: Name -> Bool

-- | Checks if a <a>String</a> represents a tuple (other than <tt>()</tt>)
isNonUnitTupleString :: String -> Bool

-- | Checks if a <a>String</a> names a valid Haskell infix data constructor
--   (i.e., does it begin with a colon?).
isInfixDataCon :: String -> Bool
isSym :: String -> Bool
ghc7'8OrLater :: Bool
isTrueHashValName :: Name
fmapConstValName :: Name
replaceConstValName :: Name
foldrConstValName :: Name
foldMapConstValName :: Name
nullConstValName :: Name
traverseConstValName :: Name
eqConstValName :: Name
eq1ConstValName :: Name
liftEqConstValName :: Name
liftEq2ConstValName :: Name
compareConstValName :: Name
ltConstValName :: Name
compare1ConstValName :: Name
liftCompareConstValName :: Name
liftCompare2ConstValName :: Name
readsPrecConstValName :: Name
readPrecConstValName :: Name
readsPrec1ConstValName :: Name
liftReadsPrecConstValName :: Name
liftReadPrecConstValName :: Name
liftReadsPrec2ConstValName :: Name
liftReadPrec2ConstValName :: Name
showsPrecConstValName :: Name
showsPrec1ConstValName :: Name
liftShowsPrecConstValName :: Name
liftShowsPrec2ConstValName :: Name
viaTypeName :: Name
cHashDataName :: Name
dHashDataName :: Name
fHashDataName :: Name
identDataName :: Name
iHashDataName :: Name
puncDataName :: Name
symbolDataName :: Name
wrapMonadDataName :: Name
addrHashTypeName :: Name
boundedTypeName :: Name
charHashTypeName :: Name
doubleHashTypeName :: Name
enumTypeName :: Name
floatHashTypeName :: Name
foldableTypeName :: Name
functorTypeName :: Name
intTypeName :: Name
intHashTypeName :: Name
ixTypeName :: Name
readTypeName :: Name
showTypeName :: Name
traversableTypeName :: Name
wordHashTypeName :: Name
altValName :: Name
appendValName :: Name
chooseValName :: Name
composeValName :: Name
constValName :: Name
enumFromValName :: Name
enumFromThenValName :: Name
enumFromThenToValName :: Name
enumFromToValName :: Name
eqAddrHashValName :: Name
eqCharHashValName :: Name
eqDoubleHashValName :: Name
eqFloatHashValName :: Name
eqIntHashValName :: Name
eqWordHashValName :: Name
errorValName :: Name
flipValName :: Name
fmapValName :: Name
foldrValName :: Name
foldMapValName :: Name
fromEnumValName :: Name
geAddrHashValName :: Name
geCharHashValName :: Name
geDoubleHashValName :: Name
geFloatHashValName :: Name
geIntHashValName :: Name
getTagValName :: Name
geWordHashValName :: Name
gtAddrHashValName :: Name
gtCharHashValName :: Name
gtDoubleHashValName :: Name
gtFloatHashValName :: Name
gtIntHashValName :: Name
gtWordHashValName :: Name
idValName :: Name
indexValName :: Name
inRangeValName :: Name
leAddrHashValName :: Name
leCharHashValName :: Name
leDoubleHashValName :: Name
leFloatHashValName :: Name
leIntHashValName :: Name
leWordHashValName :: Name
listValName :: Name
ltAddrHashValName :: Name
ltCharHashValName :: Name
ltDoubleHashValName :: Name
ltFloatHashValName :: Name
ltIntHashValName :: Name
ltWordHashValName :: Name
minBoundValName :: Name
mapValName :: Name
maxBoundValName :: Name
minusIntHashValName :: Name
neqIntHashValName :: Name
parenValName :: Name
parensValName :: Name
pfailValName :: Name
plusValName :: Name
precValName :: Name
predValName :: Name
rangeSizeValName :: Name
rangeValName :: Name
readFieldHash :: String -> ReadPrec a -> ReadPrec a
readFieldHashValName :: Name
readListValName :: Name
readListPrecDefaultValName :: Name
readListPrecValName :: Name
readPrec_to_SValName :: Name
readPrecValName :: Name
readS_to_PrecValName :: Name
readsPrecValName :: Name
replaceValName :: Name
resetValName :: Name
returnValName :: Name
seqValName :: Name
showCharValName :: Name
showListValName :: Name
showListWithValName :: Name
showParenValName :: Name
showsPrecValName :: Name
showSpaceValName :: Name
showStringValName :: Name
stepValName :: Name
succValName :: Name
tagToEnumHashValName :: Name
timesValName :: Name
toEnumValName :: Name
traverseValName :: Name
unsafeIndexValName :: Name
unsafeRangeSizeValName :: Name
unwrapMonadValName :: Name
boolTypeName :: Name
falseDataName :: Name
trueDataName :: Name
eqDataName :: Name
gtDataName :: Name
ltDataName :: Name
eqTypeName :: Name
ordTypeName :: Name
andValName :: Name
compareValName :: Name
eqValName :: Name
geValName :: Name
gtValName :: Name
leValName :: Name
ltValName :: Name
notValName :: Name
wHashDataName :: Name
expectPValName :: Name
allValName :: Name
apValName :: Name
pureValName :: Name
liftA2ValName :: Name
mappendValName :: Name
memptyValName :: Name
nullValName :: Name
eq1TypeName :: Name
ord1TypeName :: Name
read1TypeName :: Name
show1TypeName :: Name
eq2TypeName :: Name
ord2TypeName :: Name
read2TypeName :: Name
show2TypeName :: Name
liftEqValName :: Name
liftEq2ValName :: Name
liftCompareValName :: Name
liftCompare2ValName :: Name
liftReadsPrecValName :: Name
liftReadListValName :: Name
liftReadsPrec2ValName :: Name
liftReadList2ValName :: Name
liftShowListValName :: Name
liftShowsPrecValName :: Name
liftShowList2ValName :: Name
liftShowsPrec2ValName :: Name
coerceValName :: Name
liftReadListPrecDefaultValName :: Name
liftReadListPrec2DefaultValName :: Name
liftReadListPrecValName :: Name
liftReadListPrec2ValName :: Name
liftReadPrecValName :: Name
liftReadPrec2ValName :: Name
showCommaSpaceValName :: Name
appEndoValName :: Name
dualDataName :: Name
endoDataName :: Name
getDualValName :: Name
readFieldValName :: Name
readSymFieldValName :: Name
eqInt8HashValName :: Name
eqInt16HashValName :: Name
eqWord8HashValName :: Name
eqWord16HashValName :: Name
geInt8HashValName :: Name
geInt16HashValName :: Name
geWord8HashValName :: Name
geWord16HashValName :: Name
gtInt8HashValName :: Name
gtInt16HashValName :: Name
gtWord8HashValName :: Name
gtWord16HashValName :: Name
int8HashTypeName :: Name
int8ToIntHashValName :: Name
int16HashTypeName :: Name
int16ToIntHashValName :: Name
intToInt8HashValName :: Name
intToInt16HashValName :: Name
leInt8HashValName :: Name
leInt16HashValName :: Name
leWord8HashValName :: Name
leWord16HashValName :: Name
ltInt8HashValName :: Name
ltInt16HashValName :: Name
ltWord8HashValName :: Name
ltWord16HashValName :: Name
word8HashTypeName :: Name
word8ToWordHashValName :: Name
word16HashTypeName :: Name
word16ToWordHashValName :: Name
wordToWord8HashValName :: Name
wordToWord16HashValName :: Name
eqInt32HashValName :: Name
eqWord32HashValName :: Name
geInt32HashValName :: Name
geWord32HashValName :: Name
gtInt32HashValName :: Name
gtWord32HashValName :: Name
int32HashTypeName :: Name
int32ToIntHashValName :: Name
intToInt32HashValName :: Name
leInt32HashValName :: Name
leWord32HashValName :: Name
ltInt32HashValName :: Name
ltWord32HashValName :: Name
word32HashTypeName :: Name
word32ToWordHashValName :: Name
wordToWord32HashValName :: Name
instance GHC.Classes.Eq Data.Deriving.Internal.StarKindStatus


-- | Exports functions to mechanically derive <a>Bounded</a> instances.
--   
--   Note: this is an internal module, and as such, the API presented here
--   is not guaranteed to be stable, even between minor releases of this
--   library.
module Data.Bounded.Deriving.Internal

-- | Generates a <a>Bounded</a> instance declaration for the given data
--   type or data family instance.
deriveBounded :: Name -> Q [Dec]

-- | Generates a lambda expression which behaves like <a>minBound</a>
--   (without requiring a <a>Bounded</a> instance).
makeMinBound :: Name -> Q Exp

-- | Generates a lambda expression which behaves like <a>maxBound</a>
--   (without requiring a <a>Bounded</a> instance).
makeMaxBound :: Name -> Q Exp
instance Data.Deriving.Internal.ClassRep Data.Bounded.Deriving.Internal.BoundedClass


-- | Exports functions to mechanically derive <a>Bounded</a> instances.
module Data.Bounded.Deriving

-- | Generates a <a>Bounded</a> instance declaration for the given data
--   type or data family instance.
deriveBounded :: Name -> Q [Dec]

-- | Generates a lambda expression which behaves like <a>minBound</a>
--   (without requiring a <a>Bounded</a> instance).
makeMinBound :: Name -> Q Exp

-- | Generates a lambda expression which behaves like <a>maxBound</a>
--   (without requiring a <a>Bounded</a> instance).
makeMaxBound :: Name -> Q Exp


-- | On <tt>template-haskell-2.12</tt> or later (i.e., GHC 8.2 or later),
--   this module exports functionality which emulates the
--   <tt>GeneralizedNewtypeDeriving</tt> and <tt>DerivingVia</tt> GHC
--   extensions (the latter of which was introduced in GHC 8.6).
--   
--   On older versions of <tt>template-haskell</tt>/GHC, this module does
--   not export anything.
--   
--   Note: this is an internal module, and as such, the API presented here
--   is not guaranteed to be stable, even between minor releases of this
--   library.
module Data.Deriving.Via.Internal

-- | Generates an instance for a type class at a newtype by emulating the
--   behavior of the <tt>GeneralizedNewtypeDeriving</tt> extension. For
--   example:
--   
--   <pre>
--   newtype Foo a = MkFoo a
--   $(<a>deriveGND</a> [t| forall a. <a>Eq</a> a =&gt; <a>Eq</a> (Foo a) |])
--   </pre>
deriveGND :: Q Type -> Q [Dec]

-- | Generates an instance for a type class by emulating the behavior of
--   the <tt>DerivingVia</tt> extension. For example:
--   
--   <pre>
--   newtype Foo a = MkFoo a
--   $(<a>deriveVia</a> [t| forall a. <a>Ord</a> a =&gt; <a>Ord</a> (Foo a) <a>`Via`</a> Down a |])
--   </pre>
--   
--   As shown in the example above, the syntax is a tad strange. One must
--   specify the type by which to derive the instance using the <a>Via</a>
--   type. This requirement is in place to ensure that the type variables
--   are scoped correctly across all the types being used (e.g., to make
--   sure that the same <tt>a</tt> is used in <tt><a>Ord</a> a</tt>,
--   <tt><a>Ord</a> (Foo a)</tt>, and <tt>Down a</tt>).
deriveVia :: Q Type -> Q [Dec]
deriveViaDecs :: Type -> Maybe Type -> Q [Dec]
deriveViaDecs' :: Name -> [TyVarBndr_ flag] -> [Type] -> Type -> Dec -> Q (Maybe [Dec])
mkCoerceClassMethEqn :: [TyVarBndr_ flag] -> [Type] -> Type -> Type -> (Type, Type)
zipTvbSubst :: [TyVarBndr_ flag] -> [Type] -> Map Name Type

-- | Replace the last element of a list with another element.
changeLast :: [a] -> a -> [a]
stripOuterForallT :: Type -> Type
decomposeType :: Type -> ([TyVarBndrSpec], Cxt, Type)
newtypeRepType :: DatatypeVariant -> [ConstructorInfo] -> Maybe Type
etaReduce :: Int -> Type -> Maybe Type


-- | On <tt>template-haskell-2.12</tt> or later (i.e., GHC 8.2 or later),
--   this module exports functionality which emulates the
--   <tt>GeneralizedNewtypeDeriving</tt> and <tt>DerivingVia</tt> GHC
--   extensions (the latter of which was introduced in GHC 8.6).
--   
--   On older versions of <tt>template-haskell</tt>/GHC, this module does
--   not export anything.
module Data.Deriving.Via

-- | Generates an instance for a type class at a newtype by emulating the
--   behavior of the <tt>GeneralizedNewtypeDeriving</tt> extension. For
--   example:
--   
--   <pre>
--   newtype Foo a = MkFoo a
--   $(<a>deriveGND</a> [t| forall a. <a>Eq</a> a =&gt; <a>Eq</a> (Foo a) |])
--   </pre>
deriveGND :: Q Type -> Q [Dec]

-- | Generates an instance for a type class by emulating the behavior of
--   the <tt>DerivingVia</tt> extension. For example:
--   
--   <pre>
--   newtype Foo a = MkFoo a
--   $(<a>deriveVia</a> [t| forall a. <a>Ord</a> a =&gt; <a>Ord</a> (Foo a) <a>`Via`</a> Down a |])
--   </pre>
--   
--   As shown in the example above, the syntax is a tad strange. One must
--   specify the type by which to derive the instance using the <a>Via</a>
--   type. This requirement is in place to ensure that the type variables
--   are scoped correctly across all the types being used (e.g., to make
--   sure that the same <tt>a</tt> is used in <tt><a>Ord</a> a</tt>,
--   <tt><a>Ord</a> (Foo a)</tt>, and <tt>Down a</tt>).
deriveVia :: Q Type -> Q [Dec]

-- | A type-level modifier intended to be used in conjunction with
--   <tt>deriveVia</tt>. Refer to the documentation for <tt>deriveVia</tt>
--   for more details.
data a `Via` b
infix 0 `Via`


-- | Exports functions to mechanically derive <a>Enum</a> instances.
--   
--   Note: this is an internal module, and as such, the API presented here
--   is not guaranteed to be stable, even between minor releases of this
--   library.
module Data.Enum.Deriving.Internal

-- | Generates an <a>Enum</a> instance declaration for the given data type
--   or data family instance.
deriveEnum :: Name -> Q [Dec]

-- | Generates a lambda expression which behaves like <a>succ</a> (without
--   requiring an <a>Enum</a> instance).
makeSucc :: Name -> Q Exp

-- | Generates a lambda expression which behaves like <a>pred</a> (without
--   requiring an <a>Enum</a> instance).
makePred :: Name -> Q Exp

-- | Generates a lambda expression which behaves like <a>toEnum</a>
--   (without requiring an <a>Enum</a> instance).
makeToEnum :: Name -> Q Exp

-- | Generates a lambda expression which behaves like <a>fromEnum</a>
--   (without requiring an <a>Enum</a> instance).
makeFromEnum :: Name -> Q Exp

-- | Generates a lambda expression which behaves like <a>enumFrom</a>
--   (without requiring an <a>Enum</a> instance).
makeEnumFrom :: Name -> Q Exp

-- | Generates a lambda expression which behaves like <a>enumFromThen</a>
--   (without requiring an <a>Enum</a> instance).
makeEnumFromThen :: Name -> Q Exp
instance GHC.Show.Show Data.Enum.Deriving.Internal.EnumFun
instance Data.Deriving.Internal.ClassRep Data.Enum.Deriving.Internal.EnumClass


-- | Exports functions to mechanically derive <a>Enum</a> instances.
module Data.Enum.Deriving

-- | Generates an <a>Enum</a> instance declaration for the given data type
--   or data family instance.
deriveEnum :: Name -> Q [Dec]

-- | Generates a lambda expression which behaves like <a>succ</a> (without
--   requiring an <a>Enum</a> instance).
makeSucc :: Name -> Q Exp

-- | Generates a lambda expression which behaves like <a>pred</a> (without
--   requiring an <a>Enum</a> instance).
makePred :: Name -> Q Exp

-- | Generates a lambda expression which behaves like <a>toEnum</a>
--   (without requiring an <a>Enum</a> instance).
makeToEnum :: Name -> Q Exp

-- | Generates a lambda expression which behaves like <a>fromEnum</a>
--   (without requiring an <a>Enum</a> instance).
makeFromEnum :: Name -> Q Exp

-- | Generates a lambda expression which behaves like <a>enumFrom</a>
--   (without requiring an <a>Enum</a> instance).
makeEnumFrom :: Name -> Q Exp

-- | Generates a lambda expression which behaves like <a>enumFromThen</a>
--   (without requiring an <a>Enum</a> instance).
makeEnumFromThen :: Name -> Q Exp


-- | Exports functions to mechanically derive <a>EqClass</a>, <a>Eq1</a>,
--   and <a>Eq2</a> instances.
--   
--   Note: this is an internal module, and as such, the API presented here
--   is not guaranteed to be stable, even between minor releases of this
--   library.
module Data.Eq.Deriving.Internal

-- | Generates an <a>EqClass</a> instance declaration for the given data
--   type or data family instance.
deriveEq :: Name -> Q [Dec]

-- | Generates a lambda expression which behaves like <a>(==)</a> (without
--   requiring an <a>EqClass</a> instance).
makeEq :: Name -> Q Exp

-- | Generates a lambda expression which behaves like <a>(/=)</a> (without
--   requiring an <a>EqClass</a> instance).
makeNotEq :: Name -> Q Exp

-- | Generates an <a>Eq1</a> instance declaration for the given data type
--   or data family instance.
deriveEq1 :: Name -> Q [Dec]

-- | Generates a lambda expression which behaves like <tt>liftEq</tt>
--   (without requiring an <a>Eq1</a> instance).
--   
--   This function is not available with <tt>transformers-0.4</tt>.
makeLiftEq :: Name -> Q Exp

-- | Generates a lambda expression which behaves like <tt>eq1</tt> (without
--   requiring an <a>Eq1</a> instance).
makeEq1 :: Name -> Q Exp

-- | Generates an <a>Eq2</a> instance declaration for the given data type
--   or data family instance.
--   
--   This function is not available with <tt>transformers-0.4</tt>.
deriveEq2 :: Name -> Q [Dec]

-- | Generates a lambda expression which behaves like <tt>liftEq2</tt>
--   (without requiring an <a>Eq2</a> instance).
--   
--   This function is not available with <tt>transformers-0.4</tt>.
makeLiftEq2 :: Name -> Q Exp

-- | Generates a lambda expression which behaves like <tt>eq2</tt> (without
--   requiring an <a>Eq2</a> instance).
--   
--   This function is not available with <tt>transformers-0.4</tt>.
makeEq2 :: Name -> Q Exp
instance GHC.Enum.Enum Data.Eq.Deriving.Internal.EqClass
instance GHC.Enum.Bounded Data.Eq.Deriving.Internal.EqClass
instance Data.Deriving.Internal.ClassRep Data.Eq.Deriving.Internal.EqClass


-- | Exports functions to mechanically derive <a>Eq</a>, <tt>Eq1</tt>, and
--   <tt>Eq2</tt> instances. Note that upstream GHC does not have the
--   ability to derive <tt>Eq1</tt> or <tt>Eq2</tt> instances, but since
--   the functionality to derive <a>Eq</a> extends very naturally
--   <tt>Eq1</tt> and <tt>Eq2</tt>, the ability to derive the latter two
--   classes is provided as a convenience.
module Data.Eq.Deriving

-- | Generates an <a>EqClass</a> instance declaration for the given data
--   type or data family instance.
deriveEq :: Name -> Q [Dec]

-- | Generates a lambda expression which behaves like <a>(==)</a> (without
--   requiring an <a>EqClass</a> instance).
makeEq :: Name -> Q Exp

-- | Generates a lambda expression which behaves like <a>(/=)</a> (without
--   requiring an <a>EqClass</a> instance).
makeNotEq :: Name -> Q Exp

-- | Generates an <a>Eq1</a> instance declaration for the given data type
--   or data family instance.
deriveEq1 :: Name -> Q [Dec]

-- | Generates a lambda expression which behaves like <tt>liftEq</tt>
--   (without requiring an <a>Eq1</a> instance).
--   
--   This function is not available with <tt>transformers-0.4</tt>.
makeLiftEq :: Name -> Q Exp

-- | Generates a lambda expression which behaves like <tt>eq1</tt> (without
--   requiring an <a>Eq1</a> instance).
makeEq1 :: Name -> Q Exp

-- | Generates an <a>Eq2</a> instance declaration for the given data type
--   or data family instance.
--   
--   This function is not available with <tt>transformers-0.4</tt>.
deriveEq2 :: Name -> Q [Dec]

-- | Generates a lambda expression which behaves like <tt>liftEq2</tt>
--   (without requiring an <a>Eq2</a> instance).
--   
--   This function is not available with <tt>transformers-0.4</tt>.
makeLiftEq2 :: Name -> Q Exp

-- | Generates a lambda expression which behaves like <tt>eq2</tt> (without
--   requiring an <a>Eq2</a> instance).
--   
--   This function is not available with <tt>transformers-0.4</tt>.
makeEq2 :: Name -> Q Exp


-- | The machinery needed to derive <a>FunctorClass</a>,
--   <a>FunctorClass</a>, and <a>FunctorClass</a> instances.
--   
--   For more info on how deriving <tt>Functor</tt> works, see <a>this GHC
--   wiki page</a>.
--   
--   Note: this is an internal module, and as such, the API presented here
--   is not guaranteed to be stable, even between minor releases of this
--   library.
module Data.Functor.Deriving.Internal

-- | Generates a <a>FunctorClass</a> instance declaration for the given
--   data type or data family instance.
deriveFoldable :: Name -> Q [Dec]

-- | Like <a>deriveFoldable</a>, but takes an <a>FFTOptions</a> argument.
deriveFoldableOptions :: FFTOptions -> Name -> Q [Dec]

-- | Generates a lambda expression which behaves like <a>foldMap</a>
--   (without requiring a <a>FunctorClass</a> instance).
makeFoldMap :: Name -> Q Exp

-- | Like <a>makeFoldMap</a>, but takes an <a>FFTOptions</a> argument.
makeFoldMapOptions :: FFTOptions -> Name -> Q Exp

-- | Generates a lambda expression which behaves like <a>foldr</a> (without
--   requiring a <a>FunctorClass</a> instance).
makeFoldr :: Name -> Q Exp

-- | Like <a>makeFoldr</a>, but takes an <a>FFTOptions</a> argument.
makeFoldrOptions :: FFTOptions -> Name -> Q Exp

-- | Generates a lambda expression which behaves like <tt>fold</tt>
--   (without requiring a <a>FunctorClass</a> instance).
makeFold :: Name -> Q Exp

-- | Like <a>makeFold</a>, but takes an <a>FFTOptions</a> argument.
makeFoldOptions :: FFTOptions -> Name -> Q Exp

-- | Generates a lambda expression which behaves like <a>foldl</a> (without
--   requiring a <a>FunctorClass</a> instance).
makeFoldl :: Name -> Q Exp

-- | Like <a>makeFoldl</a>, but takes an <a>FFTOptions</a> argument.
makeFoldlOptions :: FFTOptions -> Name -> Q Exp

-- | Generates a lambda expression which behaves like <a>null</a> (without
--   requiring a <a>FunctorClass</a> instance).
makeNull :: Name -> Q Exp

-- | Like <a>makeNull</a>, but takes an <a>FFTOptions</a> argument.
makeNullOptions :: FFTOptions -> Name -> Q Exp

-- | Generates a <a>FunctorClass</a> instance declaration for the given
--   data type or data family instance.
deriveFunctor :: Name -> Q [Dec]

-- | Like <a>deriveFunctor</a>, but takes an <a>FFTOptions</a> argument.
deriveFunctorOptions :: FFTOptions -> Name -> Q [Dec]

-- | Generates a lambda expression which behaves like <a>fmap</a> (without
--   requiring a <a>FunctorClass</a> instance).
makeFmap :: Name -> Q Exp

-- | Like <a>makeFmap</a>, but takes an <a>FFTOptions</a> argument.
makeFmapOptions :: FFTOptions -> Name -> Q Exp

-- | Generates a lambda expression which behaves like (<a>&lt;$</a>)
--   (without requiring a <a>FunctorClass</a> instance).
makeReplace :: Name -> Q Exp

-- | Like <a>makeReplace</a>, but takes an <a>FFTOptions</a> argument.
makeReplaceOptions :: FFTOptions -> Name -> Q Exp

-- | Generates a <a>FunctorClass</a> instance declaration for the given
--   data type or data family instance.
deriveTraversable :: Name -> Q [Dec]

-- | Like <tt>deriveTraverse</tt>, but takes an <a>FFTOptions</a> argument.
deriveTraversableOptions :: FFTOptions -> Name -> Q [Dec]

-- | Generates a lambda expression which behaves like <a>traverse</a>
--   (without requiring a <a>FunctorClass</a> instance).
makeTraverse :: Name -> Q Exp

-- | Like <a>makeTraverse</a>, but takes an <a>FFTOptions</a> argument.
makeTraverseOptions :: FFTOptions -> Name -> Q Exp

-- | Generates a lambda expression which behaves like <a>sequenceA</a>
--   (without requiring a <a>FunctorClass</a> instance).
makeSequenceA :: Name -> Q Exp

-- | Like <a>makeSequenceA</a>, but takes an <a>FFTOptions</a> argument.
makeSequenceAOptions :: FFTOptions -> Name -> Q Exp

-- | Generates a lambda expression which behaves like <a>mapM</a> (without
--   requiring a <a>FunctorClass</a> instance).
makeMapM :: Name -> Q Exp

-- | Like <a>makeMapM</a>, but takes an <a>FFTOptions</a> argument.
makeMapMOptions :: FFTOptions -> Name -> Q Exp

-- | Generates a lambda expression which behaves like <a>sequence</a>
--   (without requiring a <a>FunctorClass</a> instance).
makeSequence :: Name -> Q Exp

-- | Like <a>makeSequence</a>, but takes an <a>FFTOptions</a> argument.
makeSequenceOptions :: FFTOptions -> Name -> Q Exp

-- | Options that further configure how the functions in
--   <a>Data.Functor.Deriving</a> should behave. (<tt>FFT</tt> stands for
--   <a>FunctorClass</a><i><a>FunctorClass</a></i><a>FunctorClass</a>.)
newtype FFTOptions
FFTOptions :: Bool -> FFTOptions

-- | If <a>True</a>, derived instances for empty data types (i.e., ones
--   with no data constructors) will use the <tt>EmptyCase</tt> language
--   extension. If <a>False</a>, derived instances will simply use
--   <a>seq</a> instead. (This has no effect on GHCs before 7.8, since
--   <tt>EmptyCase</tt> is only available in 7.8 or later.)
[fftEmptyCaseBehavior] :: FFTOptions -> Bool

-- | Conservative <a>FFTOptions</a> that doesn't attempt to use
--   <tt>EmptyCase</tt> (to prevent users from having to enable that
--   extension at use sites.)
defaultFFTOptions :: FFTOptions
instance GHC.Show.Show Data.Functor.Deriving.Internal.FFTOptions
instance GHC.Read.Read Data.Functor.Deriving.Internal.FFTOptions
instance GHC.Classes.Ord Data.Functor.Deriving.Internal.FFTOptions
instance GHC.Classes.Eq Data.Functor.Deriving.Internal.FFTOptions
instance GHC.Classes.Eq Data.Functor.Deriving.Internal.FunctorFun
instance GHC.Show.Show Data.Functor.Deriving.Internal.FunctorFun
instance Data.Deriving.Internal.ClassRep Data.Functor.Deriving.Internal.FunctorClass


-- | Exports functions to mechanically derive <a>Functor</a> instances.
--   
--   For more info on how deriving <tt>Functor</tt> works, see <a>this GHC
--   wiki page</a>.
module Data.Functor.Deriving

-- | Generates a <a>FunctorClass</a> instance declaration for the given
--   data type or data family instance.
deriveFunctor :: Name -> Q [Dec]

-- | Like <a>deriveFunctor</a>, but takes an <a>FFTOptions</a> argument.
deriveFunctorOptions :: FFTOptions -> Name -> Q [Dec]

-- | Generates a lambda expression which behaves like <a>fmap</a> (without
--   requiring a <a>FunctorClass</a> instance).
makeFmap :: Name -> Q Exp

-- | Like <a>makeFmap</a>, but takes an <a>FFTOptions</a> argument.
makeFmapOptions :: FFTOptions -> Name -> Q Exp

-- | Generates a lambda expression which behaves like (<a>&lt;$</a>)
--   (without requiring a <a>FunctorClass</a> instance).
makeReplace :: Name -> Q Exp

-- | Like <a>makeReplace</a>, but takes an <a>FFTOptions</a> argument.
makeReplaceOptions :: FFTOptions -> Name -> Q Exp

-- | Options that further configure how the functions in
--   <a>Data.Functor.Deriving</a> should behave. (<tt>FFT</tt> stands for
--   <a>FunctorClass</a><i><a>FunctorClass</a></i><a>FunctorClass</a>.)
newtype FFTOptions
FFTOptions :: Bool -> FFTOptions

-- | If <a>True</a>, derived instances for empty data types (i.e., ones
--   with no data constructors) will use the <tt>EmptyCase</tt> language
--   extension. If <a>False</a>, derived instances will simply use
--   <a>seq</a> instead. (This has no effect on GHCs before 7.8, since
--   <tt>EmptyCase</tt> is only available in 7.8 or later.)
[fftEmptyCaseBehavior] :: FFTOptions -> Bool

-- | Conservative <a>FFTOptions</a> that doesn't attempt to use
--   <tt>EmptyCase</tt> (to prevent users from having to enable that
--   extension at use sites.)
defaultFFTOptions :: FFTOptions


-- | Exports functions to mechanically derive <a>Foldable</a> instances in
--   a way that mimics how the <tt>-XDeriveFoldable</tt> extension works
--   since GHC 8.0.
--   
--   These changes make it possible to derive <tt>Foldable</tt> instances
--   for data types with existential constraints, e.g.,
--   
--   <pre>
--   data WrappedSet a where
--       WrapSet :: Ord a =&gt; a -&gt; WrappedSet a
--   
--   deriving instance Foldable WrappedSet -- On GHC 8.0  on later
--   $(deriveFoldable ''WrappedSet)        -- On GHC 7.10 and earlier
--   </pre>
--   
--   In addition, derived <a>Foldable</a> instances from this module do not
--   generate superfluous <a>mempty</a> expressions in its implementation
--   of <a>foldMap</a>. One can verify this by compiling a module that uses
--   <a>deriveFoldable</a> with the <tt>-ddump-splices</tt> GHC flag.
--   
--   For more info on these changes, see <a>this GHC wiki page</a>.
module Data.Foldable.Deriving

-- | Generates a <a>FunctorClass</a> instance declaration for the given
--   data type or data family instance.
deriveFoldable :: Name -> Q [Dec]

-- | Like <a>deriveFoldable</a>, but takes an <a>FFTOptions</a> argument.
deriveFoldableOptions :: FFTOptions -> Name -> Q [Dec]

-- | Generates a lambda expression which behaves like <a>foldMap</a>
--   (without requiring a <a>FunctorClass</a> instance).
makeFoldMap :: Name -> Q Exp

-- | Like <a>makeFoldMap</a>, but takes an <a>FFTOptions</a> argument.
makeFoldMapOptions :: FFTOptions -> Name -> Q Exp

-- | Generates a lambda expression which behaves like <a>foldr</a> (without
--   requiring a <a>FunctorClass</a> instance).
makeFoldr :: Name -> Q Exp

-- | Like <a>makeFoldr</a>, but takes an <a>FFTOptions</a> argument.
makeFoldrOptions :: FFTOptions -> Name -> Q Exp

-- | Generates a lambda expression which behaves like <tt>fold</tt>
--   (without requiring a <a>FunctorClass</a> instance).
makeFold :: Name -> Q Exp

-- | Like <a>makeFold</a>, but takes an <a>FFTOptions</a> argument.
makeFoldOptions :: FFTOptions -> Name -> Q Exp

-- | Generates a lambda expression which behaves like <a>foldl</a> (without
--   requiring a <a>FunctorClass</a> instance).
makeFoldl :: Name -> Q Exp

-- | Like <a>makeFoldl</a>, but takes an <a>FFTOptions</a> argument.
makeFoldlOptions :: FFTOptions -> Name -> Q Exp

-- | Generates a lambda expression which behaves like <a>null</a> (without
--   requiring a <a>FunctorClass</a> instance).
makeNull :: Name -> Q Exp

-- | Like <a>makeNull</a>, but takes an <a>FFTOptions</a> argument.
makeNullOptions :: FFTOptions -> Name -> Q Exp

-- | Options that further configure how the functions in
--   <a>Data.Functor.Deriving</a> should behave. (<tt>FFT</tt> stands for
--   <a>FunctorClass</a><i><a>FunctorClass</a></i><a>FunctorClass</a>.)
newtype FFTOptions
FFTOptions :: Bool -> FFTOptions

-- | If <a>True</a>, derived instances for empty data types (i.e., ones
--   with no data constructors) will use the <tt>EmptyCase</tt> language
--   extension. If <a>False</a>, derived instances will simply use
--   <a>seq</a> instead. (This has no effect on GHCs before 7.8, since
--   <tt>EmptyCase</tt> is only available in 7.8 or later.)
[fftEmptyCaseBehavior] :: FFTOptions -> Bool

-- | Conservative <a>FFTOptions</a> that doesn't attempt to use
--   <tt>EmptyCase</tt> (to prevent users from having to enable that
--   extension at use sites.)
defaultFFTOptions :: FFTOptions


-- | Exports functions to mechanically derive <tt>Ix</tt> instances.
--   
--   Note: this is an internal module, and as such, the API presented here
--   is not guaranteed to be stable, even between minor releases of this
--   library.
module Data.Ix.Deriving.Internal

-- | Generates a <tt>Ix</tt> instance declaration for the given data type
--   or data family instance.
deriveIx :: Name -> Q [Dec]

-- | Generates a lambda expression which behaves like <tt>range</tt>
--   (without requiring an <tt>Ix</tt> instance).
makeRange :: Name -> Q Exp

-- | Generates a lambda expression which behaves like <tt>unsafeIndex</tt>
--   (without requiring an <tt>Ix</tt> instance).
makeUnsafeIndex :: Name -> Q Exp

-- | Generates a lambda expression which behaves like <tt>inRange</tt>
--   (without requiring an <tt>Ix</tt> instance).
makeInRange :: Name -> Q Exp
instance GHC.Show.Show Data.Ix.Deriving.Internal.IxFun
instance Data.Deriving.Internal.ClassRep Data.Ix.Deriving.Internal.IxClass


-- | Exports functions to mechanically derive <tt>Ix</tt> instances.
module Data.Ix.Deriving

-- | Generates a <tt>Ix</tt> instance declaration for the given data type
--   or data family instance.
deriveIx :: Name -> Q [Dec]

-- | Generates a lambda expression which behaves like <tt>range</tt>
--   (without requiring an <tt>Ix</tt> instance).
makeRange :: Name -> Q Exp

-- | Generates a lambda expression which behaves like <tt>unsafeIndex</tt>
--   (without requiring an <tt>Ix</tt> instance).
makeUnsafeIndex :: Name -> Q Exp

-- | Generates a lambda expression which behaves like <tt>inRange</tt>
--   (without requiring an <tt>Ix</tt> instance).
makeInRange :: Name -> Q Exp


-- | Exports functions to mechanically derive <a>OrdClass</a>, <a>Ord1</a>,
--   and <a>Ord2</a> instances.
--   
--   Note: this is an internal module, and as such, the API presented here
--   is not guaranteed to be stable, even between minor releases of this
--   library.
module Data.Ord.Deriving.Internal

-- | Generates an <a>OrdClass</a> instance declaration for the given data
--   type or data family instance.
deriveOrd :: Name -> Q [Dec]

-- | Generates a lambda expression which behaves like <a>compare</a>
--   (without requiring an <a>OrdClass</a> instance).
makeCompare :: Name -> Q Exp

-- | Generates a lambda expression which behaves like <a>(&lt;=)</a>
--   (without requiring an <a>OrdClass</a> instance).
makeLE :: Name -> Q Exp

-- | Generates a lambda expression which behaves like <a>(&lt;)</a>
--   (without requiring an <a>OrdClass</a> instance).
makeLT :: Name -> Q Exp

-- | Generates a lambda expression which behaves like <a>(&gt;)</a>
--   (without requiring an <a>OrdClass</a> instance).
makeGT :: Name -> Q Exp

-- | Generates a lambda expression which behaves like <a>(&gt;=)</a>
--   (without requiring an <a>OrdClass</a> instance).
makeGE :: Name -> Q Exp

-- | Generates a lambda expression which behaves like <a>max</a> (without
--   requiring an <a>OrdClass</a> instance).
makeMax :: Name -> Q Exp

-- | Generates a lambda expression which behaves like <a>min</a> (without
--   requiring an <a>OrdClass</a> instance).
makeMin :: Name -> Q Exp

-- | Generates an <a>Ord1</a> instance declaration for the given data type
--   or data family instance.
deriveOrd1 :: Name -> Q [Dec]

-- | Generates a lambda expression which behaves like <tt>liftCompare</tt>
--   (without requiring an <a>Ord1</a> instance).
--   
--   This function is not available with <tt>transformers-0.4</tt>.
makeLiftCompare :: Name -> Q Exp

-- | Generates a lambda expression which behaves like <tt>compare1</tt>
--   (without requiring an <a>Ord1</a> instance).
makeCompare1 :: Name -> Q Exp

-- | Generates an <a>Ord2</a> instance declaration for the given data type
--   or data family instance.
--   
--   This function is not available with <tt>transformers-0.4</tt>.
deriveOrd2 :: Name -> Q [Dec]

-- | Generates a lambda expression which behaves like <tt>liftCompare2</tt>
--   (without requiring an <a>Ord2</a> instance).
--   
--   This function is not available with <tt>transformers-0.4</tt>.
makeLiftCompare2 :: Name -> Q Exp

-- | Generates a lambda expression which behaves like <tt>compare2</tt>
--   (without requiring an <a>Ord2</a> instance).
--   
--   This function is not available with <tt>transformers-0.4</tt>.
makeCompare2 :: Name -> Q Exp
instance GHC.Enum.Enum Data.Ord.Deriving.Internal.OrdClass
instance GHC.Enum.Bounded Data.Ord.Deriving.Internal.OrdClass
instance GHC.Classes.Eq Data.Ord.Deriving.Internal.OrdFun
instance Data.Deriving.Internal.ClassRep Data.Ord.Deriving.Internal.OrdClass


-- | Exports functions to mechanically derive <a>Ord</a>, <tt>Ord1</tt>,
--   and <tt>Ord2</tt> instances. Note that upstream GHC does not have the
--   ability to derive <tt>Ord1</tt> or <tt>Ord2</tt> instances, but since
--   the functionality to derive <a>Ord</a> extends very naturally
--   <tt>Ord1</tt> and <tt>Ord2</tt>, the ability to derive the latter two
--   classes is provided as a convenience.
module Data.Ord.Deriving

-- | Generates an <a>OrdClass</a> instance declaration for the given data
--   type or data family instance.
deriveOrd :: Name -> Q [Dec]

-- | Generates a lambda expression which behaves like <a>compare</a>
--   (without requiring an <a>OrdClass</a> instance).
makeCompare :: Name -> Q Exp

-- | Generates a lambda expression which behaves like <a>(&lt;)</a>
--   (without requiring an <a>OrdClass</a> instance).
makeLT :: Name -> Q Exp

-- | Generates a lambda expression which behaves like <a>(&lt;=)</a>
--   (without requiring an <a>OrdClass</a> instance).
makeLE :: Name -> Q Exp

-- | Generates a lambda expression which behaves like <a>(&gt;)</a>
--   (without requiring an <a>OrdClass</a> instance).
makeGT :: Name -> Q Exp

-- | Generates a lambda expression which behaves like <a>(&gt;=)</a>
--   (without requiring an <a>OrdClass</a> instance).
makeGE :: Name -> Q Exp

-- | Generates a lambda expression which behaves like <a>max</a> (without
--   requiring an <a>OrdClass</a> instance).
makeMax :: Name -> Q Exp

-- | Generates a lambda expression which behaves like <a>min</a> (without
--   requiring an <a>OrdClass</a> instance).
makeMin :: Name -> Q Exp

-- | Generates an <a>Ord1</a> instance declaration for the given data type
--   or data family instance.
deriveOrd1 :: Name -> Q [Dec]

-- | Generates a lambda expression which behaves like <tt>liftCompare</tt>
--   (without requiring an <a>Ord1</a> instance).
--   
--   This function is not available with <tt>transformers-0.4</tt>.
makeLiftCompare :: Name -> Q Exp

-- | Generates a lambda expression which behaves like <tt>compare1</tt>
--   (without requiring an <a>Ord1</a> instance).
makeCompare1 :: Name -> Q Exp

-- | Generates an <a>Ord2</a> instance declaration for the given data type
--   or data family instance.
--   
--   This function is not available with <tt>transformers-0.4</tt>.
deriveOrd2 :: Name -> Q [Dec]

-- | Generates a lambda expression which behaves like <tt>liftCompare2</tt>
--   (without requiring an <a>Ord2</a> instance).
--   
--   This function is not available with <tt>transformers-0.4</tt>.
makeLiftCompare2 :: Name -> Q Exp

-- | Generates a lambda expression which behaves like <tt>compare2</tt>
--   (without requiring an <a>Ord2</a> instance).
--   
--   This function is not available with <tt>transformers-0.4</tt>.
makeCompare2 :: Name -> Q Exp


-- | Exports functions to mechanically derive <a>Traversable</a> instances
--   in a way that mimics how the <tt>-XDeriveTraversable</tt> extension
--   works since GHC 8.0.
--   
--   Derived <a>Traversable</a> instances from this module do not generate
--   superfluous <a>pure</a> expressions in its implementation of
--   <a>traverse</a>. One can verify this by compiling a module that uses
--   <a>deriveTraversable</a> with the <tt>-ddump-splices</tt> GHC flag.
--   
--   These changes make it possible to derive <tt>Traversable</tt>
--   instances for data types with unlifted argument types, e.g.,
--   
--   <pre>
--   data IntHash a = IntHash Int# a
--   
--   deriving instance Traversable IntHash -- On GHC 8.0  on later
--   $(deriveTraversable ''IntHash)        -- On GHC 7.10 and earlier
--   </pre>
--   
--   For more info on these changes, see <a>this GHC wiki page</a>.
module Data.Traversable.Deriving

-- | Generates a <a>FunctorClass</a> instance declaration for the given
--   data type or data family instance.
deriveTraversable :: Name -> Q [Dec]

-- | Like <tt>deriveTraverse</tt>, but takes an <a>FFTOptions</a> argument.
deriveTraversableOptions :: FFTOptions -> Name -> Q [Dec]

-- | Generates a lambda expression which behaves like <a>traverse</a>
--   (without requiring a <a>FunctorClass</a> instance).
makeTraverse :: Name -> Q Exp

-- | Like <a>makeTraverse</a>, but takes an <a>FFTOptions</a> argument.
makeTraverseOptions :: FFTOptions -> Name -> Q Exp

-- | Generates a lambda expression which behaves like <a>sequenceA</a>
--   (without requiring a <a>FunctorClass</a> instance).
makeSequenceA :: Name -> Q Exp

-- | Like <a>makeSequenceA</a>, but takes an <a>FFTOptions</a> argument.
makeSequenceAOptions :: FFTOptions -> Name -> Q Exp

-- | Generates a lambda expression which behaves like <a>mapM</a> (without
--   requiring a <a>FunctorClass</a> instance).
makeMapM :: Name -> Q Exp

-- | Like <a>makeMapM</a>, but takes an <a>FFTOptions</a> argument.
makeMapMOptions :: FFTOptions -> Name -> Q Exp

-- | Generates a lambda expression which behaves like <a>sequence</a>
--   (without requiring a <a>FunctorClass</a> instance).
makeSequence :: Name -> Q Exp

-- | Like <a>makeSequence</a>, but takes an <a>FFTOptions</a> argument.
makeSequenceOptions :: FFTOptions -> Name -> Q Exp

-- | Options that further configure how the functions in
--   <a>Data.Functor.Deriving</a> should behave. (<tt>FFT</tt> stands for
--   <a>FunctorClass</a><i><a>FunctorClass</a></i><a>FunctorClass</a>.)
newtype FFTOptions
FFTOptions :: Bool -> FFTOptions

-- | If <a>True</a>, derived instances for empty data types (i.e., ones
--   with no data constructors) will use the <tt>EmptyCase</tt> language
--   extension. If <a>False</a>, derived instances will simply use
--   <a>seq</a> instead. (This has no effect on GHCs before 7.8, since
--   <tt>EmptyCase</tt> is only available in 7.8 or later.)
[fftEmptyCaseBehavior] :: FFTOptions -> Bool

-- | Conservative <a>FFTOptions</a> that doesn't attempt to use
--   <tt>EmptyCase</tt> (to prevent users from having to enable that
--   extension at use sites.)
defaultFFTOptions :: FFTOptions


-- | Exports functions to mechanically derive <a>ReadClass</a>,
--   <a>Read1</a>, and <a>Read2</a> instances.
--   
--   Note: this is an internal module, and as such, the API presented here
--   is not guaranteed to be stable, even between minor releases of this
--   library.
module Text.Read.Deriving.Internal

-- | Generates a <a>ReadClass</a> instance declaration for the given data
--   type or data family instance.
deriveRead :: Name -> Q [Dec]

-- | Like <a>deriveRead</a>, but takes a <a>ReadOptions</a> argument.
deriveReadOptions :: ReadOptions -> Name -> Q [Dec]

-- | Generates a lambda expression which behaves like <a>readsPrec</a>
--   (without requiring a <a>ReadClass</a> instance).
makeReadsPrec :: Name -> Q Exp

-- | Generates a lambda expression which behaves like <tt>readPrec</tt>
--   (without requiring a <a>ReadClass</a> instance).
makeReadPrec :: Name -> Q Exp

-- | Generates a <a>Read1</a> instance declaration for the given data type
--   or data family instance.
deriveRead1 :: Name -> Q [Dec]

-- | Like <a>deriveRead1</a>, but takes a <a>ReadOptions</a> argument.
deriveRead1Options :: ReadOptions -> Name -> Q [Dec]

-- | Generates a lambda expression which behaves like
--   <tt>liftReadsPrec</tt> (without requiring a <a>Read1</a> instance).
--   
--   This function is not available with <tt>transformers-0.4</tt>.
makeLiftReadsPrec :: Name -> Q Exp

-- | Generates a lambda expression which behaves like <tt>liftReadPrec</tt>
--   (without requiring a <a>Read1</a> instance).
--   
--   This function is only available with <tt>base-4.10</tt> or later.
makeLiftReadPrec :: Name -> Q Exp

-- | Generates a lambda expression which behaves like <tt>readPrec1</tt>
--   (without requiring a <a>Read1</a> instance).
--   
--   This function is only available with <tt>base-4.10</tt> or later.
makeReadPrec1 :: Name -> Q Exp

-- | Generates a lambda expression which behaves like <tt>readsPrec1</tt>
--   (without requiring a <a>Read1</a> instance).
makeReadsPrec1 :: Name -> Q Exp

-- | Generates a <a>Read2</a> instance declaration for the given data type
--   or data family instance.
--   
--   This function is not available with <tt>transformers-0.4</tt>.
deriveRead2 :: Name -> Q [Dec]

-- | Like <a>deriveRead2</a>, but takes a <a>ReadOptions</a> argument.
--   
--   This function is not available with <tt>transformers-0.4</tt>.
deriveRead2Options :: ReadOptions -> Name -> Q [Dec]

-- | Generates a lambda expression which behaves like
--   <tt>liftReadsPrec2</tt> (without requiring a <a>Read2</a> instance).
--   
--   This function is not available with <tt>transformers-0.4</tt>.
makeLiftReadsPrec2 :: Name -> Q Exp

-- | Generates a lambda expression which behaves like
--   <tt>liftReadPrec2</tt> (without requiring a <a>Read2</a> instance).
--   
--   This function is only available with <tt>base-4.10</tt> or later.
makeLiftReadPrec2 :: Name -> Q Exp

-- | Generates a lambda expression which behaves like <tt>readPrec2</tt>
--   (without requiring a <a>Read2</a> instance).
--   
--   This function is only available with <tt>base-4.10</tt> or later.
makeReadPrec2 :: Name -> Q Exp

-- | Generates a lambda expression which behaves like <tt>readsPrec2</tt>
--   (without requiring a <a>Read2</a> instance).
--   
--   This function is not available with <tt>transformers-0.4</tt>.
makeReadsPrec2 :: Name -> Q Exp

-- | Options that further configure how the functions in
--   <a>Text.Read.Deriving</a> should behave.
newtype ReadOptions
ReadOptions :: Bool -> ReadOptions

-- | If <a>True</a>:
--   
--   <ul>
--   <li>Derived <a>ReadClass</a> instances will implement
--   <tt>readPrec</tt>, not <a>readsPrec</a>, and will provide a default
--   implementation of <tt>readListPrec</tt> in terms of
--   <tt>readPrec</tt>.</li>
--   <li>If built against <tt>base-4.10</tt> or later, derived
--   <a>Read1</a>/<a>Read2</a> instances will implement
--   <tt>liftReadPrec</tt>/<tt>liftReadPrec2</tt>, not
--   <tt>liftReadsPrec</tt>/<tt>liftReadsPrec2</tt>, and will provide
--   default implementations of
--   <tt>liftReadListPrec</tt>/<tt>liftReadListPrec2</tt> in terms of
--   <tt>liftReadPrec</tt>/<tt>liftReadPrec2</tt>. If built against an
--   earlier version of <tt>base</tt>, derived <a>Read1</a>/<a>Read2</a>
--   instances are not affected, so they will act as if this flag were
--   <a>False</a>.</li>
--   </ul>
--   
--   If <a>False</a>:
--   
--   <ul>
--   <li>Derived <a>ReadClass</a> instances will implement
--   <a>readsPrec</a>.</li>
--   <li>Derived <a>Read1</a> instances will implement <tt>readsPrec1</tt>
--   (if built against <tt>transformers-0.4</tt>) or <tt>liftReadsPrec</tt>
--   (otherwise). If not built against <tt>transformers-0.4</tt>, derived
--   <a>Read2</a> instances will implement <tt>liftReadsPrec2</tt>.</li>
--   </ul>
--   
--   It's generally a good idea to enable this option, since
--   <tt>readPrec</tt> and friends are more efficient than <a>readsPrec</a>
--   and friends, since the former use the efficient <tt>ReadPrec</tt>
--   parser datatype while the latter use the slower, list-based
--   <a>ReadS</a> type.
[useReadPrec] :: ReadOptions -> Bool

-- | <a>ReadOptions</a> that favor <tt>readPrec</tt> over <a>readsPrec</a>.
defaultReadOptions :: ReadOptions
instance GHC.Show.Show Text.Read.Deriving.Internal.ReadOptions
instance GHC.Read.Read Text.Read.Deriving.Internal.ReadOptions
instance GHC.Classes.Ord Text.Read.Deriving.Internal.ReadOptions
instance GHC.Classes.Eq Text.Read.Deriving.Internal.ReadOptions
instance GHC.Enum.Enum Text.Read.Deriving.Internal.ReadClass
instance GHC.Enum.Bounded Text.Read.Deriving.Internal.ReadClass
instance Data.Deriving.Internal.ClassRep Text.Read.Deriving.Internal.ReadClass


-- | Exports functions to mechanically derive <a>Read</a>, <tt>Read1</tt>,
--   and <tt>Read2</tt> instances. Note that upstream GHC does not have the
--   ability to derive <tt>Read1</tt> or <tt>Read2</tt> instances, but
--   since the functionality to derive <a>Read</a> extends very naturally
--   <tt>Read1</tt> and <tt>Read2</tt>, the ability to derive the latter
--   two classes is provided as a convenience.
module Text.Read.Deriving

-- | Generates a <a>ReadClass</a> instance declaration for the given data
--   type or data family instance.
deriveRead :: Name -> Q [Dec]

-- | Like <a>deriveRead</a>, but takes a <a>ReadOptions</a> argument.
deriveReadOptions :: ReadOptions -> Name -> Q [Dec]

-- | Generates a lambda expression which behaves like <a>readsPrec</a>
--   (without requiring a <a>ReadClass</a> instance).
makeReadsPrec :: Name -> Q Exp

-- | Generates a lambda expression which behaves like <tt>readPrec</tt>
--   (without requiring a <a>ReadClass</a> instance).
makeReadPrec :: Name -> Q Exp

-- | Generates a <a>Read1</a> instance declaration for the given data type
--   or data family instance.
deriveRead1 :: Name -> Q [Dec]

-- | Like <a>deriveRead1</a>, but takes a <a>ReadOptions</a> argument.
deriveRead1Options :: ReadOptions -> Name -> Q [Dec]

-- | Generates a lambda expression which behaves like
--   <tt>liftReadsPrec</tt> (without requiring a <a>Read1</a> instance).
--   
--   This function is not available with <tt>transformers-0.4</tt>.
makeLiftReadsPrec :: Name -> Q Exp

-- | Generates a lambda expression which behaves like <tt>liftReadPrec</tt>
--   (without requiring a <a>Read1</a> instance).
--   
--   This function is only available with <tt>base-4.10</tt> or later.
makeLiftReadPrec :: Name -> Q Exp

-- | Generates a lambda expression which behaves like <tt>readPrec1</tt>
--   (without requiring a <a>Read1</a> instance).
--   
--   This function is only available with <tt>base-4.10</tt> or later.
makeReadPrec1 :: Name -> Q Exp

-- | Generates a lambda expression which behaves like <tt>readsPrec1</tt>
--   (without requiring a <a>Read1</a> instance).
makeReadsPrec1 :: Name -> Q Exp

-- | Generates a <a>Read2</a> instance declaration for the given data type
--   or data family instance.
--   
--   This function is not available with <tt>transformers-0.4</tt>.
deriveRead2 :: Name -> Q [Dec]

-- | Like <a>deriveRead2</a>, but takes a <a>ReadOptions</a> argument.
--   
--   This function is not available with <tt>transformers-0.4</tt>.
deriveRead2Options :: ReadOptions -> Name -> Q [Dec]

-- | Generates a lambda expression which behaves like
--   <tt>liftReadsPrec2</tt> (without requiring a <a>Read2</a> instance).
--   
--   This function is not available with <tt>transformers-0.4</tt>.
makeLiftReadsPrec2 :: Name -> Q Exp

-- | Generates a lambda expression which behaves like
--   <tt>liftReadPrec2</tt> (without requiring a <a>Read2</a> instance).
--   
--   This function is only available with <tt>base-4.10</tt> or later.
makeLiftReadPrec2 :: Name -> Q Exp

-- | Generates a lambda expression which behaves like <tt>readPrec2</tt>
--   (without requiring a <a>Read2</a> instance).
--   
--   This function is only available with <tt>base-4.10</tt> or later.
makeReadPrec2 :: Name -> Q Exp

-- | Generates a lambda expression which behaves like <tt>readsPrec2</tt>
--   (without requiring a <a>Read2</a> instance).
--   
--   This function is not available with <tt>transformers-0.4</tt>.
makeReadsPrec2 :: Name -> Q Exp

-- | Options that further configure how the functions in
--   <a>Text.Read.Deriving</a> should behave.
newtype ReadOptions
ReadOptions :: Bool -> ReadOptions

-- | If <a>True</a>:
--   
--   <ul>
--   <li>Derived <a>ReadClass</a> instances will implement
--   <tt>readPrec</tt>, not <a>readsPrec</a>, and will provide a default
--   implementation of <tt>readListPrec</tt> in terms of
--   <tt>readPrec</tt>.</li>
--   <li>If built against <tt>base-4.10</tt> or later, derived
--   <a>Read1</a>/<a>Read2</a> instances will implement
--   <tt>liftReadPrec</tt>/<tt>liftReadPrec2</tt>, not
--   <tt>liftReadsPrec</tt>/<tt>liftReadsPrec2</tt>, and will provide
--   default implementations of
--   <tt>liftReadListPrec</tt>/<tt>liftReadListPrec2</tt> in terms of
--   <tt>liftReadPrec</tt>/<tt>liftReadPrec2</tt>. If built against an
--   earlier version of <tt>base</tt>, derived <a>Read1</a>/<a>Read2</a>
--   instances are not affected, so they will act as if this flag were
--   <a>False</a>.</li>
--   </ul>
--   
--   If <a>False</a>:
--   
--   <ul>
--   <li>Derived <a>ReadClass</a> instances will implement
--   <a>readsPrec</a>.</li>
--   <li>Derived <a>Read1</a> instances will implement <tt>readsPrec1</tt>
--   (if built against <tt>transformers-0.4</tt>) or <tt>liftReadsPrec</tt>
--   (otherwise). If not built against <tt>transformers-0.4</tt>, derived
--   <a>Read2</a> instances will implement <tt>liftReadsPrec2</tt>.</li>
--   </ul>
--   
--   It's generally a good idea to enable this option, since
--   <tt>readPrec</tt> and friends are more efficient than <a>readsPrec</a>
--   and friends, since the former use the efficient <tt>ReadPrec</tt>
--   parser datatype while the latter use the slower, list-based
--   <a>ReadS</a> type.
[useReadPrec] :: ReadOptions -> Bool

-- | <a>ReadOptions</a> that favor <tt>readPrec</tt> over <a>readsPrec</a>.
defaultReadOptions :: ReadOptions


-- | Exports functions to mechanically derive <a>ShowClass</a>,
--   <a>Show1</a>, and <a>Show2</a> instances.
--   
--   Note: this is an internal module, and as such, the API presented here
--   is not guaranteed to be stable, even between minor releases of this
--   library.
module Text.Show.Deriving.Internal

-- | Generates a <a>ShowClass</a> instance declaration for the given data
--   type or data family instance.
deriveShow :: Name -> Q [Dec]

-- | Like <a>deriveShow</a>, but takes a <a>ShowOptions</a> argument.
deriveShowOptions :: ShowOptions -> Name -> Q [Dec]

-- | Generates a lambda expression which behaves like <a>showsPrec</a>
--   (without requiring a <a>ShowClass</a> instance).
makeShowsPrec :: Name -> Q Exp

-- | Like <a>makeShowsPrec</a>, but takes a <a>ShowOptions</a> argument.
makeShowsPrecOptions :: ShowOptions -> Name -> Q Exp

-- | Generates a lambda expression which behaves like <a>show</a> (without
--   requiring a <a>ShowClass</a> instance).
makeShow :: Name -> Q Exp

-- | Like <a>makeShow</a>, but takes a <a>ShowOptions</a> argument.
makeShowOptions :: ShowOptions -> Name -> Q Exp

-- | Generates a lambda expression which behaves like <a>showList</a>
--   (without requiring a <a>ShowClass</a> instance).
makeShowList :: Name -> Q Exp

-- | Like <a>makeShowList</a>, but takes a <a>ShowOptions</a> argument.
makeShowListOptions :: ShowOptions -> Name -> Q Exp

-- | Generates a <a>Show1</a> instance declaration for the given data type
--   or data family instance.
deriveShow1 :: Name -> Q [Dec]

-- | Like <a>deriveShow1</a>, but takes a <a>ShowOptions</a> argument.
deriveShow1Options :: ShowOptions -> Name -> Q [Dec]

-- | Generates a lambda expression which behaves like
--   <tt>liftShowsPrec</tt> (without requiring a <a>Show1</a> instance).
--   
--   This function is not available with <tt>transformers-0.4</tt>.
makeLiftShowsPrec :: Name -> Q Exp

-- | Like <a>makeLiftShowsPrec</a>, but takes a <a>ShowOptions</a>
--   argument.
--   
--   This function is not available with <tt>transformers-0.4</tt>.
makeLiftShowsPrecOptions :: ShowOptions -> Name -> Q Exp

-- | Generates a lambda expression which behaves like <tt>liftShowList</tt>
--   (without requiring a <a>ShowClass</a> instance).
--   
--   This function is not available with <tt>transformers-0.4</tt>.
makeLiftShowList :: Name -> Q Exp

-- | Like <a>makeLiftShowList</a>, but takes a <a>ShowOptions</a> argument.
--   
--   This function is not available with <tt>transformers-0.4</tt>.
makeLiftShowListOptions :: ShowOptions -> Name -> Q Exp

-- | Generates a lambda expression which behaves like <tt>showsPrec1</tt>
--   (without requiring a <a>Show1</a> instance).
makeShowsPrec1 :: Name -> Q Exp

-- | Like <a>makeShowsPrec1</a>, but takes a <a>ShowOptions</a> argument.
makeShowsPrec1Options :: ShowOptions -> Name -> Q Exp

-- | Generates a <a>Show2</a> instance declaration for the given data type
--   or data family instance.
--   
--   This function is not available with <tt>transformers-0.4</tt>.
deriveShow2 :: Name -> Q [Dec]

-- | Like <a>deriveShow2</a>, but takes a <a>ShowOptions</a> argument.
--   
--   This function is not available with <tt>transformers-0.4</tt>.
deriveShow2Options :: ShowOptions -> Name -> Q [Dec]

-- | Generates a lambda expression which behaves like
--   <tt>liftShowsPrec2</tt> (without requiring a <a>Show2</a> instance).
--   
--   This function is not available with <tt>transformers-0.4</tt>.
makeLiftShowsPrec2 :: Name -> Q Exp

-- | Like <a>makeLiftShowsPrec2</a>, but takes a <a>ShowOptions</a>
--   argument.
--   
--   This function is not available with <tt>transformers-0.4</tt>.
makeLiftShowsPrec2Options :: ShowOptions -> Name -> Q Exp

-- | Generates a lambda expression which behaves like
--   <tt>liftShowList2</tt> (without requiring a <a>ShowClass</a>
--   instance).
--   
--   This function is not available with <tt>transformers-0.4</tt>.
makeLiftShowList2 :: Name -> Q Exp

-- | Like <a>makeLiftShowList2</a>, but takes a <a>ShowOptions</a>
--   argument.
--   
--   This function is not available with <tt>transformers-0.4</tt>.
makeLiftShowList2Options :: ShowOptions -> Name -> Q Exp

-- | Generates a lambda expression which behaves like <tt>showsPrec2</tt>
--   (without requiring a <a>Show2</a> instance).
--   
--   This function is not available with <tt>transformers-0.4</tt>.
makeShowsPrec2 :: Name -> Q Exp

-- | Like <a>makeShowsPrec2</a>, but takes a <a>ShowOptions</a> argument.
--   
--   This function is not available with <tt>transformers-0.4</tt>.
makeShowsPrec2Options :: ShowOptions -> Name -> Q Exp

-- | Options that further configure how the functions in
--   <a>Text.Show.Deriving</a> should behave.
data ShowOptions
ShowOptions :: Bool -> Bool -> ShowOptions

-- | If <a>True</a>, the derived <a>ShowClass</a>, <a>Show1</a>, or
--   <a>Show2</a> instance will not surround the output of showing fields
--   of unlifted types with parentheses, and the output will be suffixed
--   with hash signs (<tt>#</tt>).
[ghc8ShowBehavior] :: ShowOptions -> Bool

-- | If <a>True</a>, derived instances for empty data types (i.e., ones
--   with no data constructors) will use the <tt>EmptyCase</tt> language
--   extension. If <a>False</a>, derived instances will simply use
--   <a>seq</a> instead. (This has no effect on GHCs before 7.8, since
--   <tt>EmptyCase</tt> is only available in 7.8 or later.)
[showEmptyCaseBehavior] :: ShowOptions -> Bool

-- | <a>ShowOptions</a> that match the behavior of the most recent GHC
--   release.
defaultShowOptions :: ShowOptions

-- | <a>ShowOptions</a> that match the behavior of the installed version of
--   GHC.
legacyShowOptions :: ShowOptions
instance GHC.Show.Show Text.Show.Deriving.Internal.ShowOptions
instance GHC.Read.Read Text.Show.Deriving.Internal.ShowOptions
instance GHC.Classes.Ord Text.Show.Deriving.Internal.ShowOptions
instance GHC.Classes.Eq Text.Show.Deriving.Internal.ShowOptions
instance GHC.Enum.Enum Text.Show.Deriving.Internal.ShowClass
instance GHC.Enum.Bounded Text.Show.Deriving.Internal.ShowClass
instance Data.Deriving.Internal.ClassRep Text.Show.Deriving.Internal.ShowClass


-- | Exports functions to mechanically derive <a>Show</a>, <tt>Show1</tt>,
--   and <tt>Show2</tt> instances. Note that upstream GHC does not have the
--   ability to derive <tt>Show1</tt> or <tt>Show2</tt> instances, but
--   since the functionality to derive <a>Show</a> extends very naturally
--   <tt>Show1</tt> and <tt>Show2</tt>, the ability to derive the latter
--   two classes is provided as a convenience.
module Text.Show.Deriving

-- | Generates a <a>ShowClass</a> instance declaration for the given data
--   type or data family instance.
deriveShow :: Name -> Q [Dec]

-- | Like <a>deriveShow</a>, but takes a <a>ShowOptions</a> argument.
deriveShowOptions :: ShowOptions -> Name -> Q [Dec]

-- | Generates a lambda expression which behaves like <a>showsPrec</a>
--   (without requiring a <a>ShowClass</a> instance).
makeShowsPrec :: Name -> Q Exp

-- | Like <a>makeShowsPrec</a>, but takes a <a>ShowOptions</a> argument.
makeShowsPrecOptions :: ShowOptions -> Name -> Q Exp

-- | Generates a lambda expression which behaves like <a>show</a> (without
--   requiring a <a>ShowClass</a> instance).
makeShow :: Name -> Q Exp

-- | Like <a>makeShow</a>, but takes a <a>ShowOptions</a> argument.
makeShowOptions :: ShowOptions -> Name -> Q Exp

-- | Generates a lambda expression which behaves like <a>showList</a>
--   (without requiring a <a>ShowClass</a> instance).
makeShowList :: Name -> Q Exp

-- | Like <a>makeShowList</a>, but takes a <a>ShowOptions</a> argument.
makeShowListOptions :: ShowOptions -> Name -> Q Exp

-- | Generates a <a>Show1</a> instance declaration for the given data type
--   or data family instance.
deriveShow1 :: Name -> Q [Dec]

-- | Like <a>deriveShow1</a>, but takes a <a>ShowOptions</a> argument.
deriveShow1Options :: ShowOptions -> Name -> Q [Dec]

-- | Generates a lambda expression which behaves like
--   <tt>liftShowsPrec</tt> (without requiring a <a>Show1</a> instance).
--   
--   This function is not available with <tt>transformers-0.4</tt>.
makeLiftShowsPrec :: Name -> Q Exp

-- | Like <a>makeLiftShowsPrec</a>, but takes a <a>ShowOptions</a>
--   argument.
--   
--   This function is not available with <tt>transformers-0.4</tt>.
makeLiftShowsPrecOptions :: ShowOptions -> Name -> Q Exp

-- | Generates a lambda expression which behaves like <tt>liftShowList</tt>
--   (without requiring a <a>ShowClass</a> instance).
--   
--   This function is not available with <tt>transformers-0.4</tt>.
makeLiftShowList :: Name -> Q Exp

-- | Like <a>makeLiftShowList</a>, but takes a <a>ShowOptions</a> argument.
--   
--   This function is not available with <tt>transformers-0.4</tt>.
makeLiftShowListOptions :: ShowOptions -> Name -> Q Exp

-- | Generates a lambda expression which behaves like <tt>showsPrec1</tt>
--   (without requiring a <a>Show1</a> instance).
makeShowsPrec1 :: Name -> Q Exp

-- | Like <a>makeShowsPrec1</a>, but takes a <a>ShowOptions</a> argument.
makeShowsPrec1Options :: ShowOptions -> Name -> Q Exp

-- | Generates a <a>Show2</a> instance declaration for the given data type
--   or data family instance.
--   
--   This function is not available with <tt>transformers-0.4</tt>.
deriveShow2 :: Name -> Q [Dec]

-- | Like <a>deriveShow2</a>, but takes a <a>ShowOptions</a> argument.
--   
--   This function is not available with <tt>transformers-0.4</tt>.
deriveShow2Options :: ShowOptions -> Name -> Q [Dec]

-- | Generates a lambda expression which behaves like
--   <tt>liftShowsPrec2</tt> (without requiring a <a>Show2</a> instance).
--   
--   This function is not available with <tt>transformers-0.4</tt>.
makeLiftShowsPrec2 :: Name -> Q Exp

-- | Like <a>makeLiftShowsPrec2</a>, but takes a <a>ShowOptions</a>
--   argument.
--   
--   This function is not available with <tt>transformers-0.4</tt>.
makeLiftShowsPrec2Options :: ShowOptions -> Name -> Q Exp

-- | Generates a lambda expression which behaves like
--   <tt>liftShowList2</tt> (without requiring a <a>ShowClass</a>
--   instance).
--   
--   This function is not available with <tt>transformers-0.4</tt>.
makeLiftShowList2 :: Name -> Q Exp

-- | Like <a>makeLiftShowList2</a>, but takes a <a>ShowOptions</a>
--   argument.
--   
--   This function is not available with <tt>transformers-0.4</tt>.
makeLiftShowList2Options :: ShowOptions -> Name -> Q Exp

-- | Generates a lambda expression which behaves like <tt>showsPrec2</tt>
--   (without requiring a <a>Show2</a> instance).
--   
--   This function is not available with <tt>transformers-0.4</tt>.
makeShowsPrec2 :: Name -> Q Exp

-- | Like <a>makeShowsPrec2</a>, but takes a <a>ShowOptions</a> argument.
--   
--   This function is not available with <tt>transformers-0.4</tt>.
makeShowsPrec2Options :: ShowOptions -> Name -> Q Exp

-- | Options that further configure how the functions in
--   <a>Text.Show.Deriving</a> should behave.
data ShowOptions
ShowOptions :: Bool -> Bool -> ShowOptions

-- | If <a>True</a>, the derived <a>ShowClass</a>, <a>Show1</a>, or
--   <a>Show2</a> instance will not surround the output of showing fields
--   of unlifted types with parentheses, and the output will be suffixed
--   with hash signs (<tt>#</tt>).
[ghc8ShowBehavior] :: ShowOptions -> Bool

-- | If <a>True</a>, derived instances for empty data types (i.e., ones
--   with no data constructors) will use the <tt>EmptyCase</tt> language
--   extension. If <a>False</a>, derived instances will simply use
--   <a>seq</a> instead. (This has no effect on GHCs before 7.8, since
--   <tt>EmptyCase</tt> is only available in 7.8 or later.)
[showEmptyCaseBehavior] :: ShowOptions -> Bool

-- | <a>ShowOptions</a> that match the behavior of the most recent GHC
--   release.
defaultShowOptions :: ShowOptions

-- | <a>ShowOptions</a> that match the behavior of the installed version of
--   GHC.
legacyShowOptions :: ShowOptions


-- | This module reexports all of the functionality of the other modules in
--   this library (with the exception of <a>Data.Deriving.Via</a>, which is
--   only available on GHC 8.2 or later). This module also provides a
--   high-level tutorial on <tt>deriving-compat</tt>'s naming conventions
--   and best practices. Typeclass-specific information can be found in
--   their respective modules.
module Data.Deriving
