Data.Functor.Classes.Generic.Internal

transformers-compat-0.7.2: A small compatibility shim for the transformers library

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

Contents

- Options
- `Eq1`
- `Ord1`
- `Read1`
- `Show1`
- `Eq`
- `Ord`
- `Read`
- `Show`
- `FunctorClassesDefault`
- Miscellaneous types

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

- newtype Options = Options {
  - ghc8ShowBehavior :: Bool
  }
- 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 (forall a. Eq a => GEq (t a)) => GEq1 v (t :: Type -> Type) where
  - gliftEq :: Eq1Args v a b -> t a -> t b -> Bool
- data Eq1Args v a b where
  - V4Eq1Args :: forall a. Eq a => Eq1Args V4 a a
  - NonV4Eq1Args :: forall a b. (a -> b -> Bool) -> Eq1Args NonV4 a b
- 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, forall a. Ord a => GOrd (t a)) => GOrd1 v (t :: Type -> Type) where
  - gliftCompare :: Ord1Args v a b -> t a -> t b -> Ordering
- data Ord1Args v a b where
  - V4Ord1Args :: forall a. Ord a => Ord1Args V4 a a
  - NonV4Ord1Args :: forall a b. (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 (forall a. Read a => GRead (f a)) => GRead1 v (f :: Type -> Type) where
  - gliftReadPrec :: Read1Args v a -> ReadPrec (f a)
- class (forall a. Read a => GReadCon (f a)) => GRead1Con v (f :: Type -> Type) where
  - gliftReadPrecCon :: ConType -> Read1Args v a -> ReadPrec (f a)
- data Read1Args v a where
  - V4Read1Args :: forall a. Read a => Read1Args V4 a
  - NonV4Read1Args :: forall a. 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 (forall a. Show a => GShow (f a)) => GShow1 v (f :: Type -> Type) where
  - gliftShowsPrec :: Options -> Show1Args v a -> Int -> f a -> ShowS
- class (forall a. Show a => GShowCon (f a)) => GShow1Con v (f :: Type -> Type) where
  - gliftShowsPrecCon :: Options -> ConType -> Show1Args v a -> Int -> f a -> ShowS
- data Show1Args v a where
  - V4Show1Args :: forall a. Show a => Show1Args V4 a
  - NonV4Show1Args :: forall a. (Int -> a -> ShowS) -> ([a] -> ShowS) -> Show1Args NonV4 a
- eqDefault :: (GEq (Rep1 f a), Generic1 f) => f a -> f a -> Bool
- class GEq a where
  - geq :: a -> a -> Bool
- compareDefault :: (GOrd (Rep1 f a), Generic1 f) => f a -> f a -> Ordering
- class GEq a => GOrd a where
  - gcompare :: a -> a -> Ordering
- readsPrecDefault :: (GRead (Rep1 f a), Generic1 f) => Int -> ReadS (f a)
- class GRead a where
  - greadPrec :: ReadPrec a
- 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 :: Options -> Int -> a -> ShowS
- newtype FunctorClassesDefault (f :: Type -> Type) a = FunctorClassesDefault {
  - getFunctorClassesDefault :: f a
  }
- data V4
- data NonV4
- data ConType
  - = Rec
  - | Tup
  - | Pref
  - | Inf String
- class IsNullaryDataType (f :: Type -> Type) where
  - isNullaryDataType :: f a -> Bool
- class IsNullaryCon (f :: Type -> Type) where
  - isNullaryCon :: f a -> Bool

# Options

newtype Options #

Options that further configure how the functions in Data.Functor.Classes.Generic should behave.

Constructors

Options |
Fields ghc8ShowBehavior :: Bool If `True`, a default `Show1` implementation will show hash signs (`#`) when showing unlifted types.

defaultOptions :: Options #

Options that match the behavior of the installed version of GHC.

latestGHCOptions :: Options #

Options that match the behavior of the most recent GHC release.

# `Eq1`

liftEqDefault :: (GEq1 NonV4 (Rep1 f), Generic1 f) => (a -> b -> Bool) -> f a -> f b -> Bool #

A sensible default `liftEq` implementation for `Generic1` instances.

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 (forall a. Eq a => GEq (t a)) => GEq1 v (t :: Type -> Type) where #

Class of generic representation types that can lift equality through unary type constructors.

Methods

gliftEq :: Eq1Args v a b -> t a -> t b -> Bool #

#### Instances

Instances details

GEq1 NonV4 Par1 # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods gliftEq :: Eq1Args NonV4 a b -> Par1 a -> Par1 b -> Bool #
GEq1 v (U1 :: Type -> Type) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods gliftEq :: Eq1Args v a b -> U1 a -> U1 b -> Bool #
GEq1 v (UAddr :: Type -> Type) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods gliftEq :: Eq1Args v a b -> UAddr a -> UAddr b -> Bool #
GEq1 v (UChar :: Type -> Type) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods gliftEq :: Eq1Args v a b -> UChar a -> UChar b -> Bool #
GEq1 v (UDouble :: Type -> Type) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods gliftEq :: Eq1Args v a b -> UDouble a -> UDouble b -> Bool #
GEq1 v (UFloat :: Type -> Type) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods gliftEq :: Eq1Args v a b -> UFloat a -> UFloat b -> Bool #
GEq1 v (UInt :: Type -> Type) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods gliftEq :: Eq1Args v a b -> UInt a -> UInt b -> Bool #
GEq1 v (UWord :: Type -> Type) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods gliftEq :: Eq1Args v a b -> UWord a -> UWord b -> Bool #
GEq1 v (V1 :: Type -> Type) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods gliftEq :: Eq1Args v a b -> V1 a -> V1 b -> Bool #
Eq1 f => GEq1 NonV4 (Rec1 f) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods gliftEq :: Eq1Args NonV4 a b -> Rec1 f a -> Rec1 f b -> Bool #
(GEq1 v f, GEq1 v g) => GEq1 v (f :*: g) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods gliftEq :: Eq1Args v a b -> (f :*: g) a -> (f :*: g) b -> Bool #
(GEq1 v f, GEq1 v g) => GEq1 v (f :+: g) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods gliftEq :: Eq1Args v a b -> (f :+: g) a -> (f :+: g) b -> Bool #
Eq c => GEq1 v (K1 i c :: Type -> Type) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods gliftEq :: Eq1Args v a b -> K1 i c a -> K1 i c b -> Bool #
(Eq1 f, GEq1 NonV4 g) => GEq1 NonV4 (f :.: g) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods gliftEq :: Eq1Args NonV4 a b -> (f :.: g) a -> (f :.: g) b -> Bool #
GEq1 v f => GEq1 v (M1 i c f) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods gliftEq :: Eq1Args v a b -> M1 i c f a -> M1 i c f b -> Bool #

data Eq1Args v a b where #

An `Eq1Args` value either stores an `Eq a` dictionary (for the `transformers-0.4` version of `Eq1`), or it stores the function argument that checks the equality of occurrences of the type parameter (for the non-`transformers-0.4` version of `Eq1`).

Constructors

V4Eq1Args :: forall a. Eq a => Eq1Args V4 a a |
NonV4Eq1Args :: forall a b. (a -> b -> Bool) -> Eq1Args NonV4 a b |

# `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, forall a. Ord a => GOrd (t a)) => GOrd1 v (t :: Type -> Type) where #

Class of generic representation types that can lift a total order through unary type constructors.

Methods

gliftCompare :: Ord1Args v a b -> t a -> t b -> Ordering #

#### Instances

Instances details

GOrd1 NonV4 Par1 # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods gliftCompare :: Ord1Args NonV4 a b -> Par1 a -> Par1 b -> Ordering #
GOrd1 v (U1 :: Type -> Type) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods gliftCompare :: Ord1Args v a b -> U1 a -> U1 b -> Ordering #
GOrd1 v (UAddr :: Type -> Type) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods gliftCompare :: Ord1Args v a b -> UAddr a -> UAddr b -> Ordering #
GOrd1 v (UChar :: Type -> Type) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods gliftCompare :: Ord1Args v a b -> UChar a -> UChar b -> Ordering #
GOrd1 v (UDouble :: Type -> Type) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods gliftCompare :: Ord1Args v a b -> UDouble a -> UDouble b -> Ordering #
GOrd1 v (UFloat :: Type -> Type) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods gliftCompare :: Ord1Args v a b -> UFloat a -> UFloat b -> Ordering #
GOrd1 v (UInt :: Type -> Type) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods gliftCompare :: Ord1Args v a b -> UInt a -> UInt b -> Ordering #
GOrd1 v (UWord :: Type -> Type) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods gliftCompare :: Ord1Args v a b -> UWord a -> UWord b -> Ordering #
GOrd1 v (V1 :: Type -> Type) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods gliftCompare :: Ord1Args v a b -> V1 a -> V1 b -> Ordering #
Ord1 f => GOrd1 NonV4 (Rec1 f) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods gliftCompare :: Ord1Args NonV4 a b -> Rec1 f a -> Rec1 f b -> Ordering #
(GOrd1 v f, GOrd1 v g) => GOrd1 v (f :*: g) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods gliftCompare :: Ord1Args v a b -> (f :*: g) a -> (f :*: g) b -> Ordering #
(GOrd1 v f, GOrd1 v g) => GOrd1 v (f :+: g) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods gliftCompare :: Ord1Args v a b -> (f :+: g) a -> (f :+: g) b -> Ordering #
Ord c => GOrd1 v (K1 i c :: Type -> Type) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods gliftCompare :: Ord1Args v a b -> K1 i c a -> K1 i c b -> Ordering #
(Ord1 f, GOrd1 NonV4 g) => GOrd1 NonV4 (f :.: g) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods gliftCompare :: Ord1Args NonV4 a b -> (f :.: g) a -> (f :.: g) b -> Ordering #
GOrd1 v f => GOrd1 v (M1 i c f) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods gliftCompare :: Ord1Args v a b -> M1 i c f a -> M1 i c f b -> Ordering #

data Ord1Args v a b where #

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`).

Constructors

V4Ord1Args :: forall a. Ord a => Ord1Args V4 a a |
NonV4Ord1Args :: forall a b. (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 (forall a. Read a => GRead (f a)) => GRead1 v (f :: Type -> Type) where #

Class of generic representation types for unary type constructors that can be parsed from a `String`.

Methods

gliftReadPrec :: Read1Args v a -> ReadPrec (f a) #

#### Instances

Instances details

GRead1 v (V1 :: Type -> Type) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods gliftReadPrec :: Read1Args v a -> ReadPrec (V1 a) #
(GRead1 v f, GRead1 v g) => GRead1 v (f :+: g) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods gliftReadPrec :: Read1Args v a -> ReadPrec ((f :+: g) a) #
(Constructor c, GRead1Con v f, IsNullaryCon f) => GRead1 v (C1 c f) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods gliftReadPrec :: Read1Args v a -> ReadPrec (C1 c f a) #
(GRead1 v f, IsNullaryDataType f) => GRead1 v (D1 d f) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods gliftReadPrec :: Read1Args v a -> ReadPrec (D1 d f a) #

class (forall a. Read a => GReadCon (f a)) => GRead1Con v (f :: Type -> Type) where #

Class of generic representation types for unary type constructors that can be parsed from a `String`, and for which the `ConType` has been determined.

Methods

gliftReadPrecCon :: ConType -> Read1Args v a -> ReadPrec (f a) #

#### Instances

Instances details

GRead1Con NonV4 Par1 # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods gliftReadPrecCon :: ConType -> Read1Args NonV4 a -> ReadPrec (Par1 a) #
GRead1Con v (U1 :: Type -> Type) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods gliftReadPrecCon :: ConType -> Read1Args v a -> ReadPrec (U1 a) #
Read1 f => GRead1Con NonV4 (Rec1 f) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods gliftReadPrecCon :: ConType -> Read1Args NonV4 a -> ReadPrec (Rec1 f a) #
(GRead1Con v f, GRead1Con v g) => GRead1Con v (f :*: g) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods gliftReadPrecCon :: ConType -> Read1Args v a -> ReadPrec ((f :*: g) a) #
Read c => GRead1Con v (K1 i c :: Type -> Type) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods gliftReadPrecCon :: ConType -> Read1Args v a -> ReadPrec (K1 i c a) #
(Selector s, GRead1Con v f) => GRead1Con v (S1 s f) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods gliftReadPrecCon :: ConType -> Read1Args v a -> ReadPrec (S1 s f a) #
(Read1 f, GRead1Con NonV4 g) => GRead1Con NonV4 (f :.: g) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods gliftReadPrecCon :: ConType -> Read1Args NonV4 a -> ReadPrec ((f :.: g) a) #

data Read1Args v a where #

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`).

