| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Generic.Data
Description
Generic combinators to derive type class instances.
Orphans
The Orphans module should be imported to derive the following
classes using this library:
Eq1andOrd1SemigroupandMonoidon GHC 8.4 or older (base <= 4.11)
Minor discrepancies
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 method | GHC stock | generic-data | Comment |
( | lazy | lazy | True |
compare | lazy | lazy | EQ |
fmap | strict | strict | must be bottom anyway |
foldMap | lazy | strict | mempty if lazy |
foldr | lazy | lazy | returns accumulator |
traverse | strict | strict | |
sequenceA | strict | strict |
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 , so one must use
:.: (g :.: Rec1 h)fmap on f to convert that back to f (g (h _)). A better choice would
have been to encode it as (, because that is
coercible back to Rec1 f :.: g) :.: hf (g (h _)).
Synopsis
- newtype Generically a = Generically a
- newtype GenericProduct a = GenericProduct a
- newtype FiniteEnumeration a = FiniteEnumeration a
- newtype Generically1 (f :: k -> Type) (a :: k) where
- Generically1 :: forall {k} (f :: k -> Type) (a :: k). f a -> Generically1 f a
- gmappend :: (Generic a, Semigroup (Rep a ())) => a -> a -> a
- gmempty :: (Generic a, Monoid (Rep a ())) => a
- gmappend' :: (Generic a, Monoid (Rep a ())) => a -> a -> a
- geq :: (Generic a, Eq (Rep a ())) => a -> a -> Bool
- gcompare :: (Generic a, Ord (Rep a ())) => a -> a -> Ordering
- greadPrec :: (Generic a, GRead0 (Rep a)) => ReadPrec a
- type GRead0 = GRead (Proxy :: Type -> Type)
- gshowsPrec :: (Generic a, GShow0 (Rep a)) => Int -> a -> ShowS
- type GShow0 = GShow (Proxy :: Type -> Type)
- class GEnum opts (f :: Type -> Type)
- data StandardEnum
- gtoEnum :: (Generic a, GEnum StandardEnum (Rep a)) => Int -> a
- gfromEnum :: (Generic a, GEnum StandardEnum (Rep a)) => a -> Int
- genumFrom :: (Generic a, GEnum StandardEnum (Rep a)) => a -> [a]
- genumFromThen :: (Generic a, GEnum StandardEnum (Rep a)) => a -> a -> [a]
- genumFromTo :: (Generic a, GEnum StandardEnum (Rep a)) => a -> a -> [a]
- genumFromThenTo :: (Generic a, GEnum StandardEnum (Rep a)) => a -> a -> a -> [a]
- data FiniteEnum
- gtoFiniteEnum :: (Generic a, GEnum FiniteEnum (Rep a)) => Int -> a
- gfromFiniteEnum :: (Generic a, GEnum FiniteEnum (Rep a)) => a -> Int
- gfiniteEnumFrom :: (Generic a, GEnum FiniteEnum (Rep a)) => a -> [a]
- gfiniteEnumFromThen :: (Generic a, GEnum FiniteEnum (Rep a)) => a -> a -> [a]
- gfiniteEnumFromTo :: (Generic a, GEnum FiniteEnum (Rep a)) => a -> a -> [a]
- gfiniteEnumFromThenTo :: (Generic a, GEnum FiniteEnum (Rep a)) => a -> a -> a -> [a]
- gminBound :: (Generic a, GBounded (Rep a)) => a
- gmaxBound :: (Generic a, GBounded (Rep a)) => a
- class GBounded (f :: Type -> Type)
- grange :: (Generic a, GIx (Rep a)) => (a, a) -> [a]
- gindex :: (Generic a, GIx (Rep a)) => (a, a) -> a -> Int
- ginRange :: (Generic a, GIx (Rep a)) => (a, a) -> a -> Bool
- class GIx (f :: Type -> Type)
- gunsafeIndex :: (Generic a, GIx (Rep a)) => (a, a) -> a -> Int
- gfmap :: (Generic1 f, Functor (Rep1 f)) => (a -> b) -> f a -> f b
- gconstmap :: (Generic1 f, Functor (Rep1 f)) => a -> f b -> f a
- gfoldMap :: (Generic1 f, GFoldable (Rep1 f), Monoid m) => (a -> m) -> f a -> m
- gfoldr :: (Generic1 f, Foldable (Rep1 f)) => (a -> b -> b) -> b -> f a -> b
- class GFoldable_ t => GFoldable (t :: Type -> Type)
- gtraverse :: (Generic1 f, GTraversable (Rep1 f), Applicative m) => (a -> m b) -> f a -> m (f b)
- gsequenceA :: (Generic1 f, GTraversable (Rep1 f), Applicative m) => f (m a) -> m (f a)
- class GTraversable_ t => GTraversable (t :: Type -> Type)
- gpure :: (Generic1 f, Applicative (Rep1 f)) => a -> f a
- gap :: (Generic1 f, Applicative (Rep1 f)) => f (a -> b) -> f a -> f b
- gliftA2 :: (Generic1 f, Applicative (Rep1 f)) => (a -> b -> c) -> f a -> f b -> f c
- gempty :: (Generic1 f, Alternative (Rep1 f)) => f a
- galt :: (Generic1 f, Alternative (Rep1 f)) => f a -> f a -> f a
- gliftEq :: (Generic1 f, Eq1 (Rep1 f)) => (a -> b -> Bool) -> f a -> f b -> Bool
- gliftCompare :: (Generic1 f, Ord1 (Rep1 f)) => (a -> b -> Ordering) -> f a -> f b -> Ordering
- gliftReadPrec :: (Generic1 f, GRead1 (Rep1 f)) => ReadPrec a -> ReadPrec [a] -> ReadPrec (f a)
- type GRead1 = GRead Identity
- gliftShowsPrec :: (Generic1 f, GShow1 (Rep1 f)) => (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> f a -> ShowS
- type GShow1 = GShow Identity
- newtype Id1 (f :: Type -> Type) a = Id1 {
- unId1 :: f a
- newtype Opaque a = Opaque {
- unOpaque :: a
- newtype Opaque1 (f :: Type -> Type) a = Opaque1 {
- unOpaque1 :: f a
- class (Generic a, Coercible a (Old a), Newtype' a) => Newtype a
- type Old a = GOld (Rep a)
- pack :: Newtype a => Old a -> a
- unpack :: Newtype a => a -> Old a
- gcoerce :: (Generic a, Generic b, Coercible (Rep a) (Rep b)) => a -> b
- gcoerceBinop :: (Generic a, Generic b, Coercible (Rep a) (Rep b)) => (a -> a -> a) -> b -> b -> b
- gdatatypeName :: (Generic a, GDatatype (Rep a)) => String
- gmoduleName :: (Generic a, GDatatype (Rep a)) => String
- gpackageName :: (Generic a, GDatatype (Rep a)) => String
- gisNewtype :: (Generic a, GDatatype (Rep a)) => Bool
- class GDatatype (f :: k)
- gconName :: Constructors a => a -> String
- gconFixity :: Constructors a => a -> Fixity
- gconIsRecord :: Constructors a => a -> Bool
- gconNum :: Constructors a => Int
- gconIndex :: Constructors a => a -> Int
- class (Generic a, GConstructors (Rep a)) => Constructors a
- class GConstructors (r :: k -> Type)
- data ConId (a :: k)
- conId :: Constructors a => a -> ConId a
- conIdToInt :: forall {k} (a :: k). ConId a -> Int
- conIdToString :: Constructors a => ConId a -> String
- conIdEnum :: Constructors a => [ConId a]
- conIdNamed :: forall (s :: Symbol) a. ConIdNamed s a => ConId a
- class (Generic a, KnownNat (ConIdNamed' n a)) => ConIdNamed (n :: Symbol) a
- conIdMin :: (Constructors a, NonEmptyType "conIdMin" a) => ConId a
- conIdMax :: (Constructors a, NonEmptyType "conIdMax" a) => ConId a
- class NonEmptyType_ fname a => NonEmptyType (fname :: Symbol) a
- type IsEmptyType a = IsEmptyType_ a
- type family MetaOf (f :: Type -> Type) :: Meta where ...
- type family MetaDataName (m :: Meta) :: Symbol where ...
- type family MetaDataModule (m :: Meta) :: Symbol where ...
- type family MetaDataPackage (m :: Meta) :: Symbol where ...
- type family MetaDataNewtype (m :: Meta) :: Bool where ...
- type family MetaConsName (m :: Meta) :: Symbol where ...
- type family MetaConsFixity (m :: Meta) :: FixityI where ...
- type family MetaConsRecord (m :: Meta) :: Bool where ...
- type family MetaSelNameM (m :: Meta) :: Maybe Symbol where ...
- type family MetaSelName (m :: Meta) :: Symbol where ...
- type family MetaSelUnpack (m :: Meta) :: SourceUnpackedness where ...
- type family MetaSelSourceStrictness (m :: Meta) :: SourceStrictness where ...
- type family MetaSelStrictness (m :: Meta) :: DecidedStrictness where ...
- class Generic a
- class Generic1 (f :: k -> Type)
Newtypes for Deriving Via
newtype Generically a #
Constructors
| Generically a |
Instances
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 , where GenericProduct UU 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
>>>import Data.Monoid (Sum(..))>>>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 instead, then
Generically (Point (Sum a))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 a |
Instances
| (AssertNoSum Semigroup a, Generic a, Monoid (Rep a ())) => Monoid (GenericProduct a) Source # | |||||
Defined in Generic.Data.Internal.Generically Methods mempty :: GenericProduct a mappend :: GenericProduct a -> GenericProduct a -> GenericProduct a mconcat :: [GenericProduct a] -> GenericProduct a | |||||
| (AssertNoSum Semigroup a, Generic a, Semigroup (Rep a ())) => Semigroup (GenericProduct a) Source # | |||||
Defined in Generic.Data.Internal.Generically Methods (<>) :: GenericProduct a -> GenericProduct a -> GenericProduct a sconcat :: NonEmpty (GenericProduct a) -> GenericProduct a stimes :: Integral b => b -> GenericProduct a -> GenericProduct a | |||||
| Generic a => Generic (GenericProduct a) Source # | |||||
Defined in Generic.Data.Internal.Generically Associated Types
Methods from :: GenericProduct a -> Rep (GenericProduct a) x to :: Rep (GenericProduct a) x -> GenericProduct a | |||||
| type Rep (GenericProduct a) Source # | |||||
Defined in Generic.Data.Internal.Generically type Rep (GenericProduct a) = Rep a | |||||
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
>>>:{data Booool = Booool Bool Bool deriving Generic deriving (Enum, Bounded) via (FiniteEnumeration Booool) :}
Constructors
| FiniteEnumeration a |
Instances
| (Generic a, GBounded (Rep a)) => Bounded (FiniteEnumeration a) Source # | The same instance as | ||||
Defined in Generic.Data.Internal.Generically | |||||
| (Generic a, GEnum FiniteEnum (Rep a)) => Enum (FiniteEnumeration a) Source # | |||||
Defined in Generic.Data.Internal.Generically Methods succ :: FiniteEnumeration a -> FiniteEnumeration a pred :: FiniteEnumeration a -> FiniteEnumeration a toEnum :: Int -> FiniteEnumeration a fromEnum :: FiniteEnumeration a -> Int enumFrom :: FiniteEnumeration a -> [FiniteEnumeration a] enumFromThen :: FiniteEnumeration a -> FiniteEnumeration a -> [FiniteEnumeration a] enumFromTo :: FiniteEnumeration a -> FiniteEnumeration a -> [FiniteEnumeration a] enumFromThenTo :: FiniteEnumeration a -> FiniteEnumeration a -> FiniteEnumeration a -> [FiniteEnumeration a] | |||||
| Generic a => Generic (FiniteEnumeration a) Source # | |||||
Defined in Generic.Data.Internal.Generically Associated Types
Methods from :: FiniteEnumeration a -> Rep (FiniteEnumeration a) x to :: Rep (FiniteEnumeration a) x -> FiniteEnumeration a | |||||
| type Rep (FiniteEnumeration a) Source # | |||||
Defined in Generic.Data.Internal.Generically type Rep (FiniteEnumeration a) = Rep a | |||||
newtype Generically1 (f :: k -> Type) (a :: k) where #
Constructors
| Generically1 :: forall {k} (f :: k -> Type) (a :: k). f a -> Generically1 f a |
Instances
| Generic1 f => Generic1 (Generically1 f :: Type -> Type) Source # | This is a hack to implicitly wrap/unwrap in the instances of | ||||
Defined in Generic.Data.Internal.Generically Associated Types
Methods from1 :: Generically1 f a -> Rep1 (Generically1 f) a to1 :: Rep1 (Generically1 f) a -> Generically1 f a | |||||
| (Generic1 f, Eq1 (Rep1 f)) => Eq1 (Generically1 f) | |||||
Defined in Data.Functor.Classes Methods liftEq :: (a -> b -> Bool) -> Generically1 f a -> Generically1 f b -> Bool | |||||
| (Generic1 f, Ord1 (Rep1 f)) => Ord1 (Generically1 f) | |||||
Defined in Data.Functor.Classes Methods liftCompare :: (a -> b -> Ordering) -> Generically1 f a -> Generically1 f b -> Ordering | |||||
| (Generic1 f, GRead1 (Rep1 f)) => Read1 (Generically1 f) | |||||
Defined in Generic.Data.Internal.Generically Methods liftReadsPrec :: (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (Generically1 f a) liftReadList :: (Int -> ReadS a) -> ReadS [a] -> ReadS [Generically1 f a] liftReadPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec (Generically1 f a) liftReadListPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec [Generically1 f a] | |||||
| (Generic1 f, GShow1 (Rep1 f)) => Show1 (Generically1 f) | |||||
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) | |||||
Defined in GHC.Internal.Generics 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, Applicative (Rep1 f)) => Applicative (Generically1 f) | |||||
Defined in GHC.Internal.Generics 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, Functor (Rep1 f)) => Functor (Generically1 f) | |||||
Defined in GHC.Internal.Generics Methods fmap :: (a -> b) -> Generically1 f a -> Generically1 f b (<$) :: a -> Generically1 f b -> Generically1 f a | |||||
| (Generic1 f, GFoldable (Rep1 f)) => Foldable (Generically1 f) | |||||
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) | |||||
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) | |||||
| Generic (f a) => Generic (Generically1 f a) Source # | This is a hack to implicitly wrap/unwrap in the instances of | ||||
Defined in Generic.Data.Internal.Generically Associated Types
Methods from :: Generically1 f a -> Rep (Generically1 f a) x to :: Rep (Generically1 f a) x -> Generically1 f a | |||||
| (Generic1 f, GRead1 (Rep1 f), Read a) => Read (Generically1 f a) | |||||
Defined in Generic.Data.Internal.Generically Methods readsPrec :: Int -> ReadS (Generically1 f a) readList :: ReadS [Generically1 f a] readPrec :: ReadPrec (Generically1 f a) readListPrec :: ReadPrec [Generically1 f a] | |||||
| (Generic1 f, GShow1 (Rep1 f), Show a) => Show (Generically1 f a) Source # | |||||
Defined in Generic.Data.Internal.Generically Methods showsPrec :: Int -> Generically1 f a -> ShowS # show :: Generically1 f a -> String # showList :: [Generically1 f a] -> ShowS # | |||||
| (Generic1 f, Eq (Rep1 f a)) => Eq (Generically1 f a) | |||||
Defined in GHC.Internal.Generics Methods (==) :: Generically1 f a -> Generically1 f a -> Bool (/=) :: Generically1 f a -> Generically1 f a -> Bool | |||||
| (Generic1 f, Ord (Rep1 f a)) => Ord (Generically1 f a) | |||||
Defined in GHC.Internal.Generics Methods compare :: Generically1 f a -> Generically1 f a -> Ordering (<) :: Generically1 f a -> Generically1 f a -> Bool (<=) :: Generically1 f a -> Generically1 f a -> Bool (>) :: Generically1 f a -> Generically1 f a -> Bool (>=) :: Generically1 f a -> Generically1 f a -> Bool max :: Generically1 f a -> Generically1 f a -> Generically1 f a min :: Generically1 f a -> Generically1 f a -> Generically1 f a | |||||
| type Rep1 (Generically1 f :: Type -> Type) | |||||
Defined in Generic.Data.Internal.Generically type Rep1 (Generically1 f :: Type -> Type) = Rep1 f | |||||
| type Rep (Generically1 f a) | |||||
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
Monoid
gmempty :: (Generic a, Monoid (Rep a ())) => a Source #
Generic mempty.
instanceMonoidMyType wheremempty=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 (.==)
instanceEqMyType 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.
instanceOrdMyType wherecompare=gcompare
Read
Can also be derived by GHC as part of the standard.
greadPrec :: (Generic a, GRead0 (Rep a)) => ReadPrec a Source #
Generic readPrec.
instanceReadMyType wherereadPrec=greadPrecreadListPrec=readListPrecDefault
Show
Can also be derived by GHC as part of the standard.
gshowsPrec :: (Generic a, GShow0 (Rep a)) => Int -> a -> ShowS Source #
Generic showsPrec.
instanceShowMyType whereshowsPrec=gshowsPrec
Enum
class GEnum opts (f :: Type -> Type) Source #
Generic representation of Enum types.
The opts parameter is a type-level option to select different
implementations.
Minimal complete definition
Instances
| GEnum opts (U1 :: Type -> Type) Source # | |
Defined in Generic.Data.Internal.Enum | |
| (GEnum FiniteEnum f, GEnum FiniteEnum g) => GEnum FiniteEnum (f :*: g) Source # | |
Defined in Generic.Data.Internal.Enum | |
| (Bounded c, Enum c) => GEnum FiniteEnum (K1 i c :: Type -> Type) Source # | |
Defined in Generic.Data.Internal.Enum | |
| (GEnum opts f, GEnum opts g) => GEnum opts (f :+: g) Source # | |
Defined in Generic.Data.Internal.Enum | |
| GEnum opts f => GEnum opts (M1 i c f) Source # | |
Defined in Generic.Data.Internal.Enum | |
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).
gtoEnum :: (Generic a, GEnum StandardEnum (Rep a)) => Int -> a Source #
Generic toEnum generated with the StandardEnum option.
instanceEnumMyType wheretoEnum=gtoEnumfromEnum=gfromEnumenumFrom=genumFromenumFromThen=genumFromThenenumFromTo=genumFromToenumFromThenTo=genumFromThenTo
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. Avoid fields of types Int and Word.
Details
Two restrictions require the user's attention:
- The
Enuminstances of the field types need to start enumerating from 0. In particular,Intis an unfit field type, because the enumeration of the negative values starts before 0. - There can only be up to
values (because the implementation represents the cardinality explicitly as anmaxBound::IntInt). This restriction makesWordan invalid field type as well. Notably, it is insufficient for each individual field types to stay below this limit. Instead it applies to the generic type as a whole.
Elements are numbered by toEnum, from 0 up to (cardinality - 1).
The resulting ordering matches the generic Ord instance defined by
gcompare.
The values from different constructors are enumerated sequentially.
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 == mapgtoFiniteEnum[0 .. 5] [0 .. 5] == mapgfromFiniteEnumenumeration
Instances
| (GEnum FiniteEnum f, GEnum FiniteEnum g) => GEnum FiniteEnum (f :*: g) Source # | |
Defined in Generic.Data.Internal.Enum | |
| (Bounded c, Enum c) => GEnum FiniteEnum (K1 i c :: Type -> Type) Source # | |
Defined in Generic.Data.Internal.Enum | |
gtoFiniteEnum :: (Generic a, GEnum FiniteEnum (Rep a)) => Int -> a Source #
Generic toEnum generated with the FiniteEnum option.
instanceEnumMyType wheretoEnum=gtoFiniteEnumfromEnum=gfromFiniteEnumenumFrom=gfiniteEnumFromenumFromThen=gfiniteEnumFromThenenumFromTo=gfiniteEnumFromToenumFromThenTo=gfiniteEnumFromThenTo
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.
class GBounded (f :: Type -> Type) Source #
Generic representation of Bounded types.
Ix
Can also be derived by GHC as part of the standard.
ginRange :: (Generic a, GIx (Rep a)) => (a, a) -> a -> Bool Source #
Generic inRange.
See also grange.
class GIx (f :: Type -> Type) Source #
Generic representation of Ix types.
Minimal complete definition
Instances
| GIx (U1 :: Type -> Type) Source # | |
Defined in Generic.Data.Internal.Enum | |
| (GIx f, GIx g) => GIx (f :*: g) Source # | |
Defined in Generic.Data.Internal.Enum | |
| (GEnum StandardEnum f, GEnum StandardEnum g) => GIx (f :+: g) Source # | |
Defined in Generic.Data.Internal.Enum | |
| Ix c => GIx (K1 i c :: Type -> Type) Source # | |
Defined in Generic.Data.Internal.Enum | |
| GIx f => GIx (M1 i c f) Source # | |
Defined in Generic.Data.Internal.Enum | |
gunsafeIndex :: (Generic a, GIx (Rep a)) => (a, a) -> a -> Int Source #
Generic unsafeIndex.
Details
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 instanceIxMyType whererange=grangeunsafeIndex =gunsafeIndexinRange=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.
instanceFunctorMyTypeF wherefmap=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.
instanceFoldableMyTypeF wherefoldMap=gfoldMap
class GFoldable_ t => GFoldable (t :: Type -> Type) Source #
Class of generic representations for which Foldable can be derived.
Instances
| GFoldable_ t => GFoldable t Source # | |
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.
instanceTraversableMyTypeF wheretraverse=gtraverse
gsequenceA :: (Generic1 f, GTraversable (Rep1 f), Applicative m) => f (m a) -> m (f a) Source #
class GTraversable_ t => GTraversable (t :: Type -> Type) Source #
Class of generic representations for which Traversable can be derived.
Instances
| GTraversable_ t => GTraversable t Source # | |
Defined in Generic.Data.Internal.Traversable | |
Applicative
gliftA2 :: (Generic1 f, Applicative (Rep1 f)) => (a -> b -> c) -> f a -> f b -> f c Source #
Generic liftA2.
See also gpure.
Alternative
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.
Show1
gliftShowsPrec :: (Generic1 f, GShow1 (Rep1 f)) => (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> f a -> ShowS Source #
Generic liftShowsPrec.
Fields wrappers for deriving
newtype Id1 (f :: Type -> Type) a Source #
A newtype whose instances for simple classes (Eq, Ord, Read, Show)
use higher-kinded class instances for f (Eq1, Ord1, Read1, Show1).
Instances
| Eq1 f => Eq1 (Id1 f) Source # | |
Defined in Generic.Data.Internal.Resolvers | |
| Ord1 f => Ord1 (Id1 f) Source # | |
Defined in Generic.Data.Internal.Resolvers Methods liftCompare :: (a -> b -> Ordering) -> Id1 f a -> Id1 f b -> Ordering | |
| Read1 f => Read1 (Id1 f) Source # | |
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 # | |
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 | |
| (Read1 f, Read a) => Read (Id1 f a) Source # | |
Defined in Generic.Data.Internal.Resolvers | |
| (Show1 f, Show a) => Show (Id1 f a) Source # | |
| (Eq1 f, Eq a) => Eq (Id1 f a) Source # | |
| (Ord1 f, Ord a) => Ord (Id1 f a) Source # | |
A newtype with trivial instances, that considers
every value equivalent to every other one,
and shows as just "_".
Instances
| Eq1 Opaque Source # | All equal. |
Defined in Generic.Data.Internal.Resolvers | |
| Ord1 Opaque Source # | All equal. |
Defined in Generic.Data.Internal.Resolvers Methods liftCompare :: (a -> b -> Ordering) -> Opaque a -> Opaque b -> Ordering | |
| Show1 Opaque Source # | Shown as |
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 | |
| Show (Opaque a) Source # | Shown as |
| Eq (Opaque a) Source # | All equal. |
| Ord (Opaque a) Source # | All equal. |
Defined in Generic.Data.Internal.Resolvers | |
newtype Opaque1 (f :: Type -> Type) a Source #
A higher-kinded version of Opaque.
Instances
| Eq1 (Opaque1 f) Source # | All equal. |
Defined in Generic.Data.Internal.Resolvers | |
| Ord1 (Opaque1 f) Source # | All equal. |
Defined in Generic.Data.Internal.Resolvers Methods liftCompare :: (a -> b -> Ordering) -> Opaque1 f a -> Opaque1 f b -> Ordering | |
| Show1 (Opaque1 f) Source # | Shown as |
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 | |
| Show (Opaque1 f a) Source # | Shown as |
| Eq (Opaque1 f a) Source # | All equal. |
| Ord (Opaque1 f a) Source # | All equal. |
Defined in Generic.Data.Internal.Resolvers | |
Newtype
Generic pack/unpack.
class (Generic a, Coercible a (Old a), Newtype' a) => Newtype a Source #
type Old a = GOld (Rep a) Source #
The type wrapped by a newtype.
newtype Foo = Foo { bar :: Bar } deriving Generic
-- Old Foo ~ Bar
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 :: (Generic a, GDatatype (Rep a)) => String Source #
Name of the first data constructor in a type as a string.
>>>gdatatypeName @(Maybe Int)"Maybe"
gmoduleName :: (Generic a, GDatatype (Rep a)) => String Source #
Name of the module where the first type constructor is defined.
>>>gmoduleName @(ZipList Int)"Control.Applicative"
gpackageName :: (Generic a, GDatatype (Rep a)) => String Source #
Name of the package where the first type constructor is defined.
>>>gpackageName @(Maybe Int)"base"
gisNewtype :: (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 :: k) Source #
Generic representations that contain datatype metadata.
Minimal complete definition
Instances
| Datatype d => GDatatype (M1 D d f :: k -> Type) Source # | |
Defined in Generic.Data.Internal.Meta Methods gDatatypeName :: String Source # gModuleName :: String Source # gPackageName :: String Source # gIsNewtype :: Bool Source # | |
Constructor
gconName :: Constructors a => a -> String Source #
Name of the first constructor in a value.
>>>gconName (Just 0)"Just"
gconFixity :: Constructors a => a -> Fixity Source #
The fixity of the first constructor.
>>>import GHC.Generics ((:*:)(..))>>>gconFixity (Just 0)Prefix>>>gconFixity ([] :*: id)Infix RightAssociative 6
gconIsRecord :: 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 :: Constructors a => Int Source #
Number of constructors.
>>>gconNum @(Maybe Int)2
gconIndex :: Constructors a => a -> Int Source #
Index of a constructor.
>>>gconIndex Nothing0>>>gconIndex (Just "test")1
class (Generic a, GConstructors (Rep a)) => Constructors a Source #
Constraint synonym for Generic and GConstructors.
Instances
| (Generic a, GConstructors (Rep a)) => Constructors a Source # | |
Defined in Generic.Data.Internal.Meta | |
class GConstructors (r :: k -> Type) Source #
Generic representations that contain constructor metadata.
Minimal complete definition
Instances
| GConstructors (V1 :: k -> Type) Source # | |
Defined in Generic.Data.Internal.Meta | |
| (GConstructors f, GConstructors g) => GConstructors (f :+: g :: k -> Type) Source # | |
Defined in Generic.Data.Internal.Meta | |
| Constructor c => GConstructors (M1 C c f :: k -> Type) Source # | |
Defined in Generic.Data.Internal.Meta | |
| GConstructors f => GConstructors (M1 D c f :: k -> Type) Source # | |
Defined in Generic.Data.Internal.Meta | |
Constructor tags
An opaque identifier for a constructor.
conId :: Constructors a => a -> ConId a Source #
Identifier of a constructor.
conIdToInt :: forall {k} (a :: k). ConId a -> Int Source #
Index of a constructor, given its identifier.
See also gconIndex.
conIdToString :: Constructors a => ConId a -> String Source #
Name of a constructor. See also gconName.
conIdEnum :: Constructors a => [ConId a] Source #
conIdNamed :: forall (s :: Symbol) 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 :: Symbol) a Source #
Constraint synonym for generic types a with a constructor named n.
Instances
| (Generic a, KnownNat (ConIdNamed' n a)) => ConIdNamed n a Source # | |
Defined in Generic.Data.Internal.Meta | |
conIdMin :: (Constructors a, NonEmptyType "conIdMin" a) => ConId a Source #
The first constructor. This must not be called on an empty type.
conIdMax :: (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 :: Symbol) 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
| NonEmptyType_ fname a => NonEmptyType fname a Source # | |
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 :: Type -> Type) :: 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.
Minimal complete definition
from, to
Instances
| Generic ForeignSrcLang | |||||
Defined in GHC.ForeignSrcLang.Type Associated Types
| |||||
| Generic Extension | |||||
Defined in GHC.LanguageExtensions.Type Associated Types
| |||||
| Generic Void | |||||
Defined in GHC.Internal.Generics Associated Types
| |||||
| Generic All | |||||
Defined in GHC.Internal.Data.Semigroup.Internal Associated Types
| |||||
| Generic Any | |||||
Defined in GHC.Internal.Data.Semigroup.Internal Associated Types
| |||||
| Generic Version | |||||
Defined in GHC.Internal.Data.Version Associated Types
| |||||
| Generic Fingerprint | |||||
Defined in GHC.Internal.Generics Associated Types
| |||||
| Generic Associativity | |||||
Defined in GHC.Internal.Generics Associated Types
| |||||
| Generic DecidedStrictness | |||||
Defined in GHC.Internal.Generics Associated Types
| |||||
| Generic Fixity | |||||
Defined in GHC.Internal.Generics Associated Types
| |||||
| Generic SourceStrictness | |||||
Defined in GHC.Internal.Generics Associated Types
| |||||
| Generic SourceUnpackedness | |||||
Defined in GHC.Internal.Generics Associated Types
| |||||
| Generic ExitCode | |||||
Defined in GHC.Internal.IO.Exception Associated Types
| |||||
| Generic CCFlags | |||||
Defined in GHC.Internal.RTS.Flags Associated Types
| |||||
| Generic ConcFlags | |||||
Defined in GHC.Internal.RTS.Flags Associated Types
| |||||
| Generic DebugFlags | |||||
Defined in GHC.Internal.RTS.Flags Associated Types
| |||||
| Generic DoCostCentres | |||||
Defined in GHC.Internal.RTS.Flags Associated Types
| |||||
| Generic DoHeapProfile | |||||
Defined in GHC.Internal.RTS.Flags Associated Types
| |||||
| Generic DoTrace | |||||
Defined in GHC.Internal.RTS.Flags Associated Types
| |||||
| Generic GCFlags | |||||
Defined in GHC.Internal.RTS.Flags Associated Types
| |||||
| Generic GiveGCStats | |||||
Defined in GHC.Internal.RTS.Flags Associated Types
| |||||
| Generic HpcFlags | |||||
Defined in GHC.Internal.RTS.Flags Associated Types
| |||||
| Generic MiscFlags | |||||
Defined in GHC.Internal.RTS.Flags Associated Types
| |||||
| Generic ParFlags | |||||
Defined in GHC.Internal.RTS.Flags Associated Types
| |||||
| Generic ProfFlags | |||||
Defined in GHC.Internal.RTS.Flags Associated Types
| |||||
| Generic RTSFlags | |||||
Defined in GHC.Internal.RTS.Flags Associated Types
| |||||
| Generic TickyFlags | |||||
Defined in GHC.Internal.RTS.Flags Associated Types
| |||||
| Generic TraceFlags | |||||
Defined in GHC.Internal.RTS.Flags Associated Types
| |||||
| Generic SrcLoc | |||||
Defined in GHC.Internal.Generics Associated Types
| |||||
| Generic GCDetails | |||||
Defined in GHC.Internal.Stats Associated Types
| |||||
| Generic RTSStats | |||||
Defined in GHC.Internal.Stats Associated Types
| |||||
| Generic GeneralCategory | |||||
Defined in GHC.Internal.Generics Associated Types
| |||||
| Generic Ordering | |||||
Defined in GHC.Internal.Generics Associated Types
| |||||
| Generic () | |||||
Defined in GHC.Internal.Generics Associated Types
| |||||
| Generic Bool | |||||
Defined in GHC.Internal.Generics Associated Types
| |||||
| Generic (Complex a) | |||||
Defined in Data.Complex Associated Types
| |||||
| Generic (First a) | |||||
Defined in Data.Semigroup Associated Types
| |||||
| Generic (Last a) | |||||
Defined in Data.Semigroup Associated Types
| |||||
| Generic (Max a) | |||||
Defined in Data.Semigroup Associated Types
| |||||
| Generic (Min a) | |||||
Defined in Data.Semigroup Associated Types
| |||||
| Generic (WrappedMonoid m) | |||||
Defined in Data.Semigroup Associated Types
| |||||
| Generic a => Generic (FiniteEnumeration a) Source # | |||||
Defined in Generic.Data.Internal.Generically Associated Types
Methods from :: FiniteEnumeration a -> Rep (FiniteEnumeration a) x to :: Rep (FiniteEnumeration a) x -> FiniteEnumeration a | |||||
| Generic a => Generic (GenericProduct a) Source # | |||||
Defined in Generic.Data.Internal.Generically Associated Types
Methods from :: GenericProduct a -> Rep (GenericProduct a) x to :: Rep (GenericProduct a) x -> GenericProduct a | |||||
| Generic (NonEmpty a) | |||||
Defined in GHC.Internal.Generics Associated Types
| |||||
| Generic (Identity a) | |||||
Defined in GHC.Internal.Data.Functor.Identity Associated Types
| |||||
| Generic (First a) | |||||
Defined in GHC.Internal.Data.Monoid Associated Types
| |||||
| Generic (Last a) | |||||
Defined in GHC.Internal.Data.Monoid Associated Types
| |||||
| Generic (Down a) | |||||
Defined in GHC.Internal.Generics Associated Types
| |||||
| Generic (Dual a) | |||||
Defined in GHC.Internal.Data.Semigroup.Internal Associated Types
| |||||
| Generic (Endo a) | |||||
Defined in GHC.Internal.Data.Semigroup.Internal Associated Types
| |||||
| Generic (Product a) | |||||
Defined in GHC.Internal.Data.Semigroup.Internal Associated Types
| |||||
| Generic (Sum a) | |||||
Defined in GHC.Internal.Data.Semigroup.Internal Associated Types
| |||||
| Generic (ZipList a) | |||||
Defined in GHC.Internal.Functor.ZipList Associated Types
| |||||
| Generic a => Generic (Generically a) Source # | This is a hack to implicitly wrap/unwrap in the instances of | ||||
Defined in Generic.Data.Internal.Generically Associated Types
| |||||
| Generic (Par1 p) | |||||
Defined in GHC.Internal.Generics Associated Types
| |||||
| Generic (Maybe a) | |||||
Defined in GHC.Internal.Generics Associated Types
| |||||
| Generic (Solo a) | |||||
Defined in GHC.Internal.Generics Associated Types
| |||||
| Generic [a] | |||||
Defined in GHC.Internal.Generics Associated Types
| |||||
| Generic (WrappedMonad m a) | |||||
Defined in Control.Applicative Associated Types
| |||||
| Generic (Arg a b) | |||||
Defined in Data.Semigroup Associated Types
| |||||
| (Functor r, Contravariant r) => Generic (Data r p) Source # | |||||
Defined in Generic.Data.Internal.Data Associated Types
| |||||
| (Generic a, Coercible (GSurgery s (Rep a)) (Rep a)) => Generic (Surgery' s a) Source # | |||||
| Generic (Either a b) | |||||
Defined in GHC.Internal.Generics Associated Types
| |||||
| Generic (Proxy t) | |||||
Defined in GHC.Internal.Generics Associated Types
| |||||
| Generic (U1 p) | |||||
Defined in GHC.Internal.Generics Associated Types
| |||||
| Generic (V1 p) | |||||
Defined in GHC.Internal.Generics Associated Types
| |||||
| Generic (a, b) | |||||
Defined in GHC.Internal.Generics Associated Types
| |||||
| Generic (WrappedArrow a b c) | |||||
Defined in Control.Applicative Associated Types
| |||||
| Generic (Kleisli m a b) | |||||
Defined in GHC.Internal.Control.Arrow Associated Types
| |||||
| Generic (Const a b) | |||||
Defined in GHC.Internal.Data.Functor.Const Associated Types
| |||||
| Generic (Ap f a) | |||||
Defined in GHC.Internal.Data.Monoid Associated Types
| |||||
| Generic (Alt f a) | |||||
Defined in GHC.Internal.Data.Semigroup.Internal Associated Types
| |||||
| Generic (f a) => Generic (Generically1 f a) Source # | This is a hack to implicitly wrap/unwrap in the instances of | ||||
Defined in Generic.Data.Internal.Generically Associated Types
Methods from :: Generically1 f a -> Rep (Generically1 f a) x to :: Rep (Generically1 f a) x -> Generically1 f a | |||||
| Generic (Rec1 f p) | |||||
Defined in GHC.Internal.Generics Associated Types
| |||||
| Generic (URec (Ptr ()) p) | |||||
Defined in GHC.Internal.Generics Associated Types
| |||||
| Generic (URec Char p) | |||||
Defined in GHC.Internal.Generics Associated Types
| |||||
| Generic (URec Double p) | |||||
Defined in GHC.Internal.Generics Associated Types
| |||||
| Generic (URec Float p) | |||||
Defined in GHC.Internal.Generics Associated Types
| |||||
| Generic (URec Int p) | |||||
Defined in GHC.Internal.Generics Associated Types
| |||||
| Generic (URec Word p) | |||||
Defined in GHC.Internal.Generics Associated Types
| |||||
| Generic (a, b, c) | |||||
Defined in GHC.Internal.Generics Associated Types
| |||||
| Generic (Product f g a) | |||||
Defined in Data.Functor.Product Associated Types
| |||||
| Generic (Sum f g a) | |||||
Defined in Data.Functor.Sum Associated Types
| |||||
| Generic ((f :*: g) p) | |||||
Defined in GHC.Internal.Generics Associated Types
| |||||
| Generic ((f :+: g) p) | |||||
Defined in GHC.Internal.Generics Associated Types
| |||||
| Generic (K1 i c p) | |||||
Defined in GHC.Internal.Generics Associated Types
| |||||
| Generic (a, b, c, d) | |||||
Defined in GHC.Internal.Generics Associated Types
| |||||
| Generic (Compose f g a) | |||||
Defined in Data.Functor.Compose Associated Types
| |||||
| Generic ((f :.: g) p) | |||||
Defined in GHC.Internal.Generics Associated Types
| |||||
| Generic (M1 i c f p) | |||||
Defined in GHC.Internal.Generics Associated Types
| |||||
| Generic (a, b, c, d, e) | |||||
Defined in GHC.Internal.Generics Associated Types
| |||||
| Generic (a, b, c, d, e, f) | |||||
Defined in GHC.Internal.Generics Associated Types
| |||||
| Generic (a, b, c, d, e, f, g) | |||||
Defined in GHC.Internal.Generics Associated Types
| |||||
| Generic (a, b, c, d, e, f, g, h) | |||||
Defined in GHC.Internal.Generics Associated Types
| |||||
| Generic (a, b, c, d, e, f, g, h, i) | |||||
Defined in GHC.Internal.Generics Associated Types
| |||||
| Generic (a, b, c, d, e, f, g, h, i, j) | |||||
Defined in GHC.Internal.Generics Associated Types
| |||||
| Generic (a, b, c, d, e, f, g, h, i, j, k) | |||||
Defined in GHC.Internal.Generics Associated Types
| |||||
| Generic (a, b, c, d, e, f, g, h, i, j, k, l) | |||||
Defined in GHC.Internal.Generics Associated Types
| |||||
| Generic (a, b, c, d, e, f, g, h, i, j, k, l, m) | |||||
Defined in GHC.Internal.Generics Associated Types
| |||||
| Generic (a, b, c, d, e, f, g, h, i, j, k, l, m, n) | |||||
Defined in GHC.Internal.Generics Associated Types
| |||||
| Generic (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) | |||||
Defined in GHC.Internal.Generics Associated Types
| |||||
class Generic1 (f :: k -> Type) #
Minimal complete definition
from1, to1
Instances
| Generic1 Complex | |||||
Defined in Data.Complex Associated Types
| |||||
| Generic1 First | |||||
Defined in Data.Semigroup Associated Types
| |||||
| Generic1 Last | |||||
Defined in Data.Semigroup Associated Types
| |||||
| Generic1 Max | |||||
Defined in Data.Semigroup Associated Types
| |||||
| Generic1 Min | |||||
Defined in Data.Semigroup Associated Types
| |||||
| Generic1 WrappedMonoid | |||||
Defined in Data.Semigroup Associated Types
| |||||
| Generic1 NonEmpty | |||||
Defined in GHC.Internal.Generics Associated Types
| |||||
| Generic1 Identity | |||||
Defined in GHC.Internal.Data.Functor.Identity Associated Types
| |||||
| Generic1 First | |||||
Defined in GHC.Internal.Data.Monoid Associated Types
| |||||
| Generic1 Last | |||||
Defined in GHC.Internal.Data.Monoid Associated Types
| |||||
| Generic1 Down | |||||
Defined in GHC.Internal.Generics Associated Types
| |||||
| Generic1 Dual | |||||
Defined in GHC.Internal.Data.Semigroup.Internal Associated Types
| |||||
| Generic1 Product | |||||
Defined in GHC.Internal.Data.Semigroup.Internal Associated Types
| |||||
| Generic1 Sum | |||||
Defined in GHC.Internal.Data.Semigroup.Internal Associated Types
| |||||
| Generic1 ZipList | |||||
Defined in GHC.Internal.Functor.ZipList Associated Types
| |||||
| Generic1 Par1 | |||||
Defined in GHC.Internal.Generics Associated Types
| |||||
| Generic1 Maybe | |||||
Defined in GHC.Internal.Generics Associated Types
| |||||
| Generic1 Solo | |||||
Defined in GHC.Internal.Generics Associated Types
| |||||
| Generic1 [] | |||||
Defined in GHC.Internal.Generics Associated Types
| |||||
| Generic1 (WrappedMonad m :: Type -> Type) | |||||
Defined in Control.Applicative Associated Types
| |||||
| Generic1 (Arg a :: Type -> Type) | |||||
Defined in Data.Semigroup Associated Types
| |||||
| Generic1 (Data r :: Type -> Type) Source # | |||||
Defined in Generic.Data.Internal.Data Associated Types
| |||||
| Generic1 (Either a :: Type -> Type) | |||||
Defined in GHC.Internal.Generics Associated Types
| |||||
| Generic1 ((,) a :: Type -> Type) | |||||
Defined in GHC.Internal.Generics Associated Types
| |||||
| Generic1 (Proxy :: k -> Type) | |||||
Defined in GHC.Internal.Generics Associated Types
| |||||
| Generic1 (U1 :: k -> Type) | |||||
Defined in GHC.Internal.Generics Associated Types
| |||||
| Generic1 (V1 :: k -> Type) | |||||
Defined in GHC.Internal.Generics Associated Types
| |||||
| Generic1 (WrappedArrow a b :: Type -> Type) | |||||
Defined in Control.Applicative Associated Types
| |||||
| Generic1 (Kleisli m a :: Type -> Type) | |||||
Defined in GHC.Internal.Control.Arrow Associated Types
| |||||
| Generic1 f => Generic1 (Generically1 f :: Type -> Type) Source # | This is a hack to implicitly wrap/unwrap in the instances of | ||||
Defined in Generic.Data.Internal.Generically Associated Types
Methods from1 :: Generically1 f a -> Rep1 (Generically1 f) a to1 :: Rep1 (Generically1 f) a -> Generically1 f a | |||||
| Generic1 ((,,) a b :: Type -> Type) | |||||
Defined in GHC.Internal.Generics Associated Types
| |||||
| Generic1 (Const a :: k -> Type) | |||||
Defined in GHC.Internal.Data.Functor.Const Associated Types
| |||||
| Generic1 (Ap f :: k -> Type) | |||||
Defined in GHC.Internal.Data.Monoid Associated Types
| |||||
| Generic1 (Alt f :: k -> Type) | |||||
Defined in GHC.Internal.Data.Semigroup.Internal Associated Types
| |||||
| Generic1 (Rec1 f :: k -> Type) | |||||
Defined in GHC.Internal.Generics Associated Types
| |||||
| Generic1 (URec (Ptr ()) :: k -> Type) | |||||
Defined in GHC.Internal.Generics Associated Types
| |||||
| Generic1 (URec Char :: k -> Type) | |||||
Defined in GHC.Internal.Generics Associated Types
| |||||
| Generic1 (URec Double :: k -> Type) | |||||
Defined in GHC.Internal.Generics Associated Types
| |||||
| Generic1 (URec Float :: k -> Type) | |||||
Defined in GHC.Internal.Generics Associated Types
| |||||
| Generic1 (URec Int :: k -> Type) | |||||
Defined in GHC.Internal.Generics Associated Types
| |||||
| Generic1 (URec Word :: k -> Type) | |||||
Defined in GHC.Internal.Generics Associated Types
| |||||
| Generic1 ((,,,) a b c :: Type -> Type) | |||||
Defined in GHC.Internal.Generics Associated Types
| |||||
| Generic1 (Product f g :: k -> Type) | |||||
Defined in Data.Functor.Product Associated Types
| |||||
| Generic1 (Sum f g :: k -> Type) | |||||
Defined in Data.Functor.Sum Associated Types
| |||||
| Generic1 (f :*: g :: k -> Type) | |||||
Defined in GHC.Internal.Generics Associated Types
| |||||
| Generic1 (f :+: g :: k -> Type) | |||||
Defined in GHC.Internal.Generics Associated Types
| |||||
| Generic1 (K1 i c :: k -> Type) | |||||
Defined in GHC.Internal.Generics Associated Types
| |||||
| Generic1 ((,,,,) a b c d :: Type -> Type) | |||||
Defined in GHC.Internal.Generics Associated Types
| |||||
| Functor f => Generic1 (Compose f g :: k -> Type) | |||||
Defined in Data.Functor.Compose Associated Types
| |||||
| Functor f => Generic1 (f :.: g :: k -> Type) | |||||
Defined in GHC.Internal.Generics Associated Types
| |||||
| Generic1 (M1 i c f :: k -> Type) | |||||
Defined in GHC.Internal.Generics Associated Types
| |||||
| Generic1 ((,,,,,) a b c d e :: Type -> Type) | |||||
Defined in GHC.Internal.Generics Associated Types
| |||||
| Generic1 ((,,,,,,) a b c d e f :: Type -> Type) | |||||
Defined in GHC.Internal.Generics Associated Types
| |||||
| Generic1 ((,,,,,,,) a b c d e f g :: Type -> Type) | |||||
Defined in GHC.Internal.Generics Associated Types
| |||||
| Generic1 ((,,,,,,,,) a b c d e f g h :: Type -> Type) | |||||
Defined in GHC.Internal.Generics Associated Types
| |||||
| Generic1 ((,,,,,,,,,) a b c d e f g h i :: Type -> Type) | |||||
Defined in GHC.Internal.Generics Associated Types
| |||||
| Generic1 ((,,,,,,,,,,) a b c d e f g h i j :: Type -> Type) | |||||
Defined in GHC.Internal.Generics Associated Types
| |||||
| Generic1 ((,,,,,,,,,,,) a b c d e f g h i j k :: Type -> Type) | |||||
Defined in GHC.Internal.Generics Associated Types
| |||||
| Generic1 ((,,,,,,,,,,,,) a b c d e f g h i j k l :: Type -> Type) | |||||
Defined in GHC.Internal.Generics Associated Types
| |||||
| Generic1 ((,,,,,,,,,,,,,) a b c d e f g h i j k l m :: Type -> Type) | |||||
Defined in GHC.Internal.Generics Associated Types
| |||||
| Generic1 ((,,,,,,,,,,,,,,) a b c d e f g h i j k l m n :: Type -> Type) | |||||
Defined in GHC.Internal.Generics Associated Types
| |||||