-- 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: -- --
DeriveFoldable
DeriveFunctor
DeriveTraversable
DeriveDataTypeable
-- 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: -- --
-- 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: -- --