Copyright  (C) 20152016 Ryan Scott 

License  BSDstyle (see the file LICENSE) 
Maintainer  Ryan Scott 
Portability  Template Haskell 
Safe Haskell  None 
Language  Haskell2010 
Exports functions to mechanically derive Read
, Read1
, and Read2
instances.
 deriveRead :: Name > Q [Dec]
 deriveReadOptions :: ReadOptions > Name > Q [Dec]
 makeReadsPrec :: Name > Q Exp
 makeReadPrec :: Name > Q Exp
 deriveRead1 :: Name > Q [Dec]
 deriveRead1Options :: ReadOptions > Name > Q [Dec]
 makeLiftReadsPrec :: Name > Q Exp
 makeReadsPrec1 :: Name > Q Exp
 deriveRead2 :: Name > Q [Dec]
 deriveRead2Options :: ReadOptions > Name > Q [Dec]
 makeLiftReadsPrec2 :: Name > Q Exp
 makeReadsPrec2 :: Name > Q Exp
 newtype ReadOptions = ReadOptions {
 useReadPrec :: Bool
 defaultReadOptions :: ReadOptions
Read
deriveRead :: Name > Q [Dec] Source #
Generates a Read
instance declaration for the given data type or data
family instance.
deriveReadOptions :: ReadOptions > Name > Q [Dec] Source #
Like deriveRead
, but takes a ReadOptions
argument.
makeReadPrec :: Name > Q Exp Source #
Generates a lambda expression which behaves like readPrec
(without
requiring a Read
instance).
Read1
deriveRead1 :: Name > Q [Dec] Source #
Generates a Read1
instance declaration for the given data type or data
family instance.
deriveRead1Options :: ReadOptions > Name > Q [Dec] Source #
Like deriveRead1
, but takes a ReadOptions
argument.
makeLiftReadsPrec :: Name > Q Exp Source #
Generates a lambda expression which behaves like liftReadsPrec
(without
requiring a Read1
instance).
This function is not available with transformers0.4
.
makeReadsPrec1 :: Name > Q Exp Source #
Generates a lambda expression which behaves like readsPrec1
(without
requiring a Read1
instance).
Read2
deriveRead2 :: Name > Q [Dec] Source #
Generates a Read2
instance declaration for the given data type or data
family instance.
This function is not available with transformers0.4
.
deriveRead2Options :: ReadOptions > Name > Q [Dec] Source #
Like deriveRead2
, but takes a ReadOptions
argument.
This function is not available with transformers0.4
.
makeLiftReadsPrec2 :: Name > Q Exp Source #
Generates a lambda expression which behaves like liftReadsPrec2
(without
requiring a Read2
instance).
This function is not available with transformers0.4
.
makeReadsPrec2 :: Name > Q Exp Source #
Generates a lambda expression which behaves like readsPrec2
(without
requiring a Read2
instance).
This function is not available with transformers0.4
.
ReadOptions
newtype ReadOptions Source #
Options that further configure how the functions in Text.Read.Deriving should behave.
ReadOptions  

defaultReadOptions :: ReadOptions Source #
ReadOptions
that favor readPrec
over readsPrec
.
deriveRead
limitations
Be aware of the following potential gotchas:
 Type variables of kind
*
are assumed to haveRead
constraints. Type variables of kind* > *
are assumed to haveRead1
constraints. Type variables of kind* > * > *
are assumed to haveRead2
constraints. If this is not desirable, usemakeReadsPrec
or one of its cousins.  The
Read1
class had a different definition intransformers0.4
, and as a result,deriveRead1
implements different instances for thetransformers0.4
Read1
than it otherwise does. Also,makeLiftReadsPrec
andmakeLiftReadList
are not available when this library is built againsttransformers0.4
, only 'makeReadsPrec1.  The
Read2
class is not available intransformers0.4
, and as a result, neither are Template Haskell functions that deal withRead2
when this library is built againsttransformers0.4
.  The
Read1
andRead2
classes have new methods ('liftReadPrec'/'liftReadListPrec' and 'liftReadPrec2'/'liftReadListPrec2', respectively) that were introduced inbase4.10
. For now, these methods are only defined when deriving 'Read1'/'Read2' if built againstbase4.10
(untiltransformerscompat
catches up), and the correspondingmake
functions are also only available when built againstbase4.10
.