| 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 | Haskell2010 |
Data.Functor.Classes.Generic.Internal
Description
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
- data Options = Options
- defaultOptions :: Options
- latestGHCOptions :: Options
- liftEqDefault :: (GEq1 (Rep1 f), Generic1 f) => (a -> b -> Bool) -> f a -> f b -> Bool
- liftEqOptions :: (GEq1 (Rep1 f), Generic1 f) => Options -> (a -> b -> Bool) -> f a -> f b -> Bool
- class (forall a. Eq a => GEq (t a)) => GEq1 (t :: Type -> Type) where
- liftCompareDefault :: (GOrd1 (Rep1 f), Generic1 f) => (a -> b -> Ordering) -> f a -> f b -> Ordering
- liftCompareOptions :: (GOrd1 (Rep1 f), Generic1 f) => Options -> (a -> b -> Ordering) -> f a -> f b -> Ordering
- class (GEq1 t, forall a. Ord a => GOrd (t a)) => GOrd1 (t :: Type -> Type) where
- gliftCompare :: (a -> b -> Ordering) -> t a -> t b -> Ordering
- liftReadsPrecDefault :: (GRead1 (Rep1 f), Generic1 f) => (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (f a)
- liftReadsPrecOptions :: (GRead1 (Rep1 f), Generic1 f) => Options -> (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (f a)
- class (forall a. Read a => GRead (f a)) => GRead1 (f :: Type -> Type) where
- gliftReadPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec (f a)
- class (forall a. Read a => GReadCon (f a)) => GRead1Con (f :: Type -> Type) where
- gliftReadPrecCon :: ConType -> ReadPrec a -> ReadPrec [a] -> ReadPrec (f a)
- liftShowsPrecDefault :: (GShow1 (Rep1 f), Generic1 f) => (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> f a -> ShowS
- liftShowsPrecOptions :: (GShow1 (Rep1 f), Generic1 f) => Options -> (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> f a -> ShowS
- class (forall a. Show a => GShow (f a)) => GShow1 (f :: Type -> Type) where
- class (forall a. Show a => GShowCon (f a)) => GShow1Con (f :: Type -> Type) where
- eqDefault :: (GEq (Rep1 f a), Generic1 f) => f a -> f a -> Bool
- class GEq a where
- compareDefault :: (GOrd (Rep1 f a), Generic1 f) => f a -> f a -> Ordering
- class GEq a => GOrd a where
- readsPrecDefault :: (GRead (Rep1 f a), Generic1 f) => Int -> ReadS (f a)
- class GRead a where
- showsPrecDefault :: (GShow (Rep1 f a), Generic1 f) => Int -> f a -> ShowS
- showsPrecOptions :: (GShow (Rep1 f a), Generic1 f) => Options -> Int -> f a -> ShowS
- class GShow a where
- gshowsPrec :: Int -> a -> ShowS
- newtype FunctorClassesDefault (f :: Type -> Type) a = FunctorClassesDefault {
- getFunctorClassesDefault :: f a
- data ConType
- class IsNullaryDataType (f :: Type -> Type) where
- isNullaryDataType :: f a -> Bool
- class IsNullaryCon (f :: Type -> Type) where
- isNullaryCon :: f a -> Bool
Options
Options that further configure how the functions in
Data.Functor.Classes.Generic should behave. Currently, the Options have
no effect (but this may change in the future).
Constructors
| Options |
defaultOptions :: Options Source #
Options that match the behavior of the installed version of GHC.
latestGHCOptions :: Options Source #
Options that match the behavior of the most recent GHC release.
Eq1
liftEqOptions :: (GEq1 (Rep1 f), Generic1 f) => Options -> (a -> b -> Bool) -> f a -> f b -> Bool Source #
Like liftEqDefault, but with configurable Options. Currently,
the Options have no effect (but this may change in the future).
class (forall a. Eq a => GEq (t a)) => GEq1 (t :: Type -> Type) where Source #
Class of generic representation types that can lift equality through unary type constructors.
Instances
| GEq1 Par1 Source # | |
| GEq1 (U1 :: Type -> Type) Source # | |
| GEq1 (UAddr :: Type -> Type) Source # | |
| GEq1 (UChar :: Type -> Type) Source # | |
| GEq1 (UDouble :: Type -> Type) Source # | |
| GEq1 (UFloat :: Type -> Type) Source # | |
| GEq1 (UInt :: Type -> Type) Source # | |
| GEq1 (UWord :: Type -> Type) Source # | |
| GEq1 (V1 :: Type -> Type) Source # | |
| Eq1 f => GEq1 (Rec1 f) Source # | |
| (GEq1 f, GEq1 g) => GEq1 (f :*: g) Source # | |
| (GEq1 f, GEq1 g) => GEq1 (f :+: g) Source # | |
| Eq c => GEq1 (K1 i c :: Type -> Type) Source # | |
| (Eq1 f, GEq1 g) => GEq1 (f :.: g) Source # | |
| GEq1 f => GEq1 (M1 i c f) Source # | |
Ord1
liftCompareDefault :: (GOrd1 (Rep1 f), Generic1 f) => (a -> b -> Ordering) -> f a -> f b -> Ordering Source #
A sensible default liftCompare implementation for Generic1 instances.
liftCompareOptions :: (GOrd1 (Rep1 f), Generic1 f) => Options -> (a -> b -> Ordering) -> f a -> f b -> Ordering Source #
Like liftCompareDefault, but with configurable Options. Currently,
the Options have no effect (but this may change in the future).
class (GEq1 t, forall a. Ord a => GOrd (t a)) => GOrd1 (t :: Type -> Type) where Source #
Class of generic representation types that can lift a total order through unary type constructors.
Methods
gliftCompare :: (a -> b -> Ordering) -> t a -> t b -> Ordering Source #
Instances
Read1
liftReadsPrecDefault :: (GRead1 (Rep1 f), Generic1 f) => (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (f a) Source #
A sensible default liftReadsPrec implementation for Generic1 instances.
liftReadsPrecOptions :: (GRead1 (Rep1 f), Generic1 f) => Options -> (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (f a) Source #
Like liftReadsPrecDefault, but with configurable Options. Currently,
the Options have no effect (but this may change in the future).
class (forall a. Read a => GRead (f a)) => GRead1 (f :: Type -> Type) where Source #
Class of generic representation types for unary type constructors that can
be parsed from a String.
Instances
| GRead1 (V1 :: Type -> Type) Source # | |
Defined in Data.Functor.Classes.Generic.Internal | |
| (GRead1 f, GRead1 g) => GRead1 (f :+: g) Source # | |
Defined in Data.Functor.Classes.Generic.Internal | |
| (Constructor c, GRead1Con f, IsNullaryCon f) => GRead1 (C1 c f) Source # | |
Defined in Data.Functor.Classes.Generic.Internal | |
| (GRead1 f, IsNullaryDataType f) => GRead1 (D1 d f) Source # | |
Defined in Data.Functor.Classes.Generic.Internal | |
class (forall a. Read a => GReadCon (f a)) => GRead1Con (f :: Type -> Type) where Source #
Class of generic representation types for unary type constructors that
can be parsed from a String, and for which the ConType has been
determined.
Instances
| GRead1Con Par1 Source # | |
Defined in Data.Functor.Classes.Generic.Internal | |
| GRead1Con (U1 :: Type -> Type) Source # | |
Defined in Data.Functor.Classes.Generic.Internal | |
| Read1 f => GRead1Con (Rec1 f) Source # | |
Defined in Data.Functor.Classes.Generic.Internal | |
| (GRead1Con f, GRead1Con g) => GRead1Con (f :*: g) Source # | |
Defined in Data.Functor.Classes.Generic.Internal | |
| Read c => GRead1Con (K1 i c :: Type -> Type) Source # | |
Defined in Data.Functor.Classes.Generic.Internal | |
| (Selector s, GRead1Con f) => GRead1Con (S1 s f) Source # | |
Defined in Data.Functor.Classes.Generic.Internal | |
| (Read1 f, GRead1Con g) => GRead1Con (f :.: g) Source # | |
Defined in Data.Functor.Classes.Generic.Internal | |
Show1
liftShowsPrecDefault :: (GShow1 (Rep1 f), Generic1 f) => (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> f a -> ShowS Source #
A sensible default liftShowsPrec implementation for Generic1 instances.
liftShowsPrecOptions :: (GShow1 (Rep1 f), Generic1 f) => Options -> (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> f a -> ShowS Source #
Like liftShowsPrecDefault, but with configurable Options. Currently,
the Options have no effect (but this may change in the future).
class (forall a. Show a => GShow (f a)) => GShow1 (f :: Type -> Type) where Source #
Class of generic representation types for unary type constructors that can
be converted to a String.
Instances
| GShow1 (V1 :: Type -> Type) Source # | |
Defined in Data.Functor.Classes.Generic.Internal | |
| (GShow1 f, GShow1 g) => GShow1 (f :+: g) Source # | |
Defined in Data.Functor.Classes.Generic.Internal | |
| (Constructor c, GShow1Con f, IsNullaryCon f) => GShow1 (C1 c f) Source # | |
Defined in Data.Functor.Classes.Generic.Internal | |
| GShow1 f => GShow1 (D1 d f) Source # | |
Defined in Data.Functor.Classes.Generic.Internal | |
class (forall a. Show a => GShowCon (f a)) => GShow1Con (f :: Type -> Type) where Source #
Class of generic representation types for unary type constructors that can
be converted to a String, and for which the ConType has been determined.
Methods
gliftShowsPrecCon :: ConType -> (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> f a -> ShowS Source #
Instances
| GShow1Con Par1 Source # | |
| GShow1Con (U1 :: Type -> Type) Source # | |
| GShow1Con (UChar :: Type -> Type) Source # | |
| GShow1Con (UDouble :: Type -> Type) Source # | |
| GShow1Con (UFloat :: Type -> Type) Source # | |
| GShow1Con (UInt :: Type -> Type) Source # | |
| GShow1Con (UWord :: Type -> Type) Source # | |
| Show1 f => GShow1Con (Rec1 f) Source # | |
| (GShow1Con f, GShow1Con g) => GShow1Con (f :*: g) Source # | |
| Show c => GShow1Con (K1 i c :: Type -> Type) Source # | |
| (Selector s, GShow1Con f) => GShow1Con (S1 s f) Source # | |
| (Show1 f, GShow1Con g) => GShow1Con (f :.: g) Source # | |
Eq
Class of generic representation types that can be checked for equality.
Instances
| Eq p => GEq (Par1 p) Source # | |
| GEq (U1 p) Source # | |
| GEq (UAddr p) Source # | |
| GEq (UChar p) Source # | |
| GEq (UDouble p) Source # | |
| GEq (UFloat p) Source # | |
| GEq (UInt p) Source # | |
| GEq (UWord p) Source # | |
| GEq (V1 p) Source # | |
| (Eq1 f, Eq p) => GEq (Rec1 f p) Source # | |
| (GEq (f p), GEq (g p)) => GEq ((f :*: g) p) Source # | |
| (GEq (f p), GEq (g p)) => GEq ((f :+: g) p) Source # | |
| Eq c => GEq (K1 i c p) Source # | |
| (Eq1 f, GEq (g p)) => GEq ((f :.: g) p) Source # | |
| GEq (f p) => GEq (M1 i c f p) Source # | |
Ord
class GEq a => GOrd a where Source #
Class of generic representation types that can be totally ordered.
Instances
| Ord p => GOrd (Par1 p) Source # | |
| GOrd (U1 p) Source # | |
| GOrd (UAddr p) Source # | |
| GOrd (UChar p) Source # | |
| GOrd (UDouble p) Source # | |
| GOrd (UFloat p) Source # | |
| GOrd (UInt p) Source # | |
| GOrd (UWord p) Source # | |
| GOrd (V1 p) Source # | |
| (Ord1 f, Ord p) => GOrd (Rec1 f p) Source # | |
| (GOrd (f p), GOrd (g p)) => GOrd ((f :*: g) p) Source # | |
| (GOrd (f p), GOrd (g p)) => GOrd ((f :+: g) p) Source # | |
| Ord c => GOrd (K1 i c p) Source # | |
| (Ord1 f, GOrd (g p)) => GOrd ((f :.: g) p) Source # | |
| GOrd (f p) => GOrd (M1 i c f p) Source # | |
Read
Class of generic representation types that can be parsed from a String.
Show
showsPrecOptions :: (GShow (Rep1 f a), Generic1 f) => Options -> Int -> f a -> ShowS Source #
Like showsPrecDefault, 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 converted to a String.
Methods
gshowsPrec :: Int -> a -> ShowS Source #
Instances
| GShow (V1 p) Source # | |
Defined in Data.Functor.Classes.Generic.Internal | |
| (GShow (f p), GShow (g p)) => GShow ((f :+: g) p) Source # | |
Defined in Data.Functor.Classes.Generic.Internal | |
| (Constructor c, GShowCon (f p), IsNullaryCon f) => GShow (C1 c f p) Source # | |
Defined in Data.Functor.Classes.Generic.Internal | |
| GShow (f p) => GShow (D1 d f p) Source # | |
Defined in Data.Functor.Classes.Generic.Internal | |
FunctorClassesDefault
newtype FunctorClassesDefault (f :: Type -> Type) a Source #
An adapter newtype, suitable for DerivingVia. Its Eq1, Ord1,
Read1, and Show1 instances leverage Generic1-based defaults.
Constructors
| FunctorClassesDefault | |
Fields
| |
Instances
Miscellaneous types
class IsNullaryDataType (f :: Type -> Type) where Source #
Class of generic representation types that represent a data type with zero or more constructors.
Instances
| IsNullaryDataType (V1 :: Type -> Type) Source # | |
Defined in Data.Functor.Classes.Generic.Internal Methods isNullaryDataType :: V1 a -> Bool Source # | |
| IsNullaryDataType (f :+: g) Source # | |
Defined in Data.Functor.Classes.Generic.Internal Methods isNullaryDataType :: (f :+: g) a -> Bool Source # | |
| IsNullaryDataType (C1 c f) Source # | |
Defined in Data.Functor.Classes.Generic.Internal Methods isNullaryDataType :: C1 c f a -> Bool Source # | |
class IsNullaryCon (f :: Type -> Type) where Source #
Class of generic representation types that represent a constructor with zero or more fields.