| Copyright | (C) 2015-2017 Ryan Scott |
|---|---|
| License | BSD-style (see the file LICENSE) |
| Maintainer | Ryan Scott |
| Portability | Template Haskell |
| Safe Haskell | None |
| Language | Haskell2010 |
Data.Functor.Deriving
Description
Exports functions to mechanically derive Functor instances.
For more info on how deriving Functor works, see
this GHC wiki page.
- deriveFunctor :: Name -> Q [Dec]
- deriveFunctorOptions :: FFTOptions -> Name -> Q [Dec]
- makeFmap :: Name -> Q Exp
- makeFmapOptions :: FFTOptions -> Name -> Q Exp
- newtype FFTOptions = FFTOptions {}
- defaultFFTOptions :: FFTOptions
Functor
deriveFunctor :: Name -> Q [Dec] Source #
Generates a Functor instance declaration for the given data type or data
family instance.
deriveFunctorOptions :: FFTOptions -> Name -> Q [Dec] Source #
Like deriveFunctor, but takes an FFTOptions argument.
makeFmapOptions :: FFTOptions -> Name -> Q Exp Source #
Like makeFmap, but takes an FFTOptions argument.
FFTOptions
newtype FFTOptions Source #
Options that further configure how the functions in Data.Functor.Deriving
should behave. (FFT stands for 'Functor'/'Foldable'/'Traversable'.)
Constructors
| FFTOptions | |
Fields | |
Instances
defaultFFTOptions :: FFTOptions Source #
Conservative FFTOptions that doesn't attempt to use EmptyCase (to
prevent users from having to enable that extension at use sites.)