Copyright | (C) 2015-2016 Edward Kmett Ryan Scott |
---|---|
License | BSD-style (see the file LICENSE) |
Maintainer | Ryan Scott |
Stability | Provisional |
Portability | GHC |
Safe Haskell | None |
Language | Haskell98 |
Internal functionality for Data.Functor.Classes.Generic.
This is an internal module and, as such, the API is not guaranteed to remain the same between any given release.
Synopsis
- newtype Options = Options {}
- defaultOptions :: Options
- latestGHCOptions :: Options
- liftEqDefault :: (GEq1 NonV4 (Rep1 f), Generic1 f) => (a -> b -> Bool) -> f a -> f b -> Bool
- liftEqOptions :: (GEq1 NonV4 (Rep1 f), Generic1 f) => Options -> (a -> b -> Bool) -> f a -> f b -> Bool
- class GEq1 v t where
- data Eq1Args v a b where
- liftCompareDefault :: (GOrd1 NonV4 (Rep1 f), Generic1 f) => (a -> b -> Ordering) -> f a -> f b -> Ordering
- liftCompareOptions :: (GOrd1 NonV4 (Rep1 f), Generic1 f) => Options -> (a -> b -> Ordering) -> f a -> f b -> Ordering
- class GEq1 v t => GOrd1 v t where
- gliftCompare :: Ord1Args v a b -> t a -> t b -> Ordering
- data Ord1Args v a b where
- V4Ord1Args :: Ord a => Ord1Args V4 a a
- NonV4Ord1Args :: (a -> b -> Ordering) -> Ord1Args NonV4 a b
- liftReadsPrecDefault :: (GRead1 NonV4 (Rep1 f), Generic1 f) => (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (f a)
- liftReadsPrecOptions :: (GRead1 NonV4 (Rep1 f), Generic1 f) => Options -> (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (f a)
- class GRead1 v f where
- gliftReadPrec :: Read1Args v a -> ReadPrec (f a)
- class GRead1Con v f where
- gliftReadPrecCon :: ConType -> Read1Args v a -> ReadPrec (f a)
- data Read1Args v a where
- V4Read1Args :: Read a => Read1Args V4 a
- NonV4Read1Args :: ReadPrec a -> ReadPrec [a] -> Read1Args NonV4 a
- liftShowsPrecDefault :: (GShow1 NonV4 (Rep1 f), Generic1 f) => (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> f a -> ShowS
- liftShowsPrecOptions :: (GShow1 NonV4 (Rep1 f), Generic1 f) => Options -> (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> f a -> ShowS
- class GShow1 v f where
- gliftShowsPrec :: Options -> Show1Args v a -> Int -> f a -> ShowS
- class GShow1Con v f where
- data Show1Args v a where
- V4Show1Args :: Show a => Show1Args V4 a
- NonV4Show1Args :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Show1Args NonV4 a
- data V4
- data NonV4
- data ConType
- class IsNullary f where
Options
Options that further configure how the functions in Data.Functor.Classes.Generic should behave.
Options that match the behavior of the installed version of GHC.
Options that match the behavior of the most recent GHC release.
Eq1
liftEqOptions :: (GEq1 NonV4 (Rep1 f), Generic1 f) => Options -> (a -> b -> Bool) -> f a -> f b -> Bool #
Like liftEqDefault
, but with configurable Options
. Currently,
the Options
have no effect (but this may change in the future).
Class of generic representation types that can be checked for equality.
Instances
GEq1 NonV4 Par1 # | |
GEq1 v (UWord :: Type -> Type) # | |
GEq1 v (UInt :: Type -> Type) # | |
GEq1 v (UFloat :: Type -> Type) # | |
GEq1 v (UDouble :: Type -> Type) # | |
GEq1 v (UChar :: Type -> Type) # | |
GEq1 v (UAddr :: Type -> Type) # | |
GEq1 v (V1 :: Type -> Type) # | |
GEq1 v (U1 :: Type -> Type) # | |
Eq1 f => GEq1 NonV4 (Rec1 f) # | |
(GEq1 v f, GEq1 v g) => GEq1 v (f :+: g) # | |
(GEq1 v f, GEq1 v g) => GEq1 v (f :*: g) # | |
Eq c => GEq1 v (K1 i c :: Type -> Type) # | |
GEq1 v f => GEq1 v (M1 i c f) # | |
(Eq1 f, GEq1 NonV4 g) => GEq1 NonV4 (f :.: g) # | |
Ord1
liftCompareDefault :: (GOrd1 NonV4 (Rep1 f), Generic1 f) => (a -> b -> Ordering) -> f a -> f b -> Ordering #
A sensible default liftCompare
implementation for Generic1
instances.
liftCompareOptions :: (GOrd1 NonV4 (Rep1 f), Generic1 f) => Options -> (a -> b -> Ordering) -> f a -> f b -> Ordering #
Like liftCompareDefault
, but with configurable Options
. Currently,
the Options
have no effect (but this may change in the future).
class GEq1 v t => GOrd1 v t where #
Class of generic representation types that can be totally ordered.
gliftCompare :: Ord1Args v a b -> t a -> t b -> Ordering #
Instances
An Ord1Args
value either stores an Ord a
dictionary (for the
transformers-0.4
version of Ord1
), or it stores the function argument that
compares occurrences of the type parameter (for the non-transformers-0.4
version of Ord1
).
V4Ord1Args :: Ord a => Ord1Args V4 a a | |
NonV4Ord1Args :: (a -> b -> Ordering) -> Ord1Args NonV4 a b |
Read1
liftReadsPrecDefault :: (GRead1 NonV4 (Rep1 f), Generic1 f) => (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (f a) #
A sensible default liftReadsPrec
implementation for Generic1
instances.
liftReadsPrecOptions :: (GRead1 NonV4 (Rep1 f), Generic1 f) => Options -> (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (f a) #
Like liftReadsPrecDefault
, but with configurable Options
. Currently,
the Options
have no effect (but this may change in the future).
Class of generic representation types that can be parsed from a String
.
gliftReadPrec :: Read1Args v a -> ReadPrec (f a) #
Instances
GRead1 v (V1 :: Type -> Type) # | |
Defined in Data.Functor.Classes.Generic.Internal gliftReadPrec :: Read1Args v a -> ReadPrec (V1 a) # | |
(Constructor c, GRead1Con v f, IsNullary f) => GRead1 v (C1 c f) # | |
Defined in Data.Functor.Classes.Generic.Internal gliftReadPrec :: Read1Args v a -> ReadPrec (C1 c f a) # | |
(GRead1 v f, GRead1 v g) => GRead1 v (f :+: g) # | |
Defined in Data.Functor.Classes.Generic.Internal gliftReadPrec :: Read1Args v a -> ReadPrec ((f :+: g) a) # | |
GRead1 v f => GRead1 v (D1 d f) # | |
Defined in Data.Functor.Classes.Generic.Internal gliftReadPrec :: Read1Args v a -> ReadPrec (D1 d f a) # |
Class of generic representation types that can be parsed from a String
, and
for which the ConType
has been determined.
gliftReadPrecCon :: ConType -> Read1Args v a -> ReadPrec (f a) #
Instances
GRead1Con NonV4 Par1 # | |
Defined in Data.Functor.Classes.Generic.Internal | |
GRead1Con v (U1 :: Type -> Type) # | |
Defined in Data.Functor.Classes.Generic.Internal | |
Read1 f => GRead1Con NonV4 (Rec1 f) # | |
Defined in Data.Functor.Classes.Generic.Internal | |
(GRead1Con v f, GRead1Con v g) => GRead1Con v (f :*: g) # | |
Defined in Data.Functor.Classes.Generic.Internal | |
(Selector s, GRead1Con v f) => GRead1Con v (S1 s f) # | |
Defined in Data.Functor.Classes.Generic.Internal | |
Read c => GRead1Con v (K1 i c :: Type -> Type) # | |
Defined in Data.Functor.Classes.Generic.Internal | |
(Read1 f, GRead1Con NonV4 g) => GRead1Con NonV4 (f :.: g) # | |
Defined in Data.Functor.Classes.Generic.Internal |
A Read1Args
value either stores a Read a
dictionary (for the
transformers-0.4
version of Read1
), or it stores the two function arguments
that parse occurrences of the type parameter (for the non-transformers-0.4
version of Read1
).
V4Read1Args :: Read a => Read1Args V4 a | |
NonV4Read1Args :: ReadPrec a -> ReadPrec [a] -> Read1Args NonV4 a |
Show1
liftShowsPrecDefault :: (GShow1 NonV4 (Rep1 f), Generic1 f) => (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> f a -> ShowS #
A sensible default liftShowsPrec
implementation for Generic1
instances.
liftShowsPrecOptions :: (GShow1 NonV4 (Rep1 f), Generic1 f) => Options -> (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> f a -> ShowS #
Like liftShowsPrecDefault
, but with configurable Options
.
Class of generic representation types that can be converted to a String
.
Instances
GShow1 v (V1 :: Type -> Type) # | |
Defined in Data.Functor.Classes.Generic.Internal | |
(Constructor c, GShow1Con v f, IsNullary f) => GShow1 v (C1 c f) # | |
Defined in Data.Functor.Classes.Generic.Internal | |
(GShow1 v f, GShow1 v g) => GShow1 v (f :+: g) # | |
Defined in Data.Functor.Classes.Generic.Internal | |
GShow1 v f => GShow1 v (D1 d f) # | |
Defined in Data.Functor.Classes.Generic.Internal |
Class of generic representation types that can be converted to a String
, and
for which the ConType
has been determined.
Instances
A Show1Args
value either stores a Show a
dictionary (for the
transformers-0.4
version of Show1
), or it stores the two function arguments
that show occurrences of the type parameter (for the non-transformers-0.4
version of Show1
).
V4Show1Args :: Show a => Show1Args V4 a | |
NonV4Show1Args :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Show1Args NonV4 a |
Miscellaneous types
A type-level indicator that the transformers-0.4
version of a class method
is being derived generically.
A type-level indicator that the non-transformers-0.4
version of a class
method is being derived generically.
Instances
GShow1Con NonV4 Par1 # | |
Defined in Data.Functor.Classes.Generic.Internal | |
GRead1Con NonV4 Par1 # | |
Defined in Data.Functor.Classes.Generic.Internal | |
GOrd1 NonV4 Par1 # | |
Defined in Data.Functor.Classes.Generic.Internal | |
GEq1 NonV4 Par1 # | |
Show1 f => GShow1Con NonV4 (Rec1 f) # | |
Defined in Data.Functor.Classes.Generic.Internal | |
Read1 f => GRead1Con NonV4 (Rec1 f) # | |
Defined in Data.Functor.Classes.Generic.Internal | |
Ord1 f => GOrd1 NonV4 (Rec1 f) # | |
Defined in Data.Functor.Classes.Generic.Internal | |
Eq1 f => GEq1 NonV4 (Rec1 f) # | |
(Show1 f, GShow1Con NonV4 g) => GShow1Con NonV4 (f :.: g) # | |
Defined in Data.Functor.Classes.Generic.Internal | |
(Read1 f, GRead1Con NonV4 g) => GRead1Con NonV4 (f :.: g) # | |
Defined in Data.Functor.Classes.Generic.Internal | |
(Ord1 f, GOrd1 NonV4 g) => GOrd1 NonV4 (f :.: g) # | |
Defined in Data.Functor.Classes.Generic.Internal | |
(Eq1 f, GEq1 NonV4 g) => GEq1 NonV4 (f :.: g) # | |
Class of generic representation types that represent a constructor with zero or more fields.
Instances
IsNullary Par1 # | |
Defined in Data.Functor.Classes.Generic.Internal | |
IsNullary (U1 :: Type -> Type) # | |
Defined in Data.Functor.Classes.Generic.Internal | |
IsNullary (UChar :: Type -> Type) # | |
Defined in Data.Functor.Classes.Generic.Internal | |
IsNullary (UDouble :: Type -> Type) # | |
Defined in Data.Functor.Classes.Generic.Internal | |
IsNullary (UFloat :: Type -> Type) # | |
Defined in Data.Functor.Classes.Generic.Internal | |
IsNullary (UInt :: Type -> Type) # | |
Defined in Data.Functor.Classes.Generic.Internal | |
IsNullary (UWord :: Type -> Type) # | |
Defined in Data.Functor.Classes.Generic.Internal | |
IsNullary (Rec1 f) # | |
Defined in Data.Functor.Classes.Generic.Internal | |
IsNullary (K1 i c :: Type -> Type) # | |
Defined in Data.Functor.Classes.Generic.Internal | |
IsNullary (f :*: g) # | |
Defined in Data.Functor.Classes.Generic.Internal | |
IsNullary f => IsNullary (S1 s f) # | |
Defined in Data.Functor.Classes.Generic.Internal | |
IsNullary (f :.: g) # | |
Defined in Data.Functor.Classes.Generic.Internal |