Safe Haskell | Trustworthy |
---|---|
Language | Haskell2010 |
Generic implementation of Read
Warning
This is an internal module: it is not subject to any versioning policy, breaking changes can happen at any time.
If something here seems useful, please report it or create a pull request to export it from an external module.
Synopsis
- greadPrec :: (Generic a, GRead0 (Rep a)) => ReadPrec a
- type GRead0 = GRead Proxy
- gliftReadPrec :: (Generic1 f, GRead1 (Rep1 f)) => ReadPrec a -> ReadPrec [a] -> ReadPrec (f a)
- type GRead1 = GRead Identity
- class GRead p f where
- class IsNullaryDataType f where
- isNullaryDataType :: f a -> Bool
- class GReadC p c f where
- class GReadFields p f where
- gPrecReadFields :: p (ReadPrec a, ReadPrec [a]) -> ReadPrecTree (f a)
- class GReadNamed p f where
- gPrecReadNamed :: p (ReadPrec a, ReadPrec [a]) -> ReadPrec (f a)
- class GReadSingle p f where
- gPrecReadSingle :: p (ReadPrec a, ReadPrec [a]) -> ReadPrec (f a)
- coerceM1 :: ReadPrec (f p) -> ReadPrec (M1 i c f p)
- liftReadPrecCompat :: Read1 f => (ReadPrec a, ReadPrec [a]) -> ReadPrec (f a)
- data ReadPrecTree a where
- U1Leaf :: ReadPrecTree (U1 a)
- M1Leaf :: ReadPrec (f a) -> ReadPrecTree (M1 i c f a)
- Branch :: ReadPrecTree (f a) -> ReadPrecTree (g a) -> ReadPrecTree ((f :*: g) a)
- toReadPrec :: ReadPrecTree a -> ReadPrec a
- identHLexemes :: String -> [Lexeme]
- readPrefixCon :: String -> ReadPrec ()
- readSurround :: Char -> ReadPrec a -> Char -> ReadPrec a
- snocView :: [a] -> Maybe ([a], a)
Documentation
greadPrec :: (Generic a, GRead0 (Rep a)) => ReadPrec a Source #
Generic readPrec
.
instanceRead
MyType wherereadPrec
=greadPrec
readListPrec
=readListPrecDefault
gliftReadPrec :: (Generic1 f, GRead1 (Rep1 f)) => ReadPrec a -> ReadPrec [a] -> ReadPrec (f a) Source #
Generic liftReadPrec
.
class IsNullaryDataType f where Source #
isNullaryDataType :: f a -> Bool Source #
Instances
IsNullaryDataType (V1 :: Type -> Type) Source # | |
Defined in Generic.Data.Internal.Read isNullaryDataType :: V1 a -> Bool Source # | |
IsNullaryDataType (f :+: g) Source # | |
Defined in Generic.Data.Internal.Read isNullaryDataType :: (f :+: g) a -> Bool Source # | |
IsNullaryDataType (C1 c f) Source # | |
Defined in Generic.Data.Internal.Read isNullaryDataType :: C1 c f a -> Bool Source # |
class GReadFields p f where Source #
gPrecReadFields :: p (ReadPrec a, ReadPrec [a]) -> ReadPrecTree (f a) Source #
Instances
GReadFields p (U1 :: Type -> Type) Source # | |
Defined in Generic.Data.Internal.Read gPrecReadFields :: p (ReadPrec a, ReadPrec [a]) -> ReadPrecTree (U1 a) Source # | |
(GReadFields p f, GReadFields p g) => GReadFields p (f :*: g) Source # | |
Defined in Generic.Data.Internal.Read gPrecReadFields :: p (ReadPrec a, ReadPrec [a]) -> ReadPrecTree ((f :*: g) a) Source # | |
GReadSingle p f => GReadFields p (M1 S c f) Source # | |
Defined in Generic.Data.Internal.Read gPrecReadFields :: p (ReadPrec a, ReadPrec [a]) -> ReadPrecTree (M1 S c f a) Source # |
class GReadNamed p f where Source #
Instances
GReadNamed p (U1 :: Type -> Type) Source # | |
Defined in Generic.Data.Internal.Read | |
(GReadNamed p f, GReadNamed p g) => GReadNamed p (f :*: g) Source # | |
Defined in Generic.Data.Internal.Read | |
(Selector c, GReadSingle p f) => GReadNamed p (M1 S c f) Source # | |
Defined in Generic.Data.Internal.Read |
class GReadSingle p f where Source #
Instances
GReadSingle Identity Par1 Source # | |
Defined in Generic.Data.Internal.Read | |
Read1 f => GReadSingle Identity (Rec1 f) Source # | |
Defined in Generic.Data.Internal.Read | |
Read a => GReadSingle p (K1 i a :: Type -> Type) Source # | |
Defined in Generic.Data.Internal.Read | |
(Read1 f, GReadSingle p g) => GReadSingle p (f :.: g) Source # | |
Defined in Generic.Data.Internal.Read |
liftReadPrecCompat :: Read1 f => (ReadPrec a, ReadPrec [a]) -> ReadPrec (f a) Source #
A backwards-compatible version of liftReadPrec
. This is needed for
compatibility with base-4.9
, where Read1
only offers liftReadsPrec
,
not liftReadPrec
.
data ReadPrecTree a where Source #
U1Leaf :: ReadPrecTree (U1 a) | |
M1Leaf :: ReadPrec (f a) -> ReadPrecTree (M1 i c f a) | |
Branch :: ReadPrecTree (f a) -> ReadPrecTree (g a) -> ReadPrecTree ((f :*: g) a) |
toReadPrec :: ReadPrecTree a -> ReadPrec a Source #
identHLexemes :: String -> [Lexeme] Source #
readPrefixCon :: String -> ReadPrec () Source #