-- 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 extensions are covered: -- --
DeriveFoldable
DeriveFunctor
DeriveTraversable
-- 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] -- | Generates a lambda expression which behaves like traverse -- (without requiring a Traversable instance). makeTraverse :: Name -> Q Exp -- | Generates a lambda expression which behaves like sequenceA -- (without requiring a Traversable instance). makeSequenceA :: Name -> Q Exp -- | Generates a lambda expression which behaves like mapM (without -- requiring a Traversable instance). makeMapM :: Name -> Q Exp -- | Generates a lambda expression which behaves like sequence -- (without requiring a Traversable instance). makeSequence :: Name -> Q Exp -- | 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] -- | Generates a lambda expression which behaves like fmap (without -- requiring a Functor instance). makeFmap :: Name -> Q Exp -- | 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] -- | Generates a lambda expression which behaves like foldMap -- (without requiring a Foldable instance). makeFoldMap :: Name -> Q Exp -- | Generates a lambda expression which behaves like foldr (without -- requiring a Foldable instance). makeFoldr :: Name -> Q Exp -- | Generates a lambda expression which behaves like fold -- (without requiring a Foldable instance). makeFold :: Name -> Q Exp -- | Generates a lambda expression which behaves like foldl (without -- requiring a Foldable instance). makeFoldl :: Name -> Q Exp -- | This module reexports all of the functionality of the other modules in -- this library. It 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