Constructors

V4Read1Args :: forall a. Read a => Read1Args V4 a |
NonV4Read1Args :: forall a. 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 (forall a. Show a => GShow (f a)) => GShow1 v (f :: Type -> Type) where #

Class of generic representation types for unary type constructors that can be converted to a `String`.

Methods

gliftShowsPrec :: Options -> Show1Args v a -> Int -> f a -> ShowS #

#### Instances

Instances details

GShow1 v (V1 :: Type -> Type) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods gliftShowsPrec :: Options -> Show1Args v a -> Int -> V1 a -> ShowS #
(GShow1 v f, GShow1 v g) => GShow1 v (f :+: g) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods gliftShowsPrec :: Options -> Show1Args v a -> Int -> (f :+: g) a -> ShowS #
(Constructor c, GShow1Con v f, IsNullaryCon f) => GShow1 v (C1 c f) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods gliftShowsPrec :: Options -> Show1Args v a -> Int -> C1 c f a -> ShowS #
GShow1 v f => GShow1 v (D1 d f) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods gliftShowsPrec :: Options -> Show1Args v a -> Int -> D1 d f a -> ShowS #

class (forall a. Show a => GShowCon (f a)) => GShow1Con v (f :: Type -> Type) where #

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 :: Options -> ConType -> Show1Args v a -> Int -> f a -> ShowS #

