Safe Haskell | Trustworthy |
---|---|
Language | Haskell2010 |
Generic.Data.Internal.Read
Description
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 :: Type -> Type)
- gliftReadPrec :: (Generic1 f, GRead1 (Rep1 f)) => ReadPrec a -> ReadPrec [a] -> ReadPrec (f a)
- type GRead1 = GRead Identity
- class GRead (p :: Type -> Type) (f :: Type -> Type) where
- class IsNullaryDataType (f :: Type -> Type) where
- isNullaryDataType :: f a -> Bool
- class GReadC (p :: Type -> Type) (c :: Meta) (f :: Type -> Type) where
- class GReadFields (p :: Type -> Type) (f :: Type -> Type) where
- gPrecReadFields :: p (ReadPrec a, ReadPrec [a]) -> ReadPrecTree (f a)
- class GReadNamed (p :: Type -> Type) (f :: Type -> Type) where
- gPrecReadNamed :: p (ReadPrec a, ReadPrec [a]) -> ReadPrec (f a)
- class GReadSingle (p :: Type -> Type) (f :: Type -> Type) where
- gPrecReadSingle :: p (ReadPrec a, ReadPrec [a]) -> ReadPrec (f a)
- coerceM1 :: forall f p i (c :: Meta). ReadPrec (f p) -> ReadPrec (M1 i c f p)
- liftReadPrecCompat :: Read1 f => (ReadPrec a, ReadPrec [a]) -> ReadPrec (f a)
- data ReadPrecTree a where
- U1Leaf :: forall a1. ReadPrecTree (U1 a1)
- M1Leaf :: forall (f :: Type -> Type) a1 i (c :: Meta). ReadPrec (f a1) -> ReadPrecTree (M1 i c f a1)
- Branch :: forall (f :: Type -> Type) a1 (g :: Type -> Type). ReadPrecTree (f a1) -> ReadPrecTree (g a1) -> ReadPrecTree ((f :*: g) a1)
- 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 GRead (p :: Type -> Type) (f :: Type -> Type) where Source #
class IsNullaryDataType (f :: Type -> Type) where Source #
Methods
isNullaryDataType :: f a -> Bool Source #
Instances
IsNullaryDataType (V1 :: Type -> Type) Source # | |
Defined in Generic.Data.Internal.Read Methods isNullaryDataType :: V1 a -> Bool Source # | |
IsNullaryDataType (f :+: g) Source # | |
Defined in Generic.Data.Internal.Read Methods isNullaryDataType :: (f :+: g) a -> Bool Source # | |
IsNullaryDataType (C1 c f) Source # | |
Defined in Generic.Data.Internal.Read Methods isNullaryDataType :: C1 c f a -> Bool Source # |
class GReadC (p :: Type -> Type) (c :: Meta) (f :: Type -> Type) where Source #
Methods
gPrecReadC :: p (ReadPrec a, ReadPrec [a]) -> String -> Fixity -> ReadPrec (M1 C c f a) Source #
class GReadFields (p :: Type -> Type) (f :: Type -> Type) where Source #
Methods
gPrecReadFields :: p (ReadPrec a, ReadPrec [a]) -> ReadPrecTree (f a) Source #
Instances
GReadFields p (U1 :: Type -> Type) Source # | |
Defined in Generic.Data.Internal.Read Methods 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 Methods 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 Methods gPrecReadFields :: p (ReadPrec a, ReadPrec [a]) -> ReadPrecTree (M1 S c f a) Source # |
class GReadNamed (p :: Type -> Type) (f :: Type -> Type) 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 :: Type -> Type) (f :: Type -> Type) 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 #
Constructors
U1Leaf :: forall a1. ReadPrecTree (U1 a1) | |
M1Leaf :: forall (f :: Type -> Type) a1 i (c :: Meta). ReadPrec (f a1) -> ReadPrecTree (M1 i c f a1) | |
Branch :: forall (f :: Type -> Type) a1 (g :: Type -> Type). ReadPrecTree (f a1) -> ReadPrecTree (g a1) -> ReadPrecTree ((f :*: g) a1) |
toReadPrec :: ReadPrecTree a -> ReadPrec a Source #
identHLexemes :: String -> [Lexeme] Source #
readPrefixCon :: String -> ReadPrec () Source #