-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Backports of GHC deriving extensions -- @package deriving-compat @version 0.1 -- | Exports functions to mechanically derive Foldable instances -- in a way that mimics how the -XDeriveFoldable extension works -- since GHC 7.12. These changes make it possible to derive -- Foldable instances for data types with existential -- constraints, e.g., -- --
-- {-# LANGUAGE DeriveFoldable, GADTs, StandaloneDeriving, TemplateHaskell #-}
--
-- data WrappedSet a where
-- WrapSet :: Ord a => a -> WrappedSet a
-- deriving instance Foldable WrappedSet -- On GHC 7.12 on later
-- $(deriveFoldable ''WrappedSet) -- On GHC 7.10 and earlier
--
--
-- 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. This mimics how the
-- -XDeriveFoldable extension works since GHC 7.12.
deriveFoldable :: Name -> Q [Dec]
-- | Generates a lambda expression which behaves like foldMap
-- (without requiring a Foldable instance). This mimics how the
-- -XDeriveFoldable extension works since GHC 7.12.
makeFoldMap :: Name -> Q Exp
-- | Generates a lambda expression which behaves like foldr (without
-- requiring a Foldable instance). This mimics how the
-- -XDeriveFoldable extension works since GHC 7.12.
makeFoldr :: Name -> Q Exp
instance Eq FoldFun