#### Instances

Instances details

GShow1Con NonV4 Par1 # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods gliftShowsPrecCon :: Options -> ConType -> Show1Args NonV4 a -> Int -> Par1 a -> ShowS #
GShow1Con v (U1 :: Type -> Type) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods gliftShowsPrecCon :: Options -> ConType -> Show1Args v a -> Int -> U1 a -> ShowS #
GShow1Con v (UChar :: Type -> Type) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods gliftShowsPrecCon :: Options -> ConType -> Show1Args v a -> Int -> UChar a -> ShowS #
GShow1Con v (UDouble :: Type -> Type) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods gliftShowsPrecCon :: Options -> ConType -> Show1Args v a -> Int -> UDouble a -> ShowS #
GShow1Con v (UFloat :: Type -> Type) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods gliftShowsPrecCon :: Options -> ConType -> Show1Args v a -> Int -> UFloat a -> ShowS #
GShow1Con v (UInt :: Type -> Type) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods gliftShowsPrecCon :: Options -> ConType -> Show1Args v a -> Int -> UInt a -> ShowS #
GShow1Con v (UWord :: Type -> Type) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods gliftShowsPrecCon :: Options -> ConType -> Show1Args v a -> Int -> UWord a -> ShowS #
Show1 f => GShow1Con NonV4 (Rec1 f) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods gliftShowsPrecCon :: Options -> ConType -> Show1Args NonV4 a -> Int -> Rec1 f a -> ShowS #
(GShow1Con v f, GShow1Con v g) => GShow1Con v (f :*: g) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods gliftShowsPrecCon :: Options -> ConType -> Show1Args v a -> Int -> (f :*: g) a -> ShowS #
Show c => GShow1Con v (K1 i c :: Type -> Type) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods gliftShowsPrecCon :: Options -> ConType -> Show1Args v a -> Int -> K1 i c a -> ShowS #
(Selector s, GShow1Con v f) => GShow1Con v (S1 s f) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods gliftShowsPrecCon :: Options -> ConType -> Show1Args v a -> Int -> S1 s f a -> ShowS #
(Show1 f, GShow1Con NonV4 g) => GShow1Con NonV4 (f :.: g) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods gliftShowsPrecCon :: Options -> ConType -> Show1Args NonV4 a -> Int -> (f :.: g) a -> ShowS #

