-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Backports of GHC deriving extensions -- -- Provides Template Haskell functions that mimic deriving extensions -- that were introduced or modified in recent versions of GHC. Currently, -- the following typeclasses/extensions are covered: -- -- -- -- See the Data.Deriving module for a full list of backported -- changes. -- -- Note that some recent GHC typeclasses/extensions are not covered by -- this package: -- -- @package deriving-compat @version 0.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 -- deriveVia. Refer to the documentation for deriveVia -- 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 Just the kind variable Name of a -- StarKindStatus if it exists. Otherwise, returns Nothing. 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 -- | 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] isTrue# :: Int# -> Bool -- | filterByList 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] -- | filterByLists 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 True, then it takes -- an element from the former list. If it is False, it takes an -- element from the latter list. The elements taken correspond to the -- index of the Bool in its list. For example: -- --
--   filterByLists [True, False, True, False] "abcd" "wxyz" = "axcz"
--   
-- -- This function does not check whether the lists have equal length. filterByLists :: [Bool] -> [a] -> [a] -> [a] -- | partitionByList takes a list of Bools and a list of some -- elements and partitions the list according to the list of Bools. -- Elements corresponding to True go to the left; elements -- corresponding to False go to the right. For example, -- partitionByList [True, False, True] [1,2,3] == ([1,3], [2]) -- 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 -- | hasKindVarChain n kind Checks if kind is of the form -- k_0 -> k_1 -> ... -> 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 True if it's a datatype with exactly one, -- non-existential constructor. isProductType :: [ConstructorInfo] -> Bool -- | Returns True if it's a datatype with one or more nullary, -- non-GADT constructors. isEnumerationType :: [ConstructorInfo] -> Bool -- | Returns False 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: -- --
    --
  1. All of the dropped types are type variables
  2. --
  3. All of the dropped types are distinct
  4. --
  5. None of the remaining types mention any of the dropped types
  6. --
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 oversaturated -- arguments to type families. For instance, if one declared the -- following type family: -- --
--   type family F a :: Type -> Type
--   
-- -- Then in the type F a b, we would consider a to be an -- argument to F, but not b. 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: -- --
--   Either Int Char
--   
-- -- would split to this: -- --
--   [Either, Int, Char]
--   
unapplyTy :: Type -> (Type, [Type]) -- | Split a type signature by the arrows on its spine. For example, this: -- --
--   forall a b. (a ~ b) => (a -> b) -> Char -> ()
--   
-- -- would split to this: -- --
--   (a ~ b, [a -> b, Char, ()])
--   
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 Name represents a tuple type constructor (other -- than ()) isNonUnitTuple :: Name -> Bool -- | Checks if a String represents a tuple (other than ()) isNonUnitTupleString :: String -> Bool -- | Checks if a String names a valid Haskell infix data constructor -- (i.e., does it begin with a colon?). isInfixDataCon :: String -> Bool isSym :: String -> Bool ghc7'8OrLater :: Bool derivingCompatPackageKey :: String gHC_IX :: String mkDerivingCompatName_v :: String -> Name mkDerivingCompatName_tc :: String -> Name 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 coerceValName :: 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 liftReadListPrecDefaultValName :: Name liftReadListPrec2DefaultValName :: Name liftReadListPrecValName :: Name liftReadListPrec2ValName :: Name liftReadPrecValName :: Name liftReadPrec2ValName :: Name listValName :: Name ltAddrHashValName :: Name ltCharHashValName :: Name ltDoubleHashValName :: Name ltFloatHashValName :: Name ltIntHashValName :: Name ltWordHashValName :: Name minBoundValName :: Name mapValName :: Name maxBoundValName :: Name minusIntHashValName :: 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 eq2TypeName :: Name liftEqValName :: Name liftEq2ValName :: Name ord1TypeName :: Name ord2TypeName :: Name liftCompareValName :: Name liftCompare2ValName :: Name read1TypeName :: Name read2TypeName :: Name liftReadsPrecValName :: Name liftReadListValName :: Name liftReadsPrec2ValName :: Name liftReadList2ValName :: Name show1TypeName :: Name show2TypeName :: Name liftShowListValName :: Name liftShowsPrecValName :: Name liftShowList2ValName :: Name liftShowsPrec2ValName :: 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 instance GHC.Classes.Eq Data.Deriving.Internal.StarKindStatus -- | Exports functions to mechanically derive Bounded 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 Bounded instance declaration for the given data -- type or data family instance. deriveBounded :: Name -> Q [Dec] -- | Generates a lambda expression which behaves like minBound -- (without requiring a Bounded instance). makeMinBound :: Name -> Q Exp -- | Generates a lambda expression which behaves like maxBound -- (without requiring a Bounded instance). makeMaxBound :: Name -> Q Exp instance Data.Deriving.Internal.ClassRep Data.Bounded.Deriving.Internal.BoundedClass -- | Exports functions to mechanically derive Bounded instances. module Data.Bounded.Deriving -- | Generates a Bounded instance declaration for the given data -- type or data family instance. deriveBounded :: Name -> Q [Dec] -- | Generates a lambda expression which behaves like minBound -- (without requiring a Bounded instance). makeMinBound :: Name -> Q Exp -- | Generates a lambda expression which behaves like maxBound -- (without requiring a Bounded instance). makeMaxBound :: Name -> Q Exp -- | On template-haskell-2.12 or later (i.e., GHC 8.2 or later), -- this module exports functionality which emulates the -- GeneralizedNewtypeDeriving and DerivingVia GHC -- extensions (the latter of which was introduced in GHC 8.6). -- -- On older versions of template-haskell/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 GeneralizedNewtypeDeriving extension. For -- example: -- --
--   newtype Foo a = MkFoo a
--   $(deriveGND [t| forall a. Eq a => Eq (Foo a) |])
--   
deriveGND :: Q Type -> Q [Dec] -- | Generates an instance for a type class by emulating the behavior of -- the DerivingVia extension. For example: -- --
--   newtype Foo a = MkFoo a
--   $(deriveVia [t| forall a. Ord a => Ord (Foo a) `Via` Down a |])
--   
-- -- 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 Via -- 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 a is used in Ord a, -- Ord (Foo a), and Down a). deriveVia :: Q Type -> Q [Dec] deriveViaDecs :: Type -> Maybe Type -> Q [Dec] deriveViaDecs' :: Name -> [TyVarBndrUnit] -> [Type] -> Type -> Dec -> Q (Maybe [Dec]) mkCoerceClassMethEqn :: [TyVarBndrUnit] -> [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 template-haskell-2.12 or later (i.e., GHC 8.2 or later), -- this module exports functionality which emulates the -- GeneralizedNewtypeDeriving and DerivingVia GHC -- extensions (the latter of which was introduced in GHC 8.6). -- -- On older versions of template-haskell/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 GeneralizedNewtypeDeriving extension. For -- example: -- --
--   newtype Foo a = MkFoo a
--   $(deriveGND [t| forall a. Eq a => Eq (Foo a) |])
--   
deriveGND :: Q Type -> Q [Dec] -- | Generates an instance for a type class by emulating the behavior of -- the DerivingVia extension. For example: -- --
--   newtype Foo a = MkFoo a
--   $(deriveVia [t| forall a. Ord a => Ord (Foo a) `Via` Down a |])
--   
-- -- 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 Via -- 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 a is used in Ord a, -- Ord (Foo a), and Down a). deriveVia :: Q Type -> Q [Dec] -- | A type-level modifier intended to be used in conjunction with -- deriveVia. Refer to the documentation for deriveVia -- for more details. data a `Via` b infix 0 `Via` -- | Exports functions to mechanically derive Enum 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 Enum instance declaration for the given data type -- or data family instance. deriveEnum :: Name -> Q [Dec] -- | Generates a lambda expression which behaves like succ (without -- requiring an Enum instance). makeSucc :: Name -> Q Exp -- | Generates a lambda expression which behaves like pred (without -- requiring an Enum instance). makePred :: Name -> Q Exp -- | Generates a lambda expression which behaves like toEnum -- (without requiring an Enum instance). makeToEnum :: Name -> Q Exp -- | Generates a lambda expression which behaves like fromEnum -- (without requiring an Enum instance). makeFromEnum :: Name -> Q Exp -- | Generates a lambda expression which behaves like enumFrom -- (without requiring an Enum instance). makeEnumFrom :: Name -> Q Exp -- | Generates a lambda expression which behaves like enumFromThen -- (without requiring an Enum 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 Enum instances. module Data.Enum.Deriving -- | Generates an Enum instance declaration for the given data type -- or data family instance. deriveEnum :: Name -> Q [Dec] -- | Generates a lambda expression which behaves like succ (without -- requiring an Enum instance). makeSucc :: Name -> Q Exp -- | Generates a lambda expression which behaves like pred (without -- requiring an Enum instance). makePred :: Name -> Q Exp -- | Generates a lambda expression which behaves like toEnum -- (without requiring an Enum instance). makeToEnum :: Name -> Q Exp -- | Generates a lambda expression which behaves like fromEnum -- (without requiring an Enum instance). makeFromEnum :: Name -> Q Exp -- | Generates a lambda expression which behaves like enumFrom -- (without requiring an Enum instance). makeEnumFrom :: Name -> Q Exp -- | Generates a lambda expression which behaves like enumFromThen -- (without requiring an Enum instance). makeEnumFromThen :: Name -> Q Exp -- | Exports functions to mechanically derive Eq, Eq1, and -- Eq2 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 Eq instance declaration for the given data type or -- data family instance. deriveEq :: Name -> Q [Dec] -- | Generates a lambda expression which behaves like (==) (without -- requiring an Eq instance). makeEq :: Name -> Q Exp -- | Generates a lambda expression which behaves like (/=) (without -- requiring an Eq instance). makeNotEq :: Name -> Q Exp -- | Generates an Eq1 instance declaration for the given data type -- or data family instance. deriveEq1 :: Name -> Q [Dec] -- | Generates a lambda expression which behaves like liftEq -- (without requiring an Eq1 instance). -- -- This function is not available with transformers-0.4. makeLiftEq :: Name -> Q Exp -- | Generates a lambda expression which behaves like eq1 (without -- requiring an Eq1 instance). makeEq1 :: Name -> Q Exp -- | Generates an Eq2 instance declaration for the given data type -- or data family instance. -- -- This function is not available with transformers-0.4. deriveEq2 :: Name -> Q [Dec] -- | Generates a lambda expression which behaves like liftEq2 -- (without requiring an Eq2 instance). -- -- This function is not available with transformers-0.4. makeLiftEq2 :: Name -> Q Exp -- | Generates a lambda expression which behaves like eq2 (without -- requiring an Eq2 instance). -- -- This function is not available with transformers-0.4. 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 Eq, Eq1, and -- Eq2 instances. module Data.Eq.Deriving -- | Generates an Eq instance declaration for the given data type or -- data family instance. deriveEq :: Name -> Q [Dec] -- | Generates a lambda expression which behaves like (==) (without -- requiring an Eq instance). makeEq :: Name -> Q Exp -- | Generates a lambda expression which behaves like (/=) (without -- requiring an Eq instance). makeNotEq :: Name -> Q Exp -- | Generates an Eq1 instance declaration for the given data type -- or data family instance. deriveEq1 :: Name -> Q [Dec] -- | Generates a lambda expression which behaves like liftEq -- (without requiring an Eq1 instance). -- -- This function is not available with transformers-0.4. makeLiftEq :: Name -> Q Exp -- | Generates a lambda expression which behaves like eq1 (without -- requiring an Eq1 instance). makeEq1 :: Name -> Q Exp -- | Generates an Eq2 instance declaration for the given data type -- or data family instance. -- -- This function is not available with transformers-0.4. deriveEq2 :: Name -> Q [Dec] -- | Generates a lambda expression which behaves like liftEq2 -- (without requiring an Eq2 instance). -- -- This function is not available with transformers-0.4. makeLiftEq2 :: Name -> Q Exp -- | Generates a lambda expression which behaves like eq2 (without -- requiring an Eq2 instance). -- -- This function is not available with transformers-0.4. makeEq2 :: Name -> Q Exp -- | The machinery needed to derive Foldable, Functor, and -- Traversable instances. -- -- For more info on how deriving Functor works, see this GHC -- wiki page. -- -- 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 Foldable instance declaration for the given data -- type or data family instance. deriveFoldable :: Name -> Q [Dec] -- | Like deriveFoldable, but takes an FFTOptions argument. deriveFoldableOptions :: FFTOptions -> Name -> Q [Dec] -- | Generates a lambda expression which behaves like foldMap -- (without requiring a Foldable instance). makeFoldMap :: Name -> Q Exp -- | Like makeFoldMap, but takes an FFTOptions argument. makeFoldMapOptions :: FFTOptions -> Name -> Q Exp -- | Generates a lambda expression which behaves like foldr (without -- requiring a Foldable instance). makeFoldr :: Name -> Q Exp -- | Like makeFoldr, but takes an FFTOptions argument. makeFoldrOptions :: FFTOptions -> Name -> Q Exp -- | Generates a lambda expression which behaves like fold -- (without requiring a Foldable instance). makeFold :: Name -> Q Exp -- | Like makeFold, but takes an FFTOptions argument. makeFoldOptions :: FFTOptions -> Name -> Q Exp -- | Generates a lambda expression which behaves like foldl (without -- requiring a Foldable instance). makeFoldl :: Name -> Q Exp -- | Like makeFoldl, but takes an FFTOptions argument. makeFoldlOptions :: FFTOptions -> Name -> Q Exp -- | Generates a lambda expression which behaves like null (without -- requiring a Foldable instance). makeNull :: Name -> Q Exp -- | Like makeNull, but takes an FFTOptions argument. makeNullOptions :: FFTOptions -> Name -> Q Exp -- | Generates a Functor instance declaration for the given data -- type or data family instance. deriveFunctor :: Name -> Q [Dec] -- | Like deriveFunctor, but takes an FFTOptions argument. deriveFunctorOptions :: FFTOptions -> Name -> Q [Dec] -- | Generates a lambda expression which behaves like fmap (without -- requiring a Functor instance). makeFmap :: Name -> Q Exp -- | Like makeFmap, but takes an FFTOptions argument. makeFmapOptions :: FFTOptions -> Name -> Q Exp -- | Generates a lambda expression which behaves like (<$) -- (without requiring a Functor instance). makeReplace :: Name -> Q Exp -- | Like makeReplace, but takes an FFTOptions argument. makeReplaceOptions :: FFTOptions -> Name -> Q Exp -- | Generates a Traversable instance declaration for the given data -- type or data family instance. deriveTraversable :: Name -> Q [Dec] -- | Like deriveTraverse, but takes an FFTOptions argument. deriveTraversableOptions :: FFTOptions -> Name -> Q [Dec] -- | Generates a lambda expression which behaves like traverse -- (without requiring a Traversable instance). makeTraverse :: Name -> Q Exp -- | Like makeTraverse, but takes an FFTOptions argument. makeTraverseOptions :: FFTOptions -> Name -> Q Exp -- | Generates a lambda expression which behaves like sequenceA -- (without requiring a Traversable instance). makeSequenceA :: Name -> Q Exp -- | Like makeSequenceA, but takes an FFTOptions argument. makeSequenceAOptions :: FFTOptions -> Name -> Q Exp -- | Generates a lambda expression which behaves like mapM (without -- requiring a Traversable instance). makeMapM :: Name -> Q Exp -- | Like makeMapM, but takes an FFTOptions argument. makeMapMOptions :: FFTOptions -> Name -> Q Exp -- | Generates a lambda expression which behaves like sequence -- (without requiring a Traversable instance). makeSequence :: Name -> Q Exp -- | Like makeSequence, but takes an FFTOptions argument. makeSequenceOptions :: FFTOptions -> Name -> Q Exp -- | Options that further configure how the functions in -- Data.Functor.Deriving should behave. (FFT stands for -- FunctorFoldableTraversable.) newtype FFTOptions FFTOptions :: Bool -> FFTOptions -- | If True, derived instances for empty data types (i.e., ones -- with no data constructors) will use the EmptyCase language -- extension. If False, derived instances will simply use -- seq instead. (This has no effect on GHCs before 7.8, since -- EmptyCase is only available in 7.8 or later.) [fftEmptyCaseBehavior] :: FFTOptions -> Bool -- | Conservative FFTOptions that doesn't attempt to use -- EmptyCase (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 Functor instances. -- -- For more info on how deriving Functor works, see this GHC -- wiki page. module Data.Functor.Deriving -- | Generates a Functor instance declaration for the given data -- type or data family instance. deriveFunctor :: Name -> Q [Dec] -- | Like deriveFunctor, but takes an FFTOptions argument. deriveFunctorOptions :: FFTOptions -> Name -> Q [Dec] -- | Generates a lambda expression which behaves like fmap (without -- requiring a Functor instance). makeFmap :: Name -> Q Exp -- | Like makeFmap, but takes an FFTOptions argument. makeFmapOptions :: FFTOptions -> Name -> Q Exp -- | Generates a lambda expression which behaves like (<$) -- (without requiring a Functor instance). makeReplace :: Name -> Q Exp -- | Like makeReplace, but takes an FFTOptions argument. makeReplaceOptions :: FFTOptions -> Name -> Q Exp -- | Options that further configure how the functions in -- Data.Functor.Deriving should behave. (FFT stands for -- FunctorFoldableTraversable.) newtype FFTOptions FFTOptions :: Bool -> FFTOptions -- | If True, derived instances for empty data types (i.e., ones -- with no data constructors) will use the EmptyCase language -- extension. If False, derived instances will simply use -- seq instead. (This has no effect on GHCs before 7.8, since -- EmptyCase is only available in 7.8 or later.) [fftEmptyCaseBehavior] :: FFTOptions -> Bool -- | Conservative FFTOptions that doesn't attempt to use -- EmptyCase (to prevent users from having to enable that -- extension at use sites.) defaultFFTOptions :: FFTOptions -- | Exports functions to mechanically derive Foldable instances in -- a way that mimics how the -XDeriveFoldable extension works -- since GHC 8.0. -- -- These changes make it possible to derive Foldable instances -- for data types with existential constraints, e.g., -- --
--   data WrappedSet a where
--       WrapSet :: Ord a => a -> WrappedSet a
--   
--   deriving instance Foldable WrappedSet -- On GHC 8.0  on later
--   $(deriveFoldable ''WrappedSet)        -- On GHC 7.10 and earlier
--   
-- -- In addition, derived Foldable instances from this module do not -- generate superfluous mempty expressions in its implementation -- of foldMap. One can verify this by compiling a module that uses -- deriveFoldable with the -ddump-splices GHC flag. -- -- For more info on these changes, see this GHC wiki page. module Data.Foldable.Deriving -- | Generates a Foldable instance declaration for the given data -- type or data family instance. deriveFoldable :: Name -> Q [Dec] -- | Like deriveFoldable, but takes an FFTOptions argument. deriveFoldableOptions :: FFTOptions -> Name -> Q [Dec] -- | Generates a lambda expression which behaves like foldMap -- (without requiring a Foldable instance). makeFoldMap :: Name -> Q Exp -- | Like makeFoldMap, but takes an FFTOptions argument. makeFoldMapOptions :: FFTOptions -> Name -> Q Exp -- | Generates a lambda expression which behaves like foldr (without -- requiring a Foldable instance). makeFoldr :: Name -> Q Exp -- | Like makeFoldr, but takes an FFTOptions argument. makeFoldrOptions :: FFTOptions -> Name -> Q Exp -- | Generates a lambda expression which behaves like fold -- (without requiring a Foldable instance). makeFold :: Name -> Q Exp -- | Like makeFold, but takes an FFTOptions argument. makeFoldOptions :: FFTOptions -> Name -> Q Exp -- | Generates a lambda expression which behaves like foldl (without -- requiring a Foldable instance). makeFoldl :: Name -> Q Exp -- | Like makeFoldl, but takes an FFTOptions argument. makeFoldlOptions :: FFTOptions -> Name -> Q Exp -- | Generates a lambda expression which behaves like null (without -- requiring a Foldable instance). makeNull :: Name -> Q Exp -- | Like makeNull, but takes an FFTOptions argument. makeNullOptions :: FFTOptions -> Name -> Q Exp -- | Options that further configure how the functions in -- Data.Functor.Deriving should behave. (FFT stands for -- FunctorFoldableTraversable.) newtype FFTOptions FFTOptions :: Bool -> FFTOptions -- | If True, derived instances for empty data types (i.e., ones -- with no data constructors) will use the EmptyCase language -- extension. If False, derived instances will simply use -- seq instead. (This has no effect on GHCs before 7.8, since -- EmptyCase is only available in 7.8 or later.) [fftEmptyCaseBehavior] :: FFTOptions -> Bool -- | Conservative FFTOptions that doesn't attempt to use -- EmptyCase (to prevent users from having to enable that -- extension at use sites.) defaultFFTOptions :: FFTOptions -- | Exports functions to mechanically derive Ix 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 Ix instance declaration for the given data type -- or data family instance. deriveIx :: Name -> Q [Dec] -- | Generates a lambda expression which behaves like range -- (without requiring an Ix instance). makeRange :: Name -> Q Exp -- | Generates a lambda expression which behaves like unsafeIndex -- (without requiring an Ix instance). makeUnsafeIndex :: Name -> Q Exp -- | Generates a lambda expression which behaves like inRange -- (without requiring an Ix 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 Ix instances. module Data.Ix.Deriving -- | Generates a Ix instance declaration for the given data type -- or data family instance. deriveIx :: Name -> Q [Dec] -- | Generates a lambda expression which behaves like range -- (without requiring an Ix instance). makeRange :: Name -> Q Exp -- | Generates a lambda expression which behaves like unsafeIndex -- (without requiring an Ix instance). makeUnsafeIndex :: Name -> Q Exp -- | Generates a lambda expression which behaves like inRange -- (without requiring an Ix instance). makeInRange :: Name -> Q Exp -- | Exports functions to mechanically derive Ord, Ord1, and -- Ord2 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 Ord instance declaration for the given data type -- or data family instance. deriveOrd :: Name -> Q [Dec] -- | Generates a lambda expression which behaves like compare -- (without requiring an Ord instance). makeCompare :: Name -> Q Exp -- | Generates a lambda expression which behaves like (<=) -- (without requiring an Ord instance). makeLE :: Name -> Q Exp -- | Generates a lambda expression which behaves like (<) -- (without requiring an Ord instance). makeLT :: Name -> Q Exp -- | Generates a lambda expression which behaves like (>) -- (without requiring an Ord instance). makeGT :: Name -> Q Exp -- | Generates a lambda expression which behaves like (>=) -- (without requiring an Ord instance). makeGE :: Name -> Q Exp -- | Generates a lambda expression which behaves like max (without -- requiring an Ord instance). makeMax :: Name -> Q Exp -- | Generates a lambda expression which behaves like min (without -- requiring an Ord instance). makeMin :: Name -> Q Exp -- | Generates an Ord1 instance declaration for the given data type -- or data family instance. deriveOrd1 :: Name -> Q [Dec] -- | Generates a lambda expression which behaves like liftCompare -- (without requiring an Ord1 instance). -- -- This function is not available with transformers-0.4. makeLiftCompare :: Name -> Q Exp -- | Generates a lambda expression which behaves like compare1 -- (without requiring an Ord1 instance). makeCompare1 :: Name -> Q Exp -- | Generates an Ord2 instance declaration for the given data type -- or data family instance. -- -- This function is not available with transformers-0.4. deriveOrd2 :: Name -> Q [Dec] -- | Generates a lambda expression which behaves like liftCompare2 -- (without requiring an Ord2 instance). -- -- This function is not available with transformers-0.4. makeLiftCompare2 :: Name -> Q Exp -- | Generates a lambda expression which behaves like compare2 -- (without requiring an Ord2 instance). -- -- This function is not available with transformers-0.4. 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 Ord, Ord1, -- and Ord2 instances. module Data.Ord.Deriving -- | Generates an Ord instance declaration for the given data type -- or data family instance. deriveOrd :: Name -> Q [Dec] -- | Generates a lambda expression which behaves like compare -- (without requiring an Ord instance). makeCompare :: Name -> Q Exp -- | Generates a lambda expression which behaves like (<) -- (without requiring an Ord instance). makeLT :: Name -> Q Exp -- | Generates a lambda expression which behaves like (<=) -- (without requiring an Ord instance). makeLE :: Name -> Q Exp -- | Generates a lambda expression which behaves like (>) -- (without requiring an Ord instance). makeGT :: Name -> Q Exp -- | Generates a lambda expression which behaves like (>=) -- (without requiring an Ord instance). makeGE :: Name -> Q Exp -- | Generates a lambda expression which behaves like max (without -- requiring an Ord instance). makeMax :: Name -> Q Exp -- | Generates a lambda expression which behaves like min (without -- requiring an Ord instance). makeMin :: Name -> Q Exp -- | Generates an Ord1 instance declaration for the given data type -- or data family instance. deriveOrd1 :: Name -> Q [Dec] -- | Generates a lambda expression which behaves like liftCompare -- (without requiring an Ord1 instance). -- -- This function is not available with transformers-0.4. makeLiftCompare :: Name -> Q Exp -- | Generates a lambda expression which behaves like compare1 -- (without requiring an Ord1 instance). makeCompare1 :: Name -> Q Exp -- | Generates an Ord2 instance declaration for the given data type -- or data family instance. -- -- This function is not available with transformers-0.4. deriveOrd2 :: Name -> Q [Dec] -- | Generates a lambda expression which behaves like liftCompare2 -- (without requiring an Ord2 instance). -- -- This function is not available with transformers-0.4. makeLiftCompare2 :: Name -> Q Exp -- | Generates a lambda expression which behaves like compare2 -- (without requiring an Ord2 instance). -- -- This function is not available with transformers-0.4. makeCompare2 :: Name -> Q Exp -- | Exports functions to mechanically derive Traversable instances -- in a way that mimics how the -XDeriveTraversable extension -- works since GHC 8.0. -- -- Derived Traversable instances from this module do not generate -- superfluous pure expressions in its implementation of -- traverse. One can verify this by compiling a module that uses -- deriveTraversable with the -ddump-splices GHC flag. -- -- These changes make it possible to derive Traversable -- instances for data types with unlifted argument types, e.g., -- --
--   data IntHash a = IntHash Int# a
--   
--   deriving instance Traversable IntHash -- On GHC 8.0  on later
--   $(deriveTraversable ''IntHash)        -- On GHC 7.10 and earlier
--   
-- -- For more info on these changes, see this GHC wiki page. module Data.Traversable.Deriving -- | Generates a Traversable instance declaration for the given data -- type or data family instance. deriveTraversable :: Name -> Q [Dec] -- | Like deriveTraverse, but takes an FFTOptions argument. deriveTraversableOptions :: FFTOptions -> Name -> Q [Dec] -- | Generates a lambda expression which behaves like traverse -- (without requiring a Traversable instance). makeTraverse :: Name -> Q Exp -- | Like makeTraverse, but takes an FFTOptions argument. makeTraverseOptions :: FFTOptions -> Name -> Q Exp -- | Generates a lambda expression which behaves like sequenceA -- (without requiring a Traversable instance). makeSequenceA :: Name -> Q Exp -- | Like makeSequenceA, but takes an FFTOptions argument. makeSequenceAOptions :: FFTOptions -> Name -> Q Exp -- | Generates a lambda expression which behaves like mapM (without -- requiring a Traversable instance). makeMapM :: Name -> Q Exp -- | Like makeMapM, but takes an FFTOptions argument. makeMapMOptions :: FFTOptions -> Name -> Q Exp -- | Generates a lambda expression which behaves like sequence -- (without requiring a Traversable instance). makeSequence :: Name -> Q Exp -- | Like makeSequence, but takes an FFTOptions argument. makeSequenceOptions :: FFTOptions -> Name -> Q Exp -- | Options that further configure how the functions in -- Data.Functor.Deriving should behave. (FFT stands for -- FunctorFoldableTraversable.) newtype FFTOptions FFTOptions :: Bool -> FFTOptions -- | If True, derived instances for empty data types (i.e., ones -- with no data constructors) will use the EmptyCase language -- extension. If False, derived instances will simply use -- seq instead. (This has no effect on GHCs before 7.8, since -- EmptyCase is only available in 7.8 or later.) [fftEmptyCaseBehavior] :: FFTOptions -> Bool -- | Conservative FFTOptions that doesn't attempt to use -- EmptyCase (to prevent users from having to enable that -- extension at use sites.) defaultFFTOptions :: FFTOptions -- | Exports functions to mechanically derive Read, Read1, -- and Read2 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 Read instance declaration for the given data type -- or data family instance. deriveRead :: Name -> Q [Dec] -- | Like deriveRead, but takes a ReadOptions argument. deriveReadOptions :: ReadOptions -> Name -> Q [Dec] -- | Generates a lambda expression which behaves like readsPrec -- (without requiring a Read instance). makeReadsPrec :: Name -> Q Exp -- | Generates a lambda expression which behaves like readPrec -- (without requiring a Read instance). makeReadPrec :: Name -> Q Exp -- | Generates a Read1 instance declaration for the given data type -- or data family instance. deriveRead1 :: Name -> Q [Dec] -- | Like deriveRead1, but takes a ReadOptions argument. deriveRead1Options :: ReadOptions -> Name -> Q [Dec] -- | Generates a lambda expression which behaves like -- liftReadsPrec (without requiring a Read1 instance). -- -- This function is not available with transformers-0.4. makeLiftReadsPrec :: Name -> Q Exp -- | Generates a lambda expression which behaves like liftReadPrec -- (without requiring a Read1 instance). -- -- This function is only available with base-4.10 or later. makeLiftReadPrec :: Name -> Q Exp -- | Generates a lambda expression which behaves like readPrec1 -- (without requiring a Read1 instance). -- -- This function is only available with base-4.10 or later. makeReadPrec1 :: Name -> Q Exp -- | Generates a lambda expression which behaves like readsPrec1 -- (without requiring a Read1 instance). makeReadsPrec1 :: Name -> Q Exp -- | Generates a Read2 instance declaration for the given data type -- or data family instance. -- -- This function is not available with transformers-0.4. deriveRead2 :: Name -> Q [Dec] -- | Like deriveRead2, but takes a ReadOptions argument. -- -- This function is not available with transformers-0.4. deriveRead2Options :: ReadOptions -> Name -> Q [Dec] -- | Generates a lambda expression which behaves like -- liftReadsPrec2 (without requiring a Read2 instance). -- -- This function is not available with transformers-0.4. makeLiftReadsPrec2 :: Name -> Q Exp -- | Generates a lambda expression which behaves like -- liftReadPrec2 (without requiring a Read2 instance). -- -- This function is only available with base-4.10 or later. makeLiftReadPrec2 :: Name -> Q Exp -- | Generates a lambda expression which behaves like readPrec2 -- (without requiring a Read2 instance). -- -- This function is only available with base-4.10 or later. makeReadPrec2 :: Name -> Q Exp -- | Generates a lambda expression which behaves like readsPrec2 -- (without requiring a Read2 instance). -- -- This function is not available with transformers-0.4. makeReadsPrec2 :: Name -> Q Exp -- | Options that further configure how the functions in -- Text.Read.Deriving should behave. newtype ReadOptions ReadOptions :: Bool -> ReadOptions -- | If True: -- -- -- -- If False: -- -- -- -- It's generally a good idea to enable this option, since -- readPrec and friends are more efficient than readsPrec -- and friends, since the former use the efficient ReadPrec -- parser datatype while the latter use the slower, list-based -- ReadS type. [useReadPrec] :: ReadOptions -> Bool -- | ReadOptions that favor readPrec over readsPrec. 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 Read, Read1, -- and Read2 instances. module Text.Read.Deriving -- | Generates a Read instance declaration for the given data type -- or data family instance. deriveRead :: Name -> Q [Dec] -- | Like deriveRead, but takes a ReadOptions argument. deriveReadOptions :: ReadOptions -> Name -> Q [Dec] -- | Generates a lambda expression which behaves like readsPrec -- (without requiring a Read instance). makeReadsPrec :: Name -> Q Exp -- | Generates a lambda expression which behaves like readPrec -- (without requiring a Read instance). makeReadPrec :: Name -> Q Exp -- | Generates a Read1 instance declaration for the given data type -- or data family instance. deriveRead1 :: Name -> Q [Dec] -- | Like deriveRead1, but takes a ReadOptions argument. deriveRead1Options :: ReadOptions -> Name -> Q [Dec] -- | Generates a lambda expression which behaves like -- liftReadsPrec (without requiring a Read1 instance). -- -- This function is not available with transformers-0.4. makeLiftReadsPrec :: Name -> Q Exp -- | Generates a lambda expression which behaves like liftReadPrec -- (without requiring a Read1 instance). -- -- This function is only available with base-4.10 or later. makeLiftReadPrec :: Name -> Q Exp -- | Generates a lambda expression which behaves like readPrec1 -- (without requiring a Read1 instance). -- -- This function is only available with base-4.10 or later. makeReadPrec1 :: Name -> Q Exp -- | Generates a lambda expression which behaves like readsPrec1 -- (without requiring a Read1 instance). makeReadsPrec1 :: Name -> Q Exp -- | Generates a Read2 instance declaration for the given data type -- or data family instance. -- -- This function is not available with transformers-0.4. deriveRead2 :: Name -> Q [Dec] -- | Like deriveRead2, but takes a ReadOptions argument. -- -- This function is not available with transformers-0.4. deriveRead2Options :: ReadOptions -> Name -> Q [Dec] -- | Generates a lambda expression which behaves like -- liftReadsPrec2 (without requiring a Read2 instance). -- -- This function is not available with transformers-0.4. makeLiftReadsPrec2 :: Name -> Q Exp -- | Generates a lambda expression which behaves like -- liftReadPrec2 (without requiring a Read2 instance). -- -- This function is only available with base-4.10 or later. makeLiftReadPrec2 :: Name -> Q Exp -- | Generates a lambda expression which behaves like readPrec2 -- (without requiring a Read2 instance). -- -- This function is only available with base-4.10 or later. makeReadPrec2 :: Name -> Q Exp -- | Generates a lambda expression which behaves like readsPrec2 -- (without requiring a Read2 instance). -- -- This function is not available with transformers-0.4. makeReadsPrec2 :: Name -> Q Exp -- | Options that further configure how the functions in -- Text.Read.Deriving should behave. newtype ReadOptions ReadOptions :: Bool -> ReadOptions -- | If True: -- -- -- -- If False: -- -- -- -- It's generally a good idea to enable this option, since -- readPrec and friends are more efficient than readsPrec -- and friends, since the former use the efficient ReadPrec -- parser datatype while the latter use the slower, list-based -- ReadS type. [useReadPrec] :: ReadOptions -> Bool -- | ReadOptions that favor readPrec over readsPrec. defaultReadOptions :: ReadOptions -- | Exports functions to mechanically derive Show, Show1, -- and Show2 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 Show instance declaration for the given data type -- or data family instance. deriveShow :: Name -> Q [Dec] -- | Like deriveShow, but takes a ShowOptions argument. deriveShowOptions :: ShowOptions -> Name -> Q [Dec] -- | Generates a lambda expression which behaves like showsPrec -- (without requiring a Show instance). makeShowsPrec :: Name -> Q Exp -- | Like makeShowsPrec, but takes a ShowOptions argument. makeShowsPrecOptions :: ShowOptions -> Name -> Q Exp -- | Generates a lambda expression which behaves like show (without -- requiring a Show instance). makeShow :: Name -> Q Exp -- | Like makeShow, but takes a ShowOptions argument. makeShowOptions :: ShowOptions -> Name -> Q Exp -- | Generates a lambda expression which behaves like showList -- (without requiring a Show instance). makeShowList :: Name -> Q Exp -- | Like makeShowList, but takes a ShowOptions argument. makeShowListOptions :: ShowOptions -> Name -> Q Exp -- | Generates a Show1 instance declaration for the given data type -- or data family instance. deriveShow1 :: Name -> Q [Dec] -- | Like deriveShow1, but takes a ShowOptions argument. deriveShow1Options :: ShowOptions -> Name -> Q [Dec] -- | Generates a lambda expression which behaves like -- liftShowsPrec (without requiring a Show1 instance). -- -- This function is not available with transformers-0.4. makeLiftShowsPrec :: Name -> Q Exp -- | Like makeLiftShowsPrec, but takes a ShowOptions -- argument. -- -- This function is not available with transformers-0.4. makeLiftShowsPrecOptions :: ShowOptions -> Name -> Q Exp -- | Generates a lambda expression which behaves like liftShowList -- (without requiring a Show instance). -- -- This function is not available with transformers-0.4. makeLiftShowList :: Name -> Q Exp -- | Like makeLiftShowList, but takes a ShowOptions argument. -- -- This function is not available with transformers-0.4. makeLiftShowListOptions :: ShowOptions -> Name -> Q Exp -- | Generates a lambda expression which behaves like showsPrec1 -- (without requiring a Show1 instance). makeShowsPrec1 :: Name -> Q Exp -- | Like makeShowsPrec1, but takes a ShowOptions argument. makeShowsPrec1Options :: ShowOptions -> Name -> Q Exp -- | Generates a Show2 instance declaration for the given data type -- or data family instance. -- -- This function is not available with transformers-0.4. deriveShow2 :: Name -> Q [Dec] -- | Like deriveShow2, but takes a ShowOptions argument. -- -- This function is not available with transformers-0.4. deriveShow2Options :: ShowOptions -> Name -> Q [Dec] -- | Generates a lambda expression which behaves like -- liftShowsPrec2 (without requiring a Show2 instance). -- -- This function is not available with transformers-0.4. makeLiftShowsPrec2 :: Name -> Q Exp -- | Like makeLiftShowsPrec2, but takes a ShowOptions -- argument. -- -- This function is not available with transformers-0.4. makeLiftShowsPrec2Options :: ShowOptions -> Name -> Q Exp -- | Generates a lambda expression which behaves like -- liftShowList2 (without requiring a Show instance). -- -- This function is not available with transformers-0.4. makeLiftShowList2 :: Name -> Q Exp -- | Like makeLiftShowList2, but takes a ShowOptions -- argument. -- -- This function is not available with transformers-0.4. makeLiftShowList2Options :: ShowOptions -> Name -> Q Exp -- | Generates a lambda expression which behaves like showsPrec2 -- (without requiring a Show2 instance). -- -- This function is not available with transformers-0.4. makeShowsPrec2 :: Name -> Q Exp -- | Like makeShowsPrec2, but takes a ShowOptions argument. -- -- This function is not available with transformers-0.4. makeShowsPrec2Options :: ShowOptions -> Name -> Q Exp -- | Options that further configure how the functions in -- Text.Show.Deriving should behave. data ShowOptions ShowOptions :: Bool -> Bool -> ShowOptions -- | If True, the derived Show, Show1, or Show2 -- instance will not surround the output of showing fields of unlifted -- types with parentheses, and the output will be suffixed with hash -- signs (#). [ghc8ShowBehavior] :: ShowOptions -> Bool -- | If True, derived instances for empty data types (i.e., ones -- with no data constructors) will use the EmptyCase language -- extension. If False, derived instances will simply use -- seq instead. (This has no effect on GHCs before 7.8, since -- EmptyCase is only available in 7.8 or later.) [showEmptyCaseBehavior] :: ShowOptions -> Bool -- | ShowOptions that match the behavior of the most recent GHC -- release. defaultShowOptions :: ShowOptions -- | ShowOptions 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 Show, Show1, -- and Show2 instances. module Text.Show.Deriving -- | Generates a Show instance declaration for the given data type -- or data family instance. deriveShow :: Name -> Q [Dec] -- | Like deriveShow, but takes a ShowOptions argument. deriveShowOptions :: ShowOptions -> Name -> Q [Dec] -- | Generates a lambda expression which behaves like showsPrec -- (without requiring a Show instance). makeShowsPrec :: Name -> Q Exp -- | Like makeShowsPrec, but takes a ShowOptions argument. makeShowsPrecOptions :: ShowOptions -> Name -> Q Exp -- | Generates a lambda expression which behaves like show (without -- requiring a Show instance). makeShow :: Name -> Q Exp -- | Like makeShow, but takes a ShowOptions argument. makeShowOptions :: ShowOptions -> Name -> Q Exp -- | Generates a lambda expression which behaves like showList -- (without requiring a Show instance). makeShowList :: Name -> Q Exp -- | Like makeShowList, but takes a ShowOptions argument. makeShowListOptions :: ShowOptions -> Name -> Q Exp -- | Generates a Show1 instance declaration for the given data type -- or data family instance. deriveShow1 :: Name -> Q [Dec] -- | Like deriveShow1, but takes a ShowOptions argument. deriveShow1Options :: ShowOptions -> Name -> Q [Dec] -- | Generates a lambda expression which behaves like -- liftShowsPrec (without requiring a Show1 instance). -- -- This function is not available with transformers-0.4. makeLiftShowsPrec :: Name -> Q Exp -- | Like makeLiftShowsPrec, but takes a ShowOptions -- argument. -- -- This function is not available with transformers-0.4. makeLiftShowsPrecOptions :: ShowOptions -> Name -> Q Exp -- | Generates a lambda expression which behaves like liftShowList -- (without requiring a Show instance). -- -- This function is not available with transformers-0.4. makeLiftShowList :: Name -> Q Exp -- | Like makeLiftShowList, but takes a ShowOptions argument. -- -- This function is not available with transformers-0.4. makeLiftShowListOptions :: ShowOptions -> Name -> Q Exp -- | Generates a lambda expression which behaves like showsPrec1 -- (without requiring a Show1 instance). makeShowsPrec1 :: Name -> Q Exp -- | Like makeShowsPrec1, but takes a ShowOptions argument. makeShowsPrec1Options :: ShowOptions -> Name -> Q Exp -- | Generates a Show2 instance declaration for the given data type -- or data family instance. -- -- This function is not available with transformers-0.4. deriveShow2 :: Name -> Q [Dec] -- | Like deriveShow2, but takes a ShowOptions argument. -- -- This function is not available with transformers-0.4. deriveShow2Options :: ShowOptions -> Name -> Q [Dec] -- | Generates a lambda expression which behaves like -- liftShowsPrec2 (without requiring a Show2 instance). -- -- This function is not available with transformers-0.4. makeLiftShowsPrec2 :: Name -> Q Exp -- | Like makeLiftShowsPrec2, but takes a ShowOptions -- argument. -- -- This function is not available with transformers-0.4. makeLiftShowsPrec2Options :: ShowOptions -> Name -> Q Exp -- | Generates a lambda expression which behaves like -- liftShowList2 (without requiring a Show instance). -- -- This function is not available with transformers-0.4. makeLiftShowList2 :: Name -> Q Exp -- | Like makeLiftShowList2, but takes a ShowOptions -- argument. -- -- This function is not available with transformers-0.4. makeLiftShowList2Options :: ShowOptions -> Name -> Q Exp -- | Generates a lambda expression which behaves like showsPrec2 -- (without requiring a Show2 instance). -- -- This function is not available with transformers-0.4. makeShowsPrec2 :: Name -> Q Exp -- | Like makeShowsPrec2, but takes a ShowOptions argument. -- -- This function is not available with transformers-0.4. makeShowsPrec2Options :: ShowOptions -> Name -> Q Exp -- | Options that further configure how the functions in -- Text.Show.Deriving should behave. data ShowOptions ShowOptions :: Bool -> Bool -> ShowOptions -- | If True, the derived Show, Show1, or Show2 -- instance will not surround the output of showing fields of unlifted -- types with parentheses, and the output will be suffixed with hash -- signs (#). [ghc8ShowBehavior] :: ShowOptions -> Bool -- | If True, derived instances for empty data types (i.e., ones -- with no data constructors) will use the EmptyCase language -- extension. If False, derived instances will simply use -- seq instead. (This has no effect on GHCs before 7.8, since -- EmptyCase is only available in 7.8 or later.) [showEmptyCaseBehavior] :: ShowOptions -> Bool -- | ShowOptions that match the behavior of the most recent GHC -- release. defaultShowOptions :: ShowOptions -- | ShowOptions 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 Data.Deriving.Via, which is -- only available on GHC 8.2 or later). This module also provides a -- high-level tutorial on deriving-compat's naming conventions -- and best practices. Typeclass-specific information can be found in -- their respective modules. module Data.Deriving