generic-data-0.9.2.0: Deriving instances with GHC.Generics and related utilities
Safe HaskellNone
LanguageHaskell2010

Generic.Data

Description

Generic combinators to derive type class instances.

Overview

base classes that GHC can not derive instances for, as of version 8.2:

On base < 4.12 (i.e., GHC < 8.6), import Generic.Data.Orphans to obtain instances needed internally to derive those.

GHC can derive instances for other classes here, although there may be types supported by one method but not the other or vice versa.

Minor discrepancies

Expand

Here are documented some corner cases of deriving, both by GHC and generic-data. They are all minor and unlikely to cause problems in practice.

Empty types

  • Some of the derived methods are lazy, which might result in errors being silenced, though unlikely.
  • The only generic-data implementation which differs from GHC stock instances is gfoldMap.
Class methodGHC stockgeneric-dataComment
(==)lazylazyTrue
comparelazylazyEQ
fmapstrictstrictmust be bottom anyway
foldMaplazystrictmempty if lazy
foldrlazylazyreturns accumulator
traversestrictstrict
sequenceAstrictstrict

Single-constructor single-field types

data types with one constructor and one field are extremely rare. newtype is almost always more appropriate (for which there is no issue).

That said, for data types both strict and lazy, all generic-data implementations are lazy (they don't even force the constructor), whereas GHC stock implementations, when they exist, are strict.

Functor composition

Fields of functors involving the composition of two or more functors f (g (h a)) result in some overhead using GHC.Generics.Generic1.

This is due to a particular encoding choice of GHC.Generics, where composition are nested to the right instead of to the left. f (g (h _)) is represented by the functor f :.: (g :.: Rec1 h), so one must use fmap on f to convert that back to `f (g (h _))`. A better choice would have been to encode it as (Rec1 f :.: g) :.: h, because that is coercible back to f (g (h _)).

Synopsis

Newtypes for Deriving Via

newtype Generically a Source #

Type with instances derived via Generic.

Examples

Deriving Eq, Ord, Show, Read

Expand
>>> :set -XDerivingVia -XDeriveGeneric
>>> :{
data T = C Int Bool
  deriving Generic
  deriving (Eq, Ord, Show, Read) via (Generically T)
:}

Deriving Semigroup, Monoid

Expand

The type must have only one constructor.

>>> :{
data U = D [Int] (Sum Int)
  deriving Generic
  deriving (Semigroup, Monoid) via (Generically U)
:}

Deriving Enum, Bounded

Expand

The type must have only nullary constructors. To lift that restriction, see FiniteEnumeration.

>>> :{
data V = X | Y | Z
  deriving Generic
  deriving (Eq, Ord, Enum, Bounded) via (Generically V)
:}

Constructors

Generically 

Fields

Instances

Instances details
(Generic a, GBounded (Rep a)) => Bounded (Generically a) Source # 
Instance details

Defined in Generic.Data.Internal.Generically

(Generic a, GEnum StandardEnum (Rep a)) => Enum (Generically a) Source # 
Instance details

Defined in Generic.Data.Internal.Generically

(Generic a, Eq (Rep a ())) => Eq (Generically a) Source # 
Instance details

Defined in Generic.Data.Internal.Generically

(Generic a, Ord (Rep a ())) => Ord (Generically a) Source # 
Instance details

Defined in Generic.Data.Internal.Generically

(Generic a, GRead0 (Rep a)) => Read (Generically a) Source # 
Instance details

Defined in Generic.Data.Internal.Generically

(Generic a, GShow0 (Rep a)) => Show (Generically a) Source # 
Instance details

Defined in Generic.Data.Internal.Generically

(Generic a, Ord (Rep a ()), GIx (Rep a)) => Ix (Generically a) Source # 
Instance details

Defined in Generic.Data.Internal.Generically

Generic a => Generic (Generically a) Source # 
Instance details

Defined in Generic.Data.Internal.Generically

Associated Types

type Rep (Generically a) :: Type -> Type #

Methods

from :: Generically a -> Rep (Generically a) x #

to :: Rep (Generically a) x -> Generically a #

(AssertNoSum Semigroup a, Generic a, Semigroup (Rep a ())) => Semigroup (Generically a) Source # 
Instance details

Defined in Generic.Data.Internal.Generically

(AssertNoSum Semigroup a, Semigroup a, Generic a, Monoid (Rep a ())) => Monoid (Generically a) Source #

This uses the Semigroup instance of the wrapped type a to define mappend. The purpose of this instance is to derive mempty, while remaining consistent with possibly custom Semigroup instances.

Instance details

Defined in Generic.Data.Internal.Generically

type Rep (Generically a) Source # 
Instance details

Defined in Generic.Data.Internal.Generically

type Rep (Generically a) = Rep a

newtype GenericProduct a Source #

Product type with generic instances of Semigroup and Monoid.

This is similar to Generically in most cases, but GenericProduct also works for types T with deriving via GenericProduct U, where U is a generic product type coercible to, but distinct from T. In particular, U may not have an instance of Semigroup, which Generically requires.

Example

Expand
>>> :set -XDeriveGeneric -XDerivingVia
>>> data Point a = Point a a deriving Generic
>>> :{
  newtype Vector a = Vector (Point a)
    deriving (Semigroup, Monoid)
      via GenericProduct (Point (Sum a))
:}

If it were via Generically (Point (Sum a)) instead, then Vector's mappend (the Monoid method) would be defined as Point's (<>) (the Semigroup method), which might not exist, or might not be equivalent to Vector's generic Semigroup instance, which would be unlawful.

Constructors

GenericProduct 

Fields

newtype FiniteEnumeration a Source #

Type with Enum instance derived via Generic with FiniteEnum option. This allows deriving Enum for types whose constructors have fields.

Some caution is advised; see details in FiniteEnum.

Example

Expand
>>> :{
data Booool = Booool Bool Bool
  deriving Generic
  deriving (Enum, Bounded) via (FiniteEnumeration Booool)
:}

Constructors

FiniteEnumeration 

Fields

newtype Generically1 f a Source #

Type with instances derived via Generic1.

Examples

Deriving Functor, Applicative, Alternative

Expand

Applicative can be derived for types with only one constructor, aka. products.

>>> :{
data F a = F1 a | F2 (Maybe a) | F3 [Either Bool a] (Int, a)
  deriving Generic1
  deriving Functor via (Generically1 F)
:}
>>> :{
data G a = G a (Maybe a) [a] (IO a)
  deriving Generic1
  deriving (Functor, Applicative) via (Generically1 G)
:}
>>> :{
data G' a = G' (Maybe a) [a]
  deriving Generic1
  deriving (Functor, Applicative, Alternative) via (Generically1 G')
:}

Deriving Foldable

Expand
>>> import Generic.Data.Orphans ()
>>> :{
data H a = H1 a | H2 (Maybe a)
  deriving Generic1
  deriving (Functor, Foldable) via (Generically1 H)
:}

Note: we can't use DerivingVia for Traversable. One may implement Traversable explicitly using gtraverse.

Deriving Eq1, Ord1

Expand
>>> :{
data I a = I [a] (Maybe a)
  deriving Generic1
  deriving (Eq1, Ord1) via (Generically1 I)
:}

Constructors

Generically1 

Fields

Instances

Instances details
(Generic1 f, Functor (Rep1 f)) => Functor (Generically1 f) Source # 
Instance details

Defined in Generic.Data.Internal.Generically

Methods

fmap :: (a -> b) -> Generically1 f a -> Generically1 f b #

(<$) :: a -> Generically1 f b -> Generically1 f a #

(Generic1 f, Applicative (Rep1 f)) => Applicative (Generically1 f) Source # 
Instance details

Defined in Generic.Data.Internal.Generically

Methods

pure :: a -> Generically1 f a #

(<*>) :: Generically1 f (a -> b) -> Generically1 f a -> Generically1 f b #

liftA2 :: (a -> b -> c) -> Generically1 f a -> Generically1 f b -> Generically1 f c #

(*>) :: Generically1 f a -> Generically1 f b -> Generically1 f b #

(<*) :: Generically1 f a -> Generically1 f b -> Generically1 f a #

(Generic1 f, GFoldable (Rep1 f)) => Foldable (Generically1 f) Source # 
Instance details

Defined in Generic.Data.Internal.Generically

Methods

fold :: Monoid m => Generically1 f m -> m #

foldMap :: Monoid m => (a -> m) -> Generically1 f a -> m #

foldMap' :: Monoid m => (a -> m) -> Generically1 f a -> m #

foldr :: (a -> b -> b) -> b -> Generically1 f a -> b #

foldr' :: (a -> b -> b) -> b -> Generically1 f a -> b #

foldl :: (b -> a -> b) -> b -> Generically1 f a -> b #

foldl' :: (b -> a -> b) -> b -> Generically1 f a -> b #

foldr1 :: (a -> a -> a) -> Generically1 f a -> a #

foldl1 :: (a -> a -> a) -> Generically1 f a -> a #

toList :: Generically1 f a -> [a] #

null :: Generically1 f a -> Bool #

length :: Generically1 f a -> Int #

elem :: Eq a => a -> Generically1 f a -> Bool #

maximum :: Ord a => Generically1 f a -> a #

minimum :: Ord a => Generically1 f a -> a #

sum :: Num a => Generically1 f a -> a #

product :: Num a => Generically1 f a -> a #

(Generic1 f, Functor (Rep1 f), GFoldable (Rep1 f), GTraversable (Rep1 f)) => Traversable (Generically1 f) Source # 
Instance details

Defined in Generic.Data.Internal.Generically

Methods

traverse :: Applicative f0 => (a -> f0 b) -> Generically1 f a -> f0 (Generically1 f b) #

sequenceA :: Applicative f0 => Generically1 f (f0 a) -> f0 (Generically1 f a) #

mapM :: Monad m => (a -> m b) -> Generically1 f a -> m (Generically1 f b) #

sequence :: Monad m => Generically1 f (m a) -> m (Generically1 f a) #

(Generic1 f, Eq1 (Rep1 f)) => Eq1 (Generically1 f) Source # 
Instance details

Defined in Generic.Data.Internal.Generically

Methods

liftEq :: (a -> b -> Bool) -> Generically1 f a -> Generically1 f b -> Bool #

(Generic1 f, Ord1 (Rep1 f)) => Ord1 (Generically1 f) Source # 
Instance details

Defined in Generic.Data.Internal.Generically

Methods

liftCompare :: (a -> b -> Ordering) -> Generically1 f a -> Generically1 f b -> Ordering #

(Generic1 f, GRead1 (Rep1 f)) => Read1 (Generically1 f) Source # 
Instance details

Defined in Generic.Data.Internal.Generically

(Generic1 f, GShow1 (Rep1 f)) => Show1 (Generically1 f) Source # 
Instance details

Defined in Generic.Data.Internal.Generically

Methods

liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> Generically1 f a -> ShowS #

liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [Generically1 f a] -> ShowS #

(Generic1 f, Alternative (Rep1 f)) => Alternative (Generically1 f) Source # 
Instance details

Defined in Generic.Data.Internal.Generically

Methods

empty :: Generically1 f a #

(<|>) :: Generically1 f a -> Generically1 f a -> Generically1 f a #

some :: Generically1 f a -> Generically1 f [a] #

many :: Generically1 f a -> Generically1 f [a] #

Generic1 f => Generic1 (Generically1 f :: Type -> Type) Source # 
Instance details

Defined in Generic.Data.Internal.Generically

Associated Types

type Rep1 (Generically1 f) :: k -> Type #

Methods

from1 :: forall (a :: k). Generically1 f a -> Rep1 (Generically1 f) a #

to1 :: forall (a :: k). Rep1 (Generically1 f) a -> Generically1 f a #

(Generic1 f, Eq1 (Rep1 f), Eq a) => Eq (Generically1 f a) Source # 
Instance details

Defined in Generic.Data.Internal.Generically

Methods

(==) :: Generically1 f a -> Generically1 f a -> Bool #

(/=) :: Generically1 f a -> Generically1 f a -> Bool #

(Generic1 f, Ord1 (Rep1 f), Ord a) => Ord (Generically1 f a) Source # 
Instance details

Defined in Generic.Data.Internal.Generically

(Generic1 f, GRead1 (Rep1 f), Read a) => Read (Generically1 f a) Source # 
Instance details

Defined in Generic.Data.Internal.Generically

(Generic1 f, GShow1 (Rep1 f), Show a) => Show (Generically1 f a) Source # 
Instance details

Defined in Generic.Data.Internal.Generically

Generic (f a) => Generic (Generically1 f a) Source # 
Instance details

Defined in Generic.Data.Internal.Generically

Associated Types

type Rep (Generically1 f a) :: Type -> Type #

Methods

from :: Generically1 f a -> Rep (Generically1 f a) x #

to :: Rep (Generically1 f a) x -> Generically1 f a #

type Rep1 (Generically1 f :: Type -> Type) Source # 
Instance details

Defined in Generic.Data.Internal.Generically

type Rep1 (Generically1 f :: Type -> Type) = Rep1 f
type Rep (Generically1 f a) Source # 
Instance details

Defined in Generic.Data.Internal.Generically

type Rep (Generically1 f a) = Rep (f a)

Regular classes

Default implementations for classes indexed by types (kind Type).

Semigroup

gmappend :: (Generic a, Semigroup (Rep a ())) => a -> a -> a Source #

Generic (<>) (or mappend).

instance Semigroup MyType where
  (<>) = gmappend

See also gmempty.

Monoid

gmempty :: (Generic a, Monoid (Rep a ())) => a Source #

Generic mempty.

instance Monoid MyType where
  mempty = gmempty

gmappend' :: (Generic a, Monoid (Rep a ())) => a -> a -> a Source #

Generic (<>) (or mappend).

The difference from gmappend is the Monoid constraint instead of Semigroup, for older versions of base where Semigroup is not a superclass of Monoid.

Eq

Can also be derived by GHC as part of the standard.

geq :: (Generic a, Eq (Rep a ())) => a -> a -> Bool Source #

Generic (==).

instance Eq MyType where
  (==) = geq

Ord

Can also be derived by GHC as part of the standard.

gcompare :: (Generic a, Ord (Rep a ())) => a -> a -> Ordering Source #

Generic compare.

instance Ord MyType where
  compare = gcompare

Read

Can also be derived by GHC as part of the standard.

greadPrec :: (Generic a, GRead0 (Rep a)) => ReadPrec a Source #

Generic readPrec.

instance Read MyType where
  readPrec = greadPrec
  readListPrec = readListPrecDefault

type GRead0 = GRead Proxy Source #

Generic representation of Read types.

Show

Can also be derived by GHC as part of the standard.

gshowsPrec :: (Generic a, GShow0 (Rep a)) => Int -> a -> ShowS Source #

Generic showsPrec.

instance Show MyType where
  showsPrec = gshowsPrec

type GShow0 = GShow Proxy Source #

Generic representation of Show types.

Enum

class GEnum opts f Source #

Generic representation of Enum types.

The opts parameter is a type-level option to select different implementations.

Minimal complete definition

gCardinality, gFromEnum, gToEnum

Instances

Instances details
GEnum opts (U1 :: Type -> Type) Source # 
Instance details

Defined in Generic.Data.Internal.Enum

(GEnum opts f, GEnum opts g) => GEnum opts (f :+: g) Source # 
Instance details

Defined in Generic.Data.Internal.Enum

Methods

gCardinality :: Int Source #

gFromEnum :: (f :+: g) p -> Int Source #

gToEnum :: Int -> (f :+: g) p Source #

(Bounded c, Enum c) => GEnum FiniteEnum (K1 i c :: Type -> Type) Source # 
Instance details

Defined in Generic.Data.Internal.Enum

Methods

gCardinality :: Int Source #

gFromEnum :: K1 i c p -> Int Source #

gToEnum :: Int -> K1 i c p Source #

(GEnum FiniteEnum f, GEnum FiniteEnum g) => GEnum FiniteEnum (f :*: g) Source # 
Instance details

Defined in Generic.Data.Internal.Enum

Methods

gCardinality :: Int Source #

gFromEnum :: (f :*: g) p -> Int Source #

gToEnum :: Int -> (f :*: g) p Source #

GEnum opts f => GEnum opts (M1 i c f) Source # 
Instance details

Defined in Generic.Data.Internal.Enum

Methods

gCardinality :: Int Source #

gFromEnum :: M1 i c f p -> Int Source #

gToEnum :: Int -> M1 i c f p Source #

StandardEnum option

Can also be derived by GHC as part of the standard.

data StandardEnum Source #

Standard option for GEnum: derive Enum for types with only nullary constructors (the same restrictions as in the Haskell 2010 report).

gfromEnum :: (Generic a, GEnum StandardEnum (Rep a)) => a -> Int Source #

Generic fromEnum generated with the StandardEnum option.

See also gtoEnum.

genumFrom :: (Generic a, GEnum StandardEnum (Rep a)) => a -> [a] Source #

Generic enumFrom generated with the StandardEnum option.

See also gtoEnum.

genumFromThen :: (Generic a, GEnum StandardEnum (Rep a)) => a -> a -> [a] Source #

Generic enumFromThen generated with the StandardEnum option.

See also gtoEnum.

genumFromTo :: (Generic a, GEnum StandardEnum (Rep a)) => a -> a -> [a] Source #

Generic enumFromTo generated with the StandardEnum option.

See also gtoEnum.

genumFromThenTo :: (Generic a, GEnum StandardEnum (Rep a)) => a -> a -> a -> [a] Source #

Generic enumFromThenTo generated with the StandardEnum option.

See also gtoEnum.

FiniteEnum option

data FiniteEnum Source #

Extends the StandardEnum option for GEnum to allow all constructors to have arbitrary many fields. Each field type must be an instance of both Enum and Bounded.

Details

Expand

Two restrictions require the user's caution:

  • The Enum instances of the field types need to start enumerating from 0. Particularly Int is an unfit field type, because the enumeration of the negative values starts before 0.
  • There can only be up to maxBound :: Int values (because the implementation represents the cardinality explicitly as an Int). This restriction makes Word an invalid field type. Notably, it is insufficient for each individual field types to stay below this limit. Instead it applies to the generic type as a whole.

The resulting GEnum instance starts enumerating from 0 up to (cardinality - 1) and respects the generic Ord instance (defined by gcompare). The values from different constructors are enumerated sequentially; they are not interleaved.

data Example = C0 Bool Bool | C1 Bool
  deriving (Eq, Ord, Show, Generic)

cardinality = 6  -- 2    * 2    + 2
                 -- Bool * Bool | Bool

enumeration =
    [ C0 False False
    , C0 False  True
    , C0  True False
    , C0  True  True
    , C1 False
    , C1 True
    ]

enumeration == map gtoFiniteEnum [0 .. 5]
[0 .. 5] == map gfromFiniteEnum enumeration

Instances

Instances details
(Bounded c, Enum c) => GEnum FiniteEnum (K1 i c :: Type -> Type) Source # 
Instance details

Defined in Generic.Data.Internal.Enum

Methods

gCardinality :: Int Source #

gFromEnum :: K1 i c p -> Int Source #

gToEnum :: Int -> K1 i c p Source #

(GEnum FiniteEnum f, GEnum FiniteEnum g) => GEnum FiniteEnum (f :*: g) Source # 
Instance details

Defined in Generic.Data.Internal.Enum

Methods

gCardinality :: Int Source #

gFromEnum :: (f :*: g) p -> Int Source #

gToEnum :: Int -> (f :*: g) p Source #

gfromFiniteEnum :: (Generic a, GEnum FiniteEnum (Rep a)) => a -> Int Source #

Generic fromEnum generated with the FiniteEnum option.

See also gtoFiniteEnum.

gfiniteEnumFrom :: (Generic a, GEnum FiniteEnum (Rep a)) => a -> [a] Source #

Generic enumFrom generated with the FiniteEnum option.

See also gtoFiniteEnum.

gfiniteEnumFromThen :: (Generic a, GEnum FiniteEnum (Rep a)) => a -> a -> [a] Source #

Generic enumFromThen generated with the FiniteEnum option.

See also gtoFiniteEnum.

gfiniteEnumFromTo :: (Generic a, GEnum FiniteEnum (Rep a)) => a -> a -> [a] Source #

Generic enumFromTo generated with the FiniteEnum option.

See also gtoFiniteEnum.

gfiniteEnumFromThenTo :: (Generic a, GEnum FiniteEnum (Rep a)) => a -> a -> a -> [a] Source #

Generic enumFromThenTo generated with the FiniteEnum option.

See also gtoFiniteEnum.

Bounded

Can also be derived by GHC as part of the standard.

gminBound :: (Generic a, GBounded (Rep a)) => a Source #

Generic minBound.

instance Bounded MyType where
  minBound = gminBound
  maxBound = gmaxBound

gmaxBound :: (Generic a, GBounded (Rep a)) => a Source #

Generic maxBound.

See also gminBound.

class GBounded f Source #

Generic representation of Bounded types.

Minimal complete definition

gMinBound, gMaxBound

Instances

Instances details
GBounded (U1 :: Type -> Type) Source # 
Instance details

Defined in Generic.Data.Internal.Enum

Bounded c => GBounded (K1 i c :: Type -> Type) Source # 
Instance details

Defined in Generic.Data.Internal.Enum

Methods

gMinBound :: K1 i c p Source #

gMaxBound :: K1 i c p Source #

(GBounded f, GBounded g) => GBounded (f :+: g) Source # 
Instance details

Defined in Generic.Data.Internal.Enum

Methods

gMinBound :: (f :+: g) p Source #

gMaxBound :: (f :+: g) p Source #

(GBounded f, GBounded g) => GBounded (f :*: g) Source # 
Instance details

Defined in Generic.Data.Internal.Enum

Methods

gMinBound :: (f :*: g) p Source #

gMaxBound :: (f :*: g) p Source #

GBounded f => GBounded (M1 i c f) Source # 
Instance details

Defined in Generic.Data.Internal.Enum

Methods

gMinBound :: M1 i c f p Source #

gMaxBound :: M1 i c f p Source #

Ix

Can also be derived by GHC as part of the standard.

grange :: (Generic a, GIx (Rep a)) => (a, a) -> [a] Source #

Generic range.

import Data.Ix
instance Ix MyType where
  range = grange
  index = gindex
  inRange = ginRange

gindex :: (Generic a, GIx (Rep a)) => (a, a) -> a -> Int Source #

Generic index.

See also grange.

ginRange :: (Generic a, GIx (Rep a)) => (a, a) -> a -> Bool Source #

Generic inRange.

See also grange.

class GIx f Source #

Generic representation of Ix types.

Minimal complete definition

gRange, gUnsafeIndex, gInRange

Instances

Instances details
GIx (U1 :: Type -> Type) Source # 
Instance details

Defined in Generic.Data.Internal.Enum

Methods

gRange :: (U1 p, U1 p) -> [U1 p] Source #

gUnsafeIndex :: (U1 p, U1 p) -> U1 p -> Int Source #

gInRange :: (U1 p, U1 p) -> U1 p -> Bool Source #

Ix c => GIx (K1 i c :: Type -> Type) Source # 
Instance details

Defined in Generic.Data.Internal.Enum

Methods

gRange :: (K1 i c p, K1 i c p) -> [K1 i c p] Source #

gUnsafeIndex :: (K1 i c p, K1 i c p) -> K1 i c p -> Int Source #

gInRange :: (K1 i c p, K1 i c p) -> K1 i c p -> Bool Source #

(GEnum StandardEnum f, GEnum StandardEnum g) => GIx (f :+: g) Source # 
Instance details

Defined in Generic.Data.Internal.Enum

Methods

gRange :: ((f :+: g) p, (f :+: g) p) -> [(f :+: g) p] Source #

gUnsafeIndex :: ((f :+: g) p, (f :+: g) p) -> (f :+: g) p -> Int Source #

gInRange :: ((f :+: g) p, (f :+: g) p) -> (f :+: g) p -> Bool Source #

(GIx f, GIx g) => GIx (f :*: g) Source # 
Instance details

Defined in Generic.Data.Internal.Enum

Methods

gRange :: ((f :*: g) p, (f :*: g) p) -> [(f :*: g) p] Source #

gUnsafeIndex :: ((f :*: g) p, (f :*: g) p) -> (f :*: g) p -> Int Source #

gInRange :: ((f :*: g) p, (f :*: g) p) -> (f :*: g) p -> Bool Source #

GIx f => GIx (M1 i c f) Source # 
Instance details

Defined in Generic.Data.Internal.Enum

Methods

gRange :: (M1 i c f p, M1 i c f p) -> [M1 i c f p] Source #

gUnsafeIndex :: (M1 i c f p, M1 i c f p) -> M1 i c f p -> Int Source #

gInRange :: (M1 i c f p, M1 i c f p) -> M1 i c f p -> Bool Source #

gunsafeIndex :: (Generic a, GIx (Rep a)) => (a, a) -> a -> Int Source #

Generic unsafeIndex.

Details

Expand

The functions unsafeIndex and unsafeRangeSize belong to Ix but are internal to GHC and hence not exported from the module Data.Ix. However they are exported from the module GHC.Arr. See grange for how to define an instance of Ix such that it does not depend on the stability of GHCs internal API. Unfortunately this results in additional (unnecessary) bound checks. With the danger of having no stability guarantees for GHC's internal API one can alternatively define an instance of Ix as

import GHC.Arr
instance Ix MyType where
  range = grange
  unsafeIndex = gunsafeIndex
  inRange = ginRange

Higher-kinded classes

Default implementations for classes indexed by type constructors (kind Type -> Type).

Functor

Can also be derived by GHC (DeriveFunctor extension).

gfmap :: (Generic1 f, Functor (Rep1 f)) => (a -> b) -> f a -> f b Source #

Generic fmap.

instance Functor MyTypeF where
  fmap = gfmap

gconstmap :: (Generic1 f, Functor (Rep1 f)) => a -> f b -> f a Source #

Generic (<$).

See also gfmap.

Foldable

Can also be derived by GHC (DeriveFoldable extension).

gfoldMap :: (Generic1 f, GFoldable (Rep1 f), Monoid m) => (a -> m) -> f a -> m Source #

Generic foldMap.

instance Foldable MyTypeF where
  foldMap = gfoldMap

gfoldr :: (Generic1 f, Foldable (Rep1 f)) => (a -> b -> b) -> b -> f a -> b Source #

Generic foldr.

instance Foldable MyTypeF where
  foldr = gfoldr

See also gfoldMap.

class GFoldable_ t => GFoldable t Source #

Class of generic representations for which Foldable can be derived.

Instances

Instances details
GFoldable_ t => GFoldable t Source # 
Instance details

Defined in Generic.Data.Internal.Traversable

Traversable

Can also be derived by GHC (DeriveTraversable extension).

gtraverse :: (Generic1 f, GTraversable (Rep1 f), Applicative m) => (a -> m b) -> f a -> m (f b) Source #

Generic traverse.

instance Traversable MyTypeF where
  traverse = gtraverse

gsequenceA :: (Generic1 f, GTraversable (Rep1 f), Applicative m) => f (m a) -> m (f a) Source #

Generic sequenceA.

instance Traversable MyTypeF where
  sequenceA = gsequenceA

See also gtraverse.

class GTraversable_ t => GTraversable t Source #

Class of generic representations for which Traversable can be derived.

Instances

Instances details
GTraversable_ t => GTraversable t Source # 
Instance details

Defined in Generic.Data.Internal.Traversable

Applicative

gpure :: (Generic1 f, Applicative (Rep1 f)) => a -> f a Source #

Generic pure.

instance Applicative MyTypeF where
  pure = gpure
  (<*>) = gap

gap :: (Generic1 f, Applicative (Rep1 f)) => f (a -> b) -> f a -> f b Source #

Generic (<*>) (or ap).

See also gpure.

gliftA2 :: (Generic1 f, Applicative (Rep1 f)) => (a -> b -> c) -> f a -> f b -> f c Source #

Generic liftA2.

See also gpure.

Alternative

gempty :: (Generic1 f, Alternative (Rep1 f)) => f a Source #

Generic empty.

instance Alternative MyTypeF where
  empty = gempty
  (<|>) = galt

galt :: (Generic1 f, Alternative (Rep1 f)) => f a -> f a -> f a Source #

Generic (<|>).

See also gempty.

Eq1

gliftEq :: (Generic1 f, Eq1 (Rep1 f)) => (a -> b -> Bool) -> f a -> f b -> Bool Source #

Generic liftEq.

Ord1

gliftCompare :: (Generic1 f, Ord1 (Rep1 f)) => (a -> b -> Ordering) -> f a -> f b -> Ordering Source #

Generic liftCompare.

Read1

gliftReadPrec :: (Generic1 f, GRead1 (Rep1 f)) => ReadPrec a -> ReadPrec [a] -> ReadPrec (f a) Source #

Generic liftReadPrec.

type GRead1 = GRead Identity Source #

Generic representation of Read1 types.

Show1

gliftShowsPrec :: (Generic1 f, GShow1 (Rep1 f)) => (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> f a -> ShowS Source #

Generic liftShowsPrec.

type GShow1 = GShow Identity Source #

Generic representation of Show1 types.

Fields wrappers for deriving

newtype Id1 f a Source #

A newtype whose instances for simple classes (Eq, Ord, Read, Show) use higher-kinded class instances for f (Eq1, Ord1, Read1, Show1).

Constructors

Id1 

Fields

Instances

Instances details
Eq1 f => Eq1 (Id1 f) Source # 
Instance details

Defined in Generic.Data.Internal.Resolvers

Methods

liftEq :: (a -> b -> Bool) -> Id1 f a -> Id1 f b -> Bool #

Ord1 f => Ord1 (Id1 f) Source # 
Instance details

Defined in Generic.Data.Internal.Resolvers

Methods

liftCompare :: (a -> b -> Ordering) -> Id1 f a -> Id1 f b -> Ordering #

Read1 f => Read1 (Id1 f) Source # 
Instance details

Defined in Generic.Data.Internal.Resolvers

Methods

liftReadsPrec :: (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (Id1 f a) #

liftReadList :: (Int -> ReadS a) -> ReadS [a] -> ReadS [Id1 f a] #

liftReadPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec (Id1 f a) #

liftReadListPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec [Id1 f a] #

Show1 f => Show1 (Id1 f) Source # 
Instance details

Defined in Generic.Data.Internal.Resolvers

Methods

liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> Id1 f a -> ShowS #

liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [Id1 f a] -> ShowS #

(Eq1 f, Eq a) => Eq (Id1 f a) Source # 
Instance details

Defined in Generic.Data.Internal.Resolvers

Methods

(==) :: Id1 f a -> Id1 f a -> Bool #

(/=) :: Id1 f a -> Id1 f a -> Bool #

(Ord1 f, Ord a) => Ord (Id1 f a) Source # 
Instance details

Defined in Generic.Data.Internal.Resolvers

Methods

compare :: Id1 f a -> Id1 f a -> Ordering #

(<) :: Id1 f a -> Id1 f a -> Bool #

(<=) :: Id1 f a -> Id1 f a -> Bool #

(>) :: Id1 f a -> Id1 f a -> Bool #

(>=) :: Id1 f a -> Id1 f a -> Bool #

max :: Id1 f a -> Id1 f a -> Id1 f a #

min :: Id1 f a -> Id1 f a -> Id1 f a #

(Read1 f, Read a) => Read (Id1 f a) Source # 
Instance details

Defined in Generic.Data.Internal.Resolvers

Methods

readsPrec :: Int -> ReadS (Id1 f a) #

readList :: ReadS [Id1 f a] #

readPrec :: ReadPrec (Id1 f a) #

readListPrec :: ReadPrec [Id1 f a] #

(Show1 f, Show a) => Show (Id1 f a) Source # 
Instance details

Defined in Generic.Data.Internal.Resolvers

Methods

showsPrec :: Int -> Id1 f a -> ShowS #

show :: Id1 f a -> String #

showList :: [Id1 f a] -> ShowS #

newtype Opaque a Source #

A newtype with trivial instances, that considers every value equivalent to every other one, and shows as just "_".

Constructors

Opaque 

Fields

Instances

Instances details
Eq1 Opaque Source #

All equal.

Instance details

Defined in Generic.Data.Internal.Resolvers

Methods

liftEq :: (a -> b -> Bool) -> Opaque a -> Opaque b -> Bool #

Ord1 Opaque Source #

All equal.

Instance details

Defined in Generic.Data.Internal.Resolvers

Methods

liftCompare :: (a -> b -> Ordering) -> Opaque a -> Opaque b -> Ordering #

Show1 Opaque Source #

Shown as "_".

Instance details

Defined in Generic.Data.Internal.Resolvers

Methods

liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> Opaque a -> ShowS #

liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [Opaque a] -> ShowS #

Eq (Opaque a) Source #

All equal.

Instance details

Defined in Generic.Data.Internal.Resolvers

Methods

(==) :: Opaque a -> Opaque a -> Bool #

(/=) :: Opaque a -> Opaque a -> Bool #

Ord (Opaque a) Source #

All equal.

Instance details

Defined in Generic.Data.Internal.Resolvers

Methods

compare :: Opaque a -> Opaque a -> Ordering #

(<) :: Opaque a -> Opaque a -> Bool #

(<=) :: Opaque a -> Opaque a -> Bool #

(>) :: Opaque a -> Opaque a -> Bool #

(>=) :: Opaque a -> Opaque a -> Bool #

max :: Opaque a -> Opaque a -> Opaque a #

min :: Opaque a -> Opaque a -> Opaque a #

Show (Opaque a) Source #

Shown as "_".

Instance details

Defined in Generic.Data.Internal.Resolvers

Methods

showsPrec :: Int -> Opaque a -> ShowS #

show :: Opaque a -> String #

showList :: [Opaque a] -> ShowS #

newtype Opaque1 f a Source #

A higher-kinded version of Opaque.

Constructors

Opaque1 

Fields

Instances

Instances details
Eq1 (Opaque1 f) Source #

All equal.

Instance details

Defined in Generic.Data.Internal.Resolvers

Methods

liftEq :: (a -> b -> Bool) -> Opaque1 f a -> Opaque1 f b -> Bool #

Ord1 (Opaque1 f) Source #

All equal.

Instance details

Defined in Generic.Data.Internal.Resolvers

Methods

liftCompare :: (a -> b -> Ordering) -> Opaque1 f a -> Opaque1 f b -> Ordering #

Show1 (Opaque1 f) Source #

Shown as "_".

Instance details

Defined in Generic.Data.Internal.Resolvers

Methods

liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> Opaque1 f a -> ShowS #

liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [Opaque1 f a] -> ShowS #

Eq (Opaque1 f a) Source #

All equal.

Instance details

Defined in Generic.Data.Internal.Resolvers

Methods

(==) :: Opaque1 f a -> Opaque1 f a -> Bool #

(/=) :: Opaque1 f a -> Opaque1 f a -> Bool #

Ord (Opaque1 f a) Source #

All equal.

Instance details

Defined in Generic.Data.Internal.Resolvers

Methods

compare :: Opaque1 f a -> Opaque1 f a -> Ordering #

(<) :: Opaque1 f a -> Opaque1 f a -> Bool #

(<=) :: Opaque1 f a -> Opaque1 f a -> Bool #

(>) :: Opaque1 f a -> Opaque1 f a -> Bool #

(>=) :: Opaque1 f a -> Opaque1 f a -> Bool #

max :: Opaque1 f a -> Opaque1 f a -> Opaque1 f a #

min :: Opaque1 f a -> Opaque1 f a -> Opaque1 f a #

Show (Opaque1 f a) Source #

Shown as "_".

Instance details

Defined in Generic.Data.Internal.Resolvers

Methods

showsPrec :: Int -> Opaque1 f a -> ShowS #

show :: Opaque1 f a -> String #

showList :: [Opaque1 f a] -> ShowS #

Newtype

Generic pack/unpack.

class (Generic a, Coercible a (Old a), Newtype' a) => Newtype a Source #

Class of newtypes. There is an instance Newtype a if and only if a is a newtype and an instance of Generic.

Instances

Instances details
(Generic a, Coercible a (Old a), Newtype' a) => Newtype a Source # 
Instance details

Defined in Generic.Data.Internal.Newtype

type Old a = GOld (Rep a) Source #

The type wrapped by a newtype.

newtype Foo = Foo { bar :: Bar } deriving Generic
-- Old Foo ~ Bar

pack :: Newtype a => Old a -> a Source #

Generic newtype constructor.

unpack :: Newtype a => a -> Old a Source #

Generic newtype destructor.

Generic coercions

gcoerce :: (Generic a, Generic b, Coercible (Rep a) (Rep b)) => a -> b Source #

Convert between types with representationally equivalent generic representations.

gcoerceBinop :: (Generic a, Generic b, Coercible (Rep a) (Rep b)) => (a -> a -> a) -> b -> b -> b Source #

Compose gcoerce with a binary operation.

Accessing metadata

Using TypeApplications.

Datatype

gdatatypeName :: forall a. (Generic a, GDatatype (Rep a)) => String Source #

Name of the first data constructor in a type as a string.

>>> gdatatypeName @(Maybe Int)
"Maybe"

gmoduleName :: forall a. (Generic a, GDatatype (Rep a)) => String Source #

Name of the module where the first type constructor is defined.

>>> gmoduleName @(ZipList Int)
"Control.Applicative"

gpackageName :: forall a. (Generic a, GDatatype (Rep a)) => String Source #

Name of the package where the first type constructor is defined.

>>> gpackageName @(Maybe Int)
"base"

gisNewtype :: forall a. (Generic a, GDatatype (Rep a)) => Bool Source #

True if the first type constructor is a newtype.

>>> gisNewtype @[Int]
False
>>> gisNewtype @(ZipList Int)
True

class GDatatype f Source #

Generic representations that contain datatype metadata.

Minimal complete definition

gDatatypeName, gModuleName, gPackageName, gIsNewtype

Instances

Instances details
Datatype d => GDatatype (M1 D d f :: k -> Type) Source # 
Instance details

Defined in Generic.Data.Internal.Meta

Constructor

gconName :: forall a. Constructors a => a -> String Source #

Name of the first constructor in a value.

>>> gconName (Just 0)
"Just"

gconFixity :: forall a. Constructors a => a -> Fixity Source #

The fixity of the first constructor.

>>> gconFixity (Just 0)
Prefix
>>> gconFixity ([] :*: id)
Infix RightAssociative 6

gconIsRecord :: forall a. Constructors a => a -> Bool Source #

True if the constructor is a record.

>>> gconIsRecord (Just 0)
False
>>> gconIsRecord (Sum 0)   -- Note:  newtype Sum a = Sum { getSum :: a }
True

gconNum :: forall a. Constructors a => Int Source #

Number of constructors.

>>> gconNum @(Maybe Int)
2

gconIndex :: forall a. Constructors a => a -> Int Source #

Index of a constructor.

>>> gconIndex Nothing
0
>>> gconIndex (Just "test")
1

class (Generic a, GConstructors (Rep a)) => Constructors a Source #

Constraint synonym for Generic and GConstructors.

Instances

Instances details
(Generic a, GConstructors (Rep a)) => Constructors a Source # 
Instance details

Defined in Generic.Data.Internal.Meta

class GConstructors r Source #

Generic representations that contain constructor metadata.

Minimal complete definition

gConIdToString, gConId, gConNum, gConFixity, gConIsRecord

Instances

Instances details
GConstructors (V1 :: k -> Type) Source # 
Instance details

Defined in Generic.Data.Internal.Meta

Methods

gConIdToString :: GConId V1 -> String Source #

gConId :: forall (p :: k0). V1 p -> GConId V1 Source #

gConNum :: Int Source #

gConFixity :: forall (p :: k0). V1 p -> Fixity Source #

gConIsRecord :: forall (p :: k0). V1 p -> Bool Source #

(GConstructors f, GConstructors g) => GConstructors (f :+: g :: k -> Type) Source # 
Instance details

Defined in Generic.Data.Internal.Meta

Methods

gConIdToString :: GConId (f :+: g) -> String Source #

gConId :: forall (p :: k0). (f :+: g) p -> GConId (f :+: g) Source #

gConNum :: Int Source #

gConFixity :: forall (p :: k0). (f :+: g) p -> Fixity Source #

gConIsRecord :: forall (p :: k0). (f :+: g) p -> Bool Source #

Constructor c => GConstructors (M1 C c f :: k -> Type) Source # 
Instance details

Defined in Generic.Data.Internal.Meta

Methods

gConIdToString :: GConId (M1 C c f) -> String Source #

gConId :: forall (p :: k0). M1 C c f p -> GConId (M1 C c f) Source #

gConNum :: Int Source #

gConFixity :: forall (p :: k0). M1 C c f p -> Fixity Source #

gConIsRecord :: forall (p :: k0). M1 C c f p -> Bool Source #

GConstructors f => GConstructors (M1 D c f :: k -> Type) Source # 
Instance details

Defined in Generic.Data.Internal.Meta

Methods

gConIdToString :: GConId (M1 D c f) -> String Source #

gConId :: forall (p :: k0). M1 D c f p -> GConId (M1 D c f) Source #

gConNum :: Int Source #

gConFixity :: forall (p :: k0). M1 D c f p -> Fixity Source #

gConIsRecord :: forall (p :: k0). M1 D c f p -> Bool Source #

Constructor tags

data ConId a Source #

An opaque identifier for a constructor.

Instances

Instances details
Eq (ConId a) Source # 
Instance details

Defined in Generic.Data.Internal.Meta

Methods

(==) :: ConId a -> ConId a -> Bool #

(/=) :: ConId a -> ConId a -> Bool #

Ord (ConId a) Source # 
Instance details

Defined in Generic.Data.Internal.Meta

Methods

compare :: ConId a -> ConId a -> Ordering #

(<) :: ConId a -> ConId a -> Bool #

(<=) :: ConId a -> ConId a -> Bool #

(>) :: ConId a -> ConId a -> Bool #

(>=) :: ConId a -> ConId a -> Bool #

max :: ConId a -> ConId a -> ConId a #

min :: ConId a -> ConId a -> ConId a #

Show (ConId a) Source # 
Instance details

Defined in Generic.Data.Internal.Meta

Methods

showsPrec :: Int -> ConId a -> ShowS #

show :: ConId a -> String #

showList :: [ConId a] -> ShowS #

conId :: forall a. Constructors a => a -> ConId a Source #

Identifier of a constructor.

conIdToInt :: forall a. ConId a -> Int Source #

Index of a constructor, given its identifier. See also gconIndex.

conIdToString :: forall a. Constructors a => ConId a -> String Source #

Name of a constructor. See also gconName.

conIdEnum :: forall a. Constructors a => [ConId a] Source #

All constructor identifiers.

gconNum @a = length (conIdEnum @a)

conIdNamed :: forall s a. ConIdNamed s a => ConId a Source #

Get a ConId by name.

>>> conIdNamed @"Nothing" :: ConId (Maybe Int)
ConId 0
>>> conIdNamed @"Just"    :: ConId (Maybe Int)
ConId 1

class (Generic a, KnownNat (ConIdNamed' n a)) => ConIdNamed n a Source #

Constraint synonym for generic types a with a constructor named n.

Instances

Instances details
(Generic a, KnownNat (ConIdNamed' n a)) => ConIdNamed n a Source # 
Instance details

Defined in Generic.Data.Internal.Meta

conIdMin :: forall a. (Constructors a, NonEmptyType "conIdMin" a) => ConId a Source #

The first constructor. This must not be called on an empty type.

conIdMax :: forall a. (Constructors a, NonEmptyType "conIdMax" a) => ConId a Source #

The last constructor. This must not be called on an empty type.

class NonEmptyType_ fname a => NonEmptyType fname a Source #

Constraint that a generic type a is not empty. Producing an error message otherwise.

The Symbol parameter fname is used only for error messages.

It is implied by the simpler constraint IsEmptyType a ~ 'False

Instances

Instances details
NonEmptyType_ fname a => NonEmptyType fname a Source # 
Instance details

Defined in Generic.Data.Internal.Meta

type IsEmptyType a = IsEmptyType_ a Source #

True if the generic type a is empty.

Using type families

type family MetaOf (f :: * -> *) :: Meta where ... Source #

Meta field of the M1 type constructor.

Equations

MetaOf (M1 i d f) = d 

type family MetaDataName (m :: Meta) :: Symbol where ... Source #

Name of the data type (MetaData).

Equations

MetaDataName ('MetaData n _m _p _nt) = n 

type family MetaDataModule (m :: Meta) :: Symbol where ... Source #

Name of the module where the data type is defined (MetaData)

Equations

MetaDataModule ('MetaData _n m _p _nt) = m 

type family MetaDataPackage (m :: Meta) :: Symbol where ... Source #

Name of the package where the data type is defined (MetaData)

Equations

MetaDataPackage ('MetaData _n _m p _nt) = p 

type family MetaDataNewtype (m :: Meta) :: Bool where ... Source #

True if the data type is a newtype (MetaData).

Equations

MetaDataNewtype ('MetaData _n _m _p nt) = nt 

type family MetaConsName (m :: Meta) :: Symbol where ... Source #

Name of the constructor (MetaCons).

Equations

MetaConsName ('MetaCons n _f _s) = n 

type family MetaConsFixity (m :: Meta) :: FixityI where ... Source #

Fixity of the constructor (MetaCons).

Equations

MetaConsFixity ('MetaCons _n f s) = f 

type family MetaConsRecord (m :: Meta) :: Bool where ... Source #

True for a record constructor (MetaCons).

Equations

MetaConsRecord ('MetaCons _n _f s) = s 

type family MetaSelNameM (m :: Meta) :: Maybe Symbol where ... Source #

Just the name of the record field, if it is one (MetaSel).

Equations

MetaSelNameM ('MetaSel mn _su _ss _ds) = mn 

type family MetaSelName (m :: Meta) :: Symbol where ... Source #

Name of the record field; undefined for non-record fields (MetaSel).

Equations

MetaSelName ('MetaSel ('Just n) _su _ss _ds) = n 

type family MetaSelUnpack (m :: Meta) :: SourceUnpackedness where ... Source #

Unpackedness annotation of a field (MetaSel).

Equations

MetaSelUnpack ('MetaSel _mn su _ss _ds) = su 

type family MetaSelSourceStrictness (m :: Meta) :: SourceStrictness where ... Source #

Strictness annotation of a field (MetaSel).

Equations

MetaSelSourceStrictness ('MetaSel _mn _su ss _ds) = ss 

type family MetaSelStrictness (m :: Meta) :: DecidedStrictness where ... Source #

Inferred strictness of a field (MetaSel).

Equations

MetaSelStrictness ('MetaSel _mn _su _ss ds) = ds 

The Generic class

Reexported from GHC.Generics.

class Generic a #

Representable types of kind *. This class is derivable in GHC with the DeriveGeneric flag on.

A Generic instance must satisfy the following laws:

from . toid
to . fromid

Minimal complete definition

from, to

Instances

Instances details
Generic Bool

Since: base-4.6.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep Bool :: Type -> Type #

Methods

from :: Bool -> Rep Bool x #

to :: Rep Bool x -> Bool #

Generic Ordering

Since: base-4.6.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep Ordering :: Type -> Type #

Methods

from :: Ordering -> Rep Ordering x #

to :: Rep Ordering x -> Ordering #

Generic ()

Since: base-4.6.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep () :: Type -> Type #

Methods

from :: () -> Rep () x #

to :: Rep () x -> () #

Generic Version

Since: base-4.9.0.0

Instance details

Defined in Data.Version

Associated Types

type Rep Version :: Type -> Type #

Methods

from :: Version -> Rep Version x #

to :: Rep Version x -> Version #

Generic ExitCode 
Instance details

Defined in GHC.IO.Exception

Associated Types

type Rep ExitCode :: Type -> Type #

Methods

from :: ExitCode -> Rep ExitCode x #

to :: Rep ExitCode x -> ExitCode #

Generic All

Since: base-4.7.0.0

Instance details

Defined in Data.Semigroup.Internal

Associated Types

type Rep All :: Type -> Type #

Methods

from :: All -> Rep All x #

to :: Rep All x -> All #

Generic Any

Since: base-4.7.0.0

Instance details

Defined in Data.Semigroup.Internal

Associated Types

type Rep Any :: Type -> Type #

Methods

from :: Any -> Rep Any x #

to :: Rep Any x -> Any #

Generic Fixity

Since: base-4.7.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep Fixity :: Type -> Type #

Methods

from :: Fixity -> Rep Fixity x #

to :: Rep Fixity x -> Fixity #

Generic Associativity

Since: base-4.7.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep Associativity :: Type -> Type #

Generic SourceUnpackedness

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep SourceUnpackedness :: Type -> Type #

Generic SourceStrictness

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep SourceStrictness :: Type -> Type #

Generic DecidedStrictness

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep DecidedStrictness :: Type -> Type #

Generic [a]

Since: base-4.6.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep [a] :: Type -> Type #

Methods

from :: [a] -> Rep [a] x #

to :: Rep [a] x -> [a] #

Generic (Maybe a)

Since: base-4.6.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep (Maybe a) :: Type -> Type #

Methods

from :: Maybe a -> Rep (Maybe a) x #

to :: Rep (Maybe a) x -> Maybe a #

Generic (Par1 p)

Since: base-4.7.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep (Par1 p) :: Type -> Type #

Methods

from :: Par1 p -> Rep (Par1 p) x #

to :: Rep (Par1 p) x -> Par1 p #

Generic (Min a)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Associated Types

type Rep (Min a) :: Type -> Type #

Methods

from :: Min a -> Rep (Min a) x #

to :: Rep (Min a) x -> Min a #

Generic (Max a)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Associated Types

type Rep (Max a) :: Type -> Type #

Methods

from :: Max a -> Rep (Max a) x #

to :: Rep (Max a) x -> Max a #

Generic (First a)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Associated Types

type Rep (First a) :: Type -> Type #

Methods

from :: First a -> Rep (First a) x #

to :: Rep (First a) x -> First a #

Generic (Last a)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Associated Types

type Rep (Last a) :: Type -> Type #

Methods

from :: Last a -> Rep (Last a) x #

to :: Rep (Last a) x -> Last a #

Generic (WrappedMonoid m)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Associated Types

type Rep (WrappedMonoid m) :: Type -> Type #

Generic (Option a)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Associated Types

type Rep (Option a) :: Type -> Type #

Methods

from :: Option a -> Rep (Option a) x #

to :: Rep (Option a) x -> Option a #

Generic (ZipList a)

Since: base-4.7.0.0

Instance details

Defined in Control.Applicative

Associated Types

type Rep (ZipList a) :: Type -> Type #

Methods

from :: ZipList a -> Rep (ZipList a) x #

to :: Rep (ZipList a) x -> ZipList a #

Generic (Identity a)

Since: base-4.8.0.0

Instance details

Defined in Data.Functor.Identity

Associated Types

type Rep (Identity a) :: Type -> Type #

Methods

from :: Identity a -> Rep (Identity a) x #

to :: Rep (Identity a) x -> Identity a #

Generic (First a)

Since: base-4.7.0.0

Instance details

Defined in Data.Monoid

Associated Types

type Rep (First a) :: Type -> Type #

Methods

from :: First a -> Rep (First a) x #

to :: Rep (First a) x -> First a #

Generic (Last a)

Since: base-4.7.0.0

Instance details

Defined in Data.Monoid

Associated Types

type Rep (Last a) :: Type -> Type #

Methods

from :: Last a -> Rep (Last a) x #

to :: Rep (Last a) x -> Last a #

Generic (Dual a)

Since: base-4.7.0.0

Instance details

Defined in Data.Semigroup.Internal

Associated Types

type Rep (Dual a) :: Type -> Type #

Methods

from :: Dual a -> Rep (Dual a) x #

to :: Rep (Dual a) x -> Dual a #

Generic (Endo a)

Since: base-4.7.0.0

Instance details

Defined in Data.Semigroup.Internal

Associated Types

type Rep (Endo a) :: Type -> Type #

Methods

from :: Endo a -> Rep (Endo a) x #

to :: Rep (Endo a) x -> Endo a #

Generic (Sum a)

Since: base-4.7.0.0

Instance details

Defined in Data.Semigroup.Internal

Associated Types

type Rep (Sum a) :: Type -> Type #

Methods

from :: Sum a -> Rep (Sum a) x #

to :: Rep (Sum a) x -> Sum a #

Generic (Product a)

Since: base-4.7.0.0

Instance details

Defined in Data.Semigroup.Internal

Associated Types

type Rep (Product a) :: Type -> Type #

Methods

from :: Product a -> Rep (Product a) x #

to :: Rep (Product a) x -> Product a #

Generic (Down a)

Since: base-4.12.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep (Down a) :: Type -> Type #

Methods

from :: Down a -> Rep (Down a) x #

to :: Rep (Down a) x -> Down a #

Generic (NonEmpty a)

Since: base-4.6.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep (NonEmpty a) :: Type -> Type #

Methods

from :: NonEmpty a -> Rep (NonEmpty a) x #

to :: Rep (NonEmpty a) x -> NonEmpty a #

Generic a => Generic (GenericProduct a) Source # 
Instance details

Defined in Generic.Data.Internal.Generically

Associated Types

type Rep (GenericProduct a) :: Type -> Type #

Generic a => Generic (FiniteEnumeration a) Source # 
Instance details

Defined in Generic.Data.Internal.Generically

Associated Types

type Rep (FiniteEnumeration a) :: Type -> Type #

Generic a => Generic (Generically a) Source # 
Instance details

Defined in Generic.Data.Internal.Generically

Associated Types

type Rep (Generically a) :: Type -> Type #

Methods

from :: Generically a -> Rep (Generically a) x #

to :: Rep (Generically a) x -> Generically a #

Generic (Either a b)

Since: base-4.6.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep (Either a b) :: Type -> Type #

Methods

from :: Either a b -> Rep (Either a b) x #

to :: Rep (Either a b) x -> Either a b #

Generic (V1 p)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep (V1 p) :: Type -> Type #

Methods

from :: V1 p -> Rep (V1 p) x #

to :: Rep (V1 p) x -> V1 p #

Generic (U1 p)

Since: base-4.7.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep (U1 p) :: Type -> Type #

Methods

from :: U1 p -> Rep (U1 p) x #

to :: Rep (U1 p) x -> U1 p #

Generic (a, b)

Since: base-4.6.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep (a, b) :: Type -> Type #

Methods

from :: (a, b) -> Rep (a, b) x #

to :: Rep (a, b) x -> (a, b) #

Generic (Arg a b)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Associated Types

type Rep (Arg a b) :: Type -> Type #

Methods

from :: Arg a b -> Rep (Arg a b) x #

to :: Rep (Arg a b) x -> Arg a b #

Generic (WrappedMonad m a)

Since: base-4.7.0.0

Instance details

Defined in Control.Applicative

Associated Types

type Rep (WrappedMonad m a) :: Type -> Type #

Methods

from :: WrappedMonad m a -> Rep (WrappedMonad m a) x #

to :: Rep (WrappedMonad m a) x -> WrappedMonad m a #

Generic (Proxy t)

Since: base-4.6.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep (Proxy t) :: Type -> Type #

Methods

from :: Proxy t -> Rep (Proxy t) x #

to :: Rep (Proxy t) x -> Proxy t #

(Functor r, Contravariant r) => Generic (Data r p) Source # 
Instance details

Defined in Generic.Data.Internal.Data

Associated Types

type Rep (Data r p) :: Type -> Type #

Methods

from :: Data r p -> Rep (Data r p) x #

to :: Rep (Data r p) x -> Data r p #

Generic (f a) => Generic (Generically1 f a) Source # 
Instance details

Defined in Generic.Data.Internal.Generically

Associated Types

type Rep (Generically1 f a) :: Type -> Type #

Methods

from :: Generically1 f a -> Rep (Generically1 f a) x #

to :: Rep (Generically1 f a) x -> Generically1 f a #

(Generic a, Coercible (GSurgery s (Rep a)) (Rep a)) => Generic (Surgery' s a) Source # 
Instance details

Defined in Generic.Data.Internal.Microsurgery

Associated Types

type Rep (Surgery' s a) :: Type -> Type #

Methods

from :: Surgery' s a -> Rep (Surgery' s a) x #

to :: Rep (Surgery' s a) x -> Surgery' s a #

Generic (Rec1 f p)

Since: base-4.7.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep (Rec1 f p) :: Type -> Type #

Methods

from :: Rec1 f p -> Rep (Rec1 f p) x #

to :: Rep (Rec1 f p) x -> Rec1 f p #

Generic (URec (Ptr ()) p)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep (URec (Ptr ()) p) :: Type -> Type #

Methods

from :: URec (Ptr ()) p -> Rep (URec (Ptr ()) p) x #

to :: Rep (URec (Ptr ()) p) x -> URec (Ptr ()) p #

Generic (URec Char p)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep (URec Char p) :: Type -> Type #

Methods

from :: URec Char p -> Rep (URec Char p) x #

to :: Rep (URec Char p) x -> URec Char p #

Generic (URec Double p)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep (URec Double p) :: Type -> Type #

Methods

from :: URec Double p -> Rep (URec Double p) x #

to :: Rep (URec Double p) x -> URec Double p #

Generic (URec Float p) 
Instance details

Defined in GHC.Generics

Associated Types

type Rep (URec Float p) :: Type -> Type #

Methods

from :: URec Float p -> Rep (URec Float p) x #

to :: Rep (URec Float p) x -> URec Float p #

Generic (URec Int p)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep (URec Int p) :: Type -> Type #

Methods

from :: URec Int p -> Rep (URec Int p) x #

to :: Rep (URec Int p) x -> URec Int p #

Generic (URec Word p)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep (URec Word p) :: Type -> Type #

Methods

from :: URec Word p -> Rep (URec Word p) x #

to :: Rep (URec Word p) x -> URec Word p #

Generic (a, b, c)

Since: base-4.6.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep (a, b, c) :: Type -> Type #

Methods

from :: (a, b, c) -> Rep (a, b, c) x #

to :: Rep (a, b, c) x -> (a, b, c) #

Generic (WrappedArrow a b c)

Since: base-4.7.0.0

Instance details

Defined in Control.Applicative

Associated Types

type Rep (WrappedArrow a b c) :: Type -> Type #

Methods

from :: WrappedArrow a b c -> Rep (WrappedArrow a b c) x #

to :: Rep (WrappedArrow a b c) x -> WrappedArrow a b c #

Generic (Kleisli m a b)

Since: base-4.14.0.0

Instance details

Defined in Control.Arrow

Associated Types

type Rep (Kleisli m a b) :: Type -> Type #

Methods

from :: Kleisli m a b -> Rep (Kleisli m a b) x #

to :: Rep (Kleisli m a b) x -> Kleisli m a b #

Generic (Const a b)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Const

Associated Types

type Rep (Const a b) :: Type -> Type #

Methods

from :: Const a b -> Rep (Const a b) x #

to :: Rep (Const a b) x -> Const a b #

Generic (Ap f a)

Since: base-4.12.0.0

Instance details

Defined in Data.Monoid

Associated Types

type Rep (Ap f a) :: Type -> Type #

Methods

from :: Ap f a -> Rep (Ap f a) x #

to :: Rep (Ap f a) x -> Ap f a #

Generic (Alt f a)

Since: base-4.8.0.0

Instance details

Defined in Data.Semigroup.Internal

Associated Types

type Rep (Alt f a) :: Type -> Type #

Methods

from :: Alt f a -> Rep (Alt f a) x #

to :: Rep (Alt f a) x -> Alt f a #

Generic (K1 i c p)

Since: base-4.7.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep (K1 i c p) :: Type -> Type #

Methods

from :: K1 i c p -> Rep (K1 i c p) x #

to :: Rep (K1 i c p) x -> K1 i c p #

Generic ((f :+: g) p)

Since: base-4.7.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep ((f :+: g) p) :: Type -> Type #

Methods

from :: (f :+: g) p -> Rep ((f :+: g) p) x #

to :: Rep ((f :+: g) p) x -> (f :+: g) p #

Generic ((f :*: g) p)

Since: base-4.7.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep ((f :*: g) p) :: Type -> Type #

Methods

from :: (f :*: g) p -> Rep ((f :*: g) p) x #

to :: Rep ((f :*: g) p) x -> (f :*: g) p #

Generic (a, b, c, d)

Since: base-4.6.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep (a, b, c, d) :: Type -> Type #

Methods

from :: (a, b, c, d) -> Rep (a, b, c, d) x #

to :: Rep (a, b, c, d) x -> (a, b, c, d) #

Generic (Product f g a)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Product

Associated Types

type Rep (Product f g a) :: Type -> Type #

Methods

from :: Product f g a -> Rep (Product f g a) x #

to :: Rep (Product f g a) x -> Product f g a #

Generic (Sum f g a)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Sum

Associated Types

type Rep (Sum f g a) :: Type -> Type #

Methods

from :: Sum f g a -> Rep (Sum f g a) x #

to :: Rep (Sum f g a) x -> Sum f g a #

Generic (M1 i c f p)

Since: base-4.7.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep (M1 i c f p) :: Type -> Type #

Methods

from :: M1 i c f p -> Rep (M1 i c f p) x #

to :: Rep (M1 i c f p) x -> M1 i c f p #

Generic ((f :.: g) p)

Since: base-4.7.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep ((f :.: g) p) :: Type -> Type #

Methods

from :: (f :.: g) p -> Rep ((f :.: g) p) x #

to :: Rep ((f :.: g) p) x -> (f :.: g) p #

Generic (a, b, c, d, e)

Since: base-4.6.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep (a, b, c, d, e) :: Type -> Type #

Methods

from :: (a, b, c, d, e) -> Rep (a, b, c, d, e) x #

to :: Rep (a, b, c, d, e) x -> (a, b, c, d, e) #

Generic (Compose f g a)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Compose

Associated Types

type Rep (Compose f g a) :: Type -> Type #

Methods

from :: Compose f g a -> Rep (Compose f g a) x #

to :: Rep (Compose f g a) x -> Compose f g a #

Generic (a, b, c, d, e, f)

Since: base-4.6.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep (a, b, c, d, e, f) :: Type -> Type #

Methods

from :: (a, b, c, d, e, f) -> Rep (a, b, c, d, e, f) x #

to :: Rep (a, b, c, d, e, f) x -> (a, b, c, d, e, f) #

Generic (a, b, c, d, e, f, g)

Since: base-4.6.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep (a, b, c, d, e, f, g) :: Type -> Type #

Methods

from :: (a, b, c, d, e, f, g) -> Rep (a, b, c, d, e, f, g) x #

to :: Rep (a, b, c, d, e, f, g) x -> (a, b, c, d, e, f, g) #

class Generic1 (f :: k -> Type) #

Representable types of kind * -> * (or kind k -> *, when PolyKinds is enabled). This class is derivable in GHC with the DeriveGeneric flag on.

A Generic1 instance must satisfy the following laws:

from1 . to1id
to1 . from1id

Minimal complete definition

from1, to1

Instances

Instances details
Generic1 (V1 :: k -> Type)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep1 V1 :: k -> Type #

Methods

from1 :: forall (a :: k0). V1 a -> Rep1 V1 a #

to1 :: forall (a :: k0). Rep1 V1 a -> V1 a #

Generic1 (U1 :: k -> Type)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep1 U1 :: k -> Type #

Methods

from1 :: forall (a :: k0). U1 a -> Rep1 U1 a #

to1 :: forall (a :: k0). Rep1 U1 a -> U1 a #

Generic1 (Proxy :: k -> Type)

Since: base-4.6.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep1 Proxy :: k -> Type #

Methods

from1 :: forall (a :: k0). Proxy a -> Rep1 Proxy a #

to1 :: forall (a :: k0). Rep1 Proxy a -> Proxy a #

Generic1 (Alt f :: k -> Type)

Since: base-4.8.0.0

Instance details

Defined in Data.Semigroup.Internal

Associated Types

type Rep1 (Alt f) :: k -> Type #

Methods

from1 :: forall (a :: k0). Alt f a -> Rep1 (Alt f) a #

to1 :: forall (a :: k0). Rep1 (Alt f) a -> Alt f a #

Generic1 (Ap f :: k -> Type)

Since: base-4.12.0.0

Instance details

Defined in Data.Monoid

Associated Types

type Rep1 (Ap f) :: k -> Type #

Methods

from1 :: forall (a :: k0). Ap f a -> Rep1 (Ap f) a #

to1 :: forall (a :: k0). Rep1 (Ap f) a -> Ap f a #

Generic1 (Const a :: k -> Type)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Const

Associated Types

type Rep1 (Const a) :: k -> Type #

Methods

from1 :: forall (a0 :: k0). Const a a0 -> Rep1 (Const a) a0 #

to1 :: forall (a0 :: k0). Rep1 (Const a) a0 -> Const a a0 #

Generic1 (URec (Ptr ()) :: k -> Type)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep1 (URec (Ptr ())) :: k -> Type #

Methods

from1 :: forall (a :: k0). URec (Ptr ()) a -> Rep1 (URec (Ptr ())) a #

to1 :: forall (a :: k0). Rep1 (URec (Ptr ())) a -> URec (Ptr ()) a #

Generic1 (URec Char :: k -> Type)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep1 (URec Char) :: k -> Type #

Methods

from1 :: forall (a :: k0). URec Char a -> Rep1 (URec Char) a #

to1 :: forall (a :: k0). Rep1 (URec Char) a -> URec Char a #

Generic1 (URec Double :: k -> Type)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep1 (URec Double) :: k -> Type #

Methods

from1 :: forall (a :: k0). URec Double a -> Rep1 (URec Double) a #

to1 :: forall (a :: k0). Rep1 (URec Double) a -> URec Double a #

Generic1 (URec Float :: k -> Type)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep1 (URec Float) :: k -> Type #

Methods

from1 :: forall (a :: k0). URec Float a -> Rep1 (URec Float) a #

to1 :: forall (a :: k0). Rep1 (URec Float) a -> URec Float a #

Generic1 (URec Int :: k -> Type)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep1 (URec Int) :: k -> Type #

Methods

from1 :: forall (a :: k0). URec Int a -> Rep1 (URec Int) a #

to1 :: forall (a :: k0). Rep1 (URec Int) a -> URec Int a #

Generic1 (URec Word :: k -> Type)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep1 (URec Word) :: k -> Type #

Methods

from1 :: forall (a :: k0). URec Word a -> Rep1 (URec Word) a #

to1 :: forall (a :: k0). Rep1 (URec Word) a -> URec Word a #

Generic1 (Rec1 f :: k -> Type)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep1 (Rec1 f) :: k -> Type #

Methods

from1 :: forall (a :: k0). Rec1 f a -> Rep1 (Rec1 f) a #

to1 :: forall (a :: k0). Rep1 (Rec1 f) a -> Rec1 f a #

Generic1 (K1 i c :: k -> Type)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep1 (K1 i c) :: k -> Type #

Methods

from1 :: forall (a :: k0). K1 i c a -> Rep1 (K1 i c) a #

to1 :: forall (a :: k0). Rep1 (K1 i c) a -> K1 i c a #

Generic1 (f :+: g :: k -> Type)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep1 (f :+: g) :: k -> Type #

Methods

from1 :: forall (a :: k0). (f :+: g) a -> Rep1 (f :+: g) a #

to1 :: forall (a :: k0). Rep1 (f :+: g) a -> (f :+: g) a #

Generic1 (f :*: g :: k -> Type)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep1 (f :*: g) :: k -> Type #

Methods

from1 :: forall (a :: k0). (f :*: g) a -> Rep1 (f :*: g) a #

to1 :: forall (a :: k0). Rep1 (f :*: g) a -> (f :*: g) a #

Generic1 (Sum f g :: k -> Type)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Sum

Associated Types

type Rep1 (Sum f g) :: k -> Type #

Methods

from1 :: forall (a :: k0). Sum f g a -> Rep1 (Sum f g) a #

to1 :: forall (a :: k0). Rep1 (Sum f g) a -> Sum f g a #

Generic1 (Product f g :: k -> Type)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Product

Associated Types

type Rep1 (Product f g) :: k -> Type #

Methods

from1 :: forall (a :: k0). Product f g a -> Rep1 (Product f g) a #

to1 :: forall (a :: k0). Rep1 (Product f g) a -> Product f g a #

Generic1 (M1 i c f :: k -> Type)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep1 (M1 i c f) :: k -> Type #

Methods

from1 :: forall (a :: k0). M1 i c f a -> Rep1 (M1 i c f) a #

to1 :: forall (a :: k0). Rep1 (M1 i c f) a -> M1 i c f a #

Functor f => Generic1 (f :.: g :: k -> Type)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep1 (f :.: g) :: k -> Type #

Methods

from1 :: forall (a :: k0). (f :.: g) a -> Rep1 (f :.: g) a #

to1 :: forall (a :: k0). Rep1 (f :.: g) a -> (f :.: g) a #

Functor f => Generic1 (Compose f g :: k -> Type)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Compose

Associated Types

type Rep1 (Compose f g) :: k -> Type #

Methods

from1 :: forall (a :: k0). Compose f g a -> Rep1 (Compose f g) a #

to1 :: forall (a :: k0). Rep1 (Compose f g) a -> Compose f g a #

Generic1 []

Since: base-4.6.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep1 [] :: k -> Type #

Methods

from1 :: forall (a :: k). [a] -> Rep1 [] a #

to1 :: forall (a :: k). Rep1 [] a -> [a] #

Generic1 Maybe

Since: base-4.6.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep1 Maybe :: k -> Type #

Methods

from1 :: forall (a :: k). Maybe a -> Rep1 Maybe a #

to1 :: forall (a :: k). Rep1 Maybe a -> Maybe a #

Generic1 Par1

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep1 Par1 :: k -> Type #

Methods

from1 :: forall (a :: k). Par1 a -> Rep1 Par1 a #

to1 :: forall (a :: k). Rep1 Par1 a -> Par1 a #

Generic1 Min

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Associated Types

type Rep1 Min :: k -> Type #

Methods

from1 :: forall (a :: k). Min a -> Rep1 Min a #

to1 :: forall (a :: k). Rep1 Min a -> Min a #

Generic1 Max

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Associated Types

type Rep1 Max :: k -> Type #

Methods

from1 :: forall (a :: k). Max a -> Rep1 Max a #

to1 :: forall (a :: k). Rep1 Max a -> Max a #

Generic1 First

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Associated Types

type Rep1 First :: k -> Type #

Methods

from1 :: forall (a :: k). First a -> Rep1 First a #

to1 :: forall (a :: k). Rep1 First a -> First a #

Generic1 Last

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Associated Types

type Rep1 Last :: k -> Type #

Methods

from1 :: forall (a :: k). Last a -> Rep1 Last a #

to1 :: forall (a :: k). Rep1 Last a -> Last a #

Generic1 WrappedMonoid

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Associated Types

type Rep1 WrappedMonoid :: k -> Type #

Methods

from1 :: forall (a :: k). WrappedMonoid a -> Rep1 WrappedMonoid a #

to1 :: forall (a :: k). Rep1 WrappedMonoid a -> WrappedMonoid a #

Generic1 Option

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Associated Types

type Rep1 Option :: k -> Type #

Methods

from1 :: forall (a :: k). Option a -> Rep1 Option a #

to1 :: forall (a :: k). Rep1 Option a -> Option a #

Generic1 ZipList

Since: base-4.7.0.0

Instance details

Defined in Control.Applicative

Associated Types

type Rep1 ZipList :: k -> Type #

Methods

from1 :: forall (a :: k). ZipList a -> Rep1 ZipList a #

to1 :: forall (a :: k). Rep1 ZipList a -> ZipList a #

Generic1 Identity

Since: base-4.8.0.0

Instance details

Defined in Data.Functor.Identity

Associated Types

type Rep1 Identity :: k -> Type #

Methods

from1 :: forall (a :: k). Identity a -> Rep1 Identity a #

to1 :: forall (a :: k). Rep1 Identity a -> Identity a #

Generic1 First

Since: base-4.7.0.0

Instance details

Defined in Data.Monoid

Associated Types

type Rep1 First :: k -> Type #

Methods

from1 :: forall (a :: k). First a -> Rep1 First a #

to1 :: forall (a :: k). Rep1 First a -> First a #

Generic1 Last

Since: base-4.7.0.0

Instance details

Defined in Data.Monoid

Associated Types

type Rep1 Last :: k -> Type #

Methods

from1 :: forall (a :: k). Last a -> Rep1 Last a #

to1 :: forall (a :: k). Rep1 Last a -> Last a #

Generic1 Dual

Since: base-4.7.0.0

Instance details

Defined in Data.Semigroup.Internal

Associated Types

type Rep1 Dual :: k -> Type #

Methods

from1 :: forall (a :: k). Dual a -> Rep1 Dual a #

to1 :: forall (a :: k). Rep1 Dual a -> Dual a #

Generic1 Sum

Since: base-4.7.0.0

Instance details

Defined in Data.Semigroup.Internal

Associated Types

type Rep1 Sum :: k -> Type #

Methods

from1 :: forall (a :: k). Sum a -> Rep1 Sum a #

to1 :: forall (a :: k). Rep1 Sum a -> Sum a #

Generic1 Product

Since: base-4.7.0.0

Instance details

Defined in Data.Semigroup.Internal

Associated Types

type Rep1 Product :: k -> Type #

Methods

from1 :: forall (a :: k). Product a -> Rep1 Product a #

to1 :: forall (a :: k). Rep1 Product a -> Product a #

Generic1 Down

Since: base-4.12.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep1 Down :: k -> Type #

Methods

from1 :: forall (a :: k). Down a -> Rep1 Down a #

to1 :: forall (a :: k). Rep1 Down a -> Down a #

Generic1 NonEmpty

Since: base-4.6.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep1 NonEmpty :: k -> Type #

Methods

from1 :: forall (a :: k). NonEmpty a -> Rep1 NonEmpty a #

to1 :: forall (a :: k). Rep1 NonEmpty a -> NonEmpty a #

Generic1 (Either a :: Type -> Type)

Since: base-4.6.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep1 (Either a) :: k -> Type #

Methods

from1 :: forall (a0 :: k). Either a a0 -> Rep1 (Either a) a0 #

to1 :: forall (a0 :: k). Rep1 (Either a) a0 -> Either a a0 #

Generic1 ((,) a :: Type -> Type)

Since: base-4.6.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep1 ((,) a) :: k -> Type #

Methods

from1 :: forall (a0 :: k). (a, a0) -> Rep1 ((,) a) a0 #

to1 :: forall (a0 :: k). Rep1 ((,) a) a0 -> (a, a0) #

Generic1 (Arg a :: Type -> Type)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Associated Types

type Rep1 (Arg a) :: k -> Type #

Methods

from1 :: forall (a0 :: k). Arg a a0 -> Rep1 (Arg a) a0 #

to1 :: forall (a0 :: k). Rep1 (Arg a) a0 -> Arg a a0 #

Generic1 (WrappedMonad m :: Type -> Type)

Since: base-4.7.0.0

Instance details

Defined in Control.Applicative

Associated Types

type Rep1 (WrappedMonad m) :: k -> Type #

Methods

from1 :: forall (a :: k). WrappedMonad m a -> Rep1 (WrappedMonad m) a #

to1 :: forall (a :: k). Rep1 (WrappedMonad m) a -> WrappedMonad m a #

Generic1 (Data r :: Type -> Type) Source # 
Instance details

Defined in Generic.Data.Internal.Data

Associated Types

type Rep1 (Data r) :: k -> Type #

Methods

from1 :: forall (a :: k). Data r a -> Rep1 (Data r) a #

to1 :: forall (a :: k). Rep1 (Data r) a -> Data r a #

Generic1 f => Generic1 (Generically1 f :: Type -> Type) Source # 
Instance details

Defined in Generic.Data.Internal.Generically

Associated Types

type Rep1 (Generically1 f) :: k -> Type #

Methods

from1 :: forall (a :: k). Generically1 f a -> Rep1 (Generically1 f) a #

to1 :: forall (a :: k). Rep1 (Generically1 f) a -> Generically1 f a #

Generic1 ((,,) a b :: Type -> Type)

Since: base-4.6.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep1 ((,,) a b) :: k -> Type #

Methods

from1 :: forall (a0 :: k). (a, b, a0) -> Rep1 ((,,) a b) a0 #

to1 :: forall (a0 :: k). Rep1 ((,,) a b) a0 -> (a, b, a0) #

Generic1 (WrappedArrow a b :: Type -> Type)

Since: base-4.7.0.0

Instance details

Defined in Control.Applicative

Associated Types

type Rep1 (WrappedArrow a b) :: k -> Type #

Methods

from1 :: forall (a0 :: k). WrappedArrow a b a0 -> Rep1 (WrappedArrow a b) a0 #

to1 :: forall (a0 :: k). Rep1 (WrappedArrow a b) a0 -> WrappedArrow a b a0 #

Generic1 (Kleisli m a :: Type -> Type)

Since: base-4.14.0.0

Instance details

Defined in Control.Arrow

Associated Types

type Rep1 (Kleisli m a) :: k -> Type #

Methods

from1 :: forall (a0 :: k). Kleisli m a a0 -> Rep1 (Kleisli m a) a0 #

to1 :: forall (a0 :: k). Rep1 (Kleisli m a) a0 -> Kleisli m a a0 #

Generic1 ((,,,) a b c :: Type -> Type)

Since: base-4.6.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep1 ((,,,) a b c) :: k -> Type #

Methods

from1 :: forall (a0 :: k). (a, b, c, a0) -> Rep1 ((,,,) a b c) a0 #

to1 :: forall (a0 :: k). Rep1 ((,,,) a b c) a0 -> (a, b, c, a0) #

Generic1 ((,,,,) a b c d :: Type -> Type)

Since: base-4.6.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep1 ((,,,,) a b c d) :: k -> Type #

Methods

from1 :: forall (a0 :: k). (a, b, c, d, a0) -> Rep1 ((,,,,) a b c d) a0 #

to1 :: forall (a0 :: k). Rep1 ((,,,,) a b c d) a0 -> (a, b, c, d, a0) #

Generic1 ((,,,,,) a b c d e :: Type -> Type)

Since: base-4.6.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep1 ((,,,,,) a b c d e) :: k -> Type #

Methods

from1 :: forall (a0 :: k). (a, b, c, d, e, a0) -> Rep1 ((,,,,,) a b c d e) a0 #

to1 :: forall (a0 :: k). Rep1 ((,,,,,) a b c d e) a0 -> (a, b, c, d, e, a0) #

Generic1 ((,,,,,,) a b c d e f :: Type -> Type)

Since: base-4.6.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep1 ((,,,,,,) a b c d e f) :: k -> Type #

Methods

from1 :: forall (a0 :: k). (a, b, c, d, e, f, a0) -> Rep1 ((,,,,,,) a b c d e f) a0 #

to1 :: forall (a0 :: k). Rep1 ((,,,,,,) a b c d e f) a0 -> (a, b, c, d, e, f, a0) #