data Show1Args v a where #

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`).

Constructors

V4Show1Args :: forall a. Show a => Show1Args V4 a |
NonV4Show1Args :: forall a. (Int -> a -> ShowS) -> ([a] -> ShowS) -> Show1Args NonV4 a |

# `Eq`

eqDefault :: (GEq (Rep1 f a), Generic1 f) => f a -> f a -> Bool #

A default `(`==`)` implementation for `Generic1` instances that leverages `Eq1`.

class GEq a where #

Class of generic representation types that can be checked for equality.

Methods

geq :: a -> a -> Bool #

#### Instances

Instances details

Eq p => GEq (Par1 p) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods geq :: Par1 p -> Par1 p -> Bool #
GEq (U1 p) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods geq :: U1 p -> U1 p -> Bool #
GEq (UAddr p) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods geq :: UAddr p -> UAddr p -> Bool #
GEq (UChar p) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods geq :: UChar p -> UChar p -> Bool #
GEq (UDouble p) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods geq :: UDouble p -> UDouble p -> Bool #
GEq (UFloat p) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods geq :: UFloat p -> UFloat p -> Bool #
GEq (UInt p) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods geq :: UInt p -> UInt p -> Bool #
GEq (UWord p) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods geq :: UWord p -> UWord p -> Bool #
GEq (V1 p) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods geq :: V1 p -> V1 p -> Bool #
(Eq1 f, Eq p) => GEq (Rec1 f p) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods geq :: Rec1 f p -> Rec1 f p -> Bool #
(GEq (f p), GEq (g p)) => GEq ((f :*: g) p) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods geq :: (f :*: g) p -> (f :*: g) p -> Bool #
(GEq (f p), GEq (g p)) => GEq ((f :+: g) p) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods geq :: (f :+: g) p -> (f :+: g) p -> Bool #
Eq c => GEq (K1 i c p) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods geq :: K1 i c p -> K1 i c p -> Bool #
(Eq1 f, GEq (g p)) => GEq ((f :.: g) p) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods geq :: (f :.: g) p -> (f :.: g) p -> Bool #
GEq (f p) => GEq (M1 i c f p) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods geq :: M1 i c f p -> M1 i c f p -> Bool #

# `Ord`

compareDefault :: (GOrd (Rep1 f a), Generic1 f) => f a -> f a -> Ordering #

A default `compare` implementation for `Generic1` instances that leverages `Ord1`.

class GEq a => GOrd a where #

Class of generic representation types that can be totally ordered.

Methods

gcompare :: a -> a -> Ordering #

#### Instances

Instances details

Ord p => GOrd (Par1 p) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods gcompare :: Par1 p -> Par1 p -> Ordering #
GOrd (U1 p) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods gcompare :: U1 p -> U1 p -> Ordering #
GOrd (UAddr p) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods gcompare :: UAddr p -> UAddr p -> Ordering #
GOrd (UChar p) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods gcompare :: UChar p -> UChar p -> Ordering #
GOrd (UDouble p) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods gcompare :: UDouble p -> UDouble p -> Ordering #
GOrd (UFloat p) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods gcompare :: UFloat p -> UFloat p -> Ordering #
GOrd (UInt p) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods gcompare :: UInt p -> UInt p -> Ordering #
GOrd (UWord p) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods gcompare :: UWord p -> UWord p -> Ordering #
GOrd (V1 p) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods gcompare :: V1 p -> V1 p -> Ordering #
(Ord1 f, Ord p) => GOrd (Rec1 f p) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods gcompare :: Rec1 f p -> Rec1 f p -> Ordering #
(GOrd (f p), GOrd (g p)) => GOrd ((f :*: g) p) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods gcompare :: (f :*: g) p -> (f :*: g) p -> Ordering #
(GOrd (f p), GOrd (g p)) => GOrd ((f :+: g) p) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods gcompare :: (f :+: g) p -> (f :+: g) p -> Ordering #
Ord c => GOrd (K1 i c p) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods gcompare :: K1 i c p -> K1 i c p -> Ordering #
(Ord1 f, GOrd (g p)) => GOrd ((f :.: g) p) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods gcompare :: (f :.: g) p -> (f :.: g) p -> Ordering #
GOrd (f p) => GOrd (M1 i c f p) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods gcompare :: M1 i c f p -> M1 i c f p -> Ordering #

# `Read`

readsPrecDefault :: (GRead (Rep1 f a), Generic1 f) => Int -> ReadS (f a) #

A default `readsPrec` implementation for `Generic1` instances that leverages `Read1`.

class GRead a where #

Class of generic representation types that can be parsed from a `String`.

Methods

greadPrec :: ReadPrec a #

#### Instances

Instances details

GRead (V1 p) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods greadPrec :: ReadPrec (V1 p) #
(GRead (f p), GRead (g p)) => GRead ((f :+: g) p) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods greadPrec :: ReadPrec ((f :+: g) p) #
(Constructor c, GReadCon (f p), IsNullaryCon f) => GRead (C1 c f p) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods greadPrec :: ReadPrec (C1 c f p) #
(GRead (f p), IsNullaryDataType f) => GRead (D1 d f p) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods greadPrec :: ReadPrec (D1 d f p) #

# `Show`

showsPrecDefault :: (GShow (Rep1 f a), Generic1 f) => Int -> f a -> ShowS #

A default `showsPrec` implementation for `Generic1` instances that leverages `Show1`.

showsPrecOptions :: (GShow (Rep1 f a), Generic1 f) => Options -> Int -> f a -> ShowS #

Like `showsPrecDefault`, but with configurable `Options`.

class GShow a where #

Class of generic representation types that can be converted to a `String`.

Methods

gshowsPrec :: Options -> Int -> a -> ShowS #

#### Instances

Instances details

GShow (V1 p) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods gshowsPrec :: Options -> Int -> V1 p -> ShowS #
(GShow (f p), GShow (g p)) => GShow ((f :+: g) p) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods gshowsPrec :: Options -> Int -> (f :+: g) p -> ShowS #
(Constructor c, GShowCon (f p), IsNullaryCon f) => GShow (C1 c f p) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods gshowsPrec :: Options -> Int -> C1 c f p -> ShowS #
GShow (f p) => GShow (D1 d f p) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods gshowsPrec :: Options -> Int -> D1 d f p -> ShowS #

# `FunctorClassesDefault`

newtype FunctorClassesDefault (f :: Type -> Type) a #

An adapter newtype, suitable for `DerivingVia`. Its `Eq1`, `Ord1`, `Read1`, and `Show1` instances leverage `Generic1`-based defaults.

Constructors

FunctorClassesDefault |
Fields getFunctorClassesDefault :: f a

#### Instances

Instances details

(GEq1 NonV4 (Rep1 f), Generic1 f) => Eq1 (FunctorClassesDefault f) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods liftEq :: (a -> b -> Bool) -> FunctorClassesDefault f a -> FunctorClassesDefault f b -> Bool #
(GOrd1 NonV4 (Rep1 f), Generic1 f) => Ord1 (FunctorClassesDefault f) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods liftCompare :: (a -> b -> Ordering) -> FunctorClassesDefault f a -> FunctorClassesDefault f b -> Ordering #
(GRead1 NonV4 (Rep1 f), Generic1 f) => Read1 (FunctorClassesDefault f) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods liftReadsPrec :: (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (FunctorClassesDefault f a) # liftReadList :: (Int -> ReadS a) -> ReadS [a] -> ReadS [FunctorClassesDefault f a] # liftReadPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec (FunctorClassesDefault f a) # liftReadListPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec [FunctorClassesDefault f a] #
(GShow1 NonV4 (Rep1 f), Generic1 f) => Show1 (FunctorClassesDefault f) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> FunctorClassesDefault f a -> ShowS # liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [FunctorClassesDefault f a] -> ShowS #
(GRead (Rep1 f a), Generic1 f) => Read (FunctorClassesDefault f a) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods readsPrec :: Int -> ReadS (FunctorClassesDefault f a) # readList :: ReadS [FunctorClassesDefault f a] # readPrec :: ReadPrec (FunctorClassesDefault f a) # readListPrec :: ReadPrec [FunctorClassesDefault f a] #
(GShow (Rep1 f a), Generic1 f) => Show (FunctorClassesDefault f a) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods showsPrec :: Int -> FunctorClassesDefault f a -> ShowS # show :: FunctorClassesDefault f a -> String # showList :: [FunctorClassesDefault f a] -> ShowS #
(GEq (Rep1 f a), Generic1 f) => Eq (FunctorClassesDefault f a) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods (==) :: FunctorClassesDefault f a -> FunctorClassesDefault f a -> Bool # (/=) :: FunctorClassesDefault f a -> FunctorClassesDefault f a -> Bool #
(GOrd (Rep1 f a), Generic1 f) => Ord (FunctorClassesDefault f a) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods compare :: FunctorClassesDefault f a -> FunctorClassesDefault f a -> Ordering # (<) :: FunctorClassesDefault f a -> FunctorClassesDefault f a -> Bool # (<=) :: FunctorClassesDefault f a -> FunctorClassesDefault f a -> Bool # (>) :: FunctorClassesDefault f a -> FunctorClassesDefault f a -> Bool # (>=) :: FunctorClassesDefault f a -> FunctorClassesDefault f a -> Bool # max :: FunctorClassesDefault f a -> FunctorClassesDefault f a -> FunctorClassesDefault f a # min :: FunctorClassesDefault f a -> FunctorClassesDefault f a -> FunctorClassesDefault f a #

# Miscellaneous types

data V4 #

A type-level indicator that the `transformers-0.4` version of a class method is being derived generically.

data NonV4 #

A type-level indicator that the non-`transformers-0.4` version of a class method is being derived generically.

#### Instances

Instances details

GEq1 NonV4 Par1 # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods gliftEq :: Eq1Args NonV4 a b -> Par1 a -> Par1 b -> Bool #
GOrd1 NonV4 Par1 # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods gliftCompare :: Ord1Args NonV4 a b -> Par1 a -> Par1 b -> Ordering #
GRead1Con NonV4 Par1 # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods gliftReadPrecCon :: ConType -> Read1Args NonV4 a -> ReadPrec (Par1 a) #
GShow1Con NonV4 Par1 # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods gliftShowsPrecCon :: Options -> ConType -> Show1Args NonV4 a -> Int -> Par1 a -> ShowS #
Eq1 f => GEq1 NonV4 (Rec1 f) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods gliftEq :: Eq1Args NonV4 a b -> Rec1 f a -> Rec1 f b -> Bool #
Ord1 f => GOrd1 NonV4 (Rec1 f) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods gliftCompare :: Ord1Args NonV4 a b -> Rec1 f a -> Rec1 f b -> Ordering #
Read1 f => GRead1Con NonV4 (Rec1 f) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods gliftReadPrecCon :: ConType -> Read1Args NonV4 a -> ReadPrec (Rec1 f a) #
Show1 f => GShow1Con NonV4 (Rec1 f) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods gliftShowsPrecCon :: Options -> ConType -> Show1Args NonV4 a -> Int -> Rec1 f a -> ShowS #
(Eq1 f, GEq1 NonV4 g) => GEq1 NonV4 (f :.: g) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods gliftEq :: Eq1Args NonV4 a b -> (f :.: g) a -> (f :.: g) b -> Bool #
(Ord1 f, GOrd1 NonV4 g) => GOrd1 NonV4 (f :.: g) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods gliftCompare :: Ord1Args NonV4 a b -> (f :.: g) a -> (f :.: g) b -> Ordering #
(Read1 f, GRead1Con NonV4 g) => GRead1Con NonV4 (f :.: g) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods gliftReadPrecCon :: ConType -> Read1Args NonV4 a -> ReadPrec ((f :.: g) a) #
(Show1 f, GShow1Con NonV4 g) => GShow1Con NonV4 (f :.: g) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods gliftShowsPrecCon :: Options -> ConType -> Show1Args NonV4 a -> Int -> (f :.: g) a -> ShowS #

data ConType #

Whether a constructor is a record (`Rec`), a tuple (`Tup`), is prefix (`Pref`), or infix (`Inf`).

Constructors

Rec |
Tup |
Pref |
Inf String |

class IsNullaryDataType (f :: Type -> Type) where #

Class of generic representation types that represent a data type with zero or more constructors.

Methods

isNullaryDataType :: f a -> Bool #

Returns `True` if the data type has no constructors.

#### Instances

Instances details

IsNullaryDataType (V1 :: Type -> Type) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods isNullaryDataType :: V1 a -> Bool #
IsNullaryDataType (f :+: g) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods isNullaryDataType :: (f :+: g) a -> Bool #
IsNullaryDataType (C1 c f) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods isNullaryDataType :: C1 c f a -> Bool #

class IsNullaryCon (f :: Type -> Type) where #

Class of generic representation types that represent a constructor with zero or more fields.

Methods

isNullaryCon :: f a -> Bool #

Returns `True` if the constructor has no fields.

#### Instances

Instances details

IsNullaryCon Par1 # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods isNullaryCon :: Par1 a -> Bool #
IsNullaryCon (U1 :: Type -> Type) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods isNullaryCon :: U1 a -> Bool #
IsNullaryCon (UChar :: Type -> Type) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods isNullaryCon :: UChar a -> Bool #
IsNullaryCon (UDouble :: Type -> Type) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods isNullaryCon :: UDouble a -> Bool #
IsNullaryCon (UFloat :: Type -> Type) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods isNullaryCon :: UFloat a -> Bool #
IsNullaryCon (UInt :: Type -> Type) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods isNullaryCon :: UInt a -> Bool #
IsNullaryCon (UWord :: Type -> Type) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods isNullaryCon :: UWord a -> Bool #
IsNullaryCon (Rec1 f) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods isNullaryCon :: Rec1 f a -> Bool #
IsNullaryCon (f :*: g) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods isNullaryCon :: (f :*: g) a -> Bool #
IsNullaryCon (K1 i c :: Type -> Type) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods isNullaryCon :: K1 i c a -> Bool #
IsNullaryCon f => IsNullaryCon (S1 s f) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods isNullaryCon :: S1 s f a -> Bool #
IsNullaryCon (f :.: g) # |
Instance details Defined in Data.Functor.Classes.Generic.Internal Methods isNullaryCon :: (f :.: g) a -> Bool #