Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Multiplicity polymorphic versions of GHC.Generics.
and
Generic
GHC.Generics.
. Generic1
Generic
is otherwise identical to the
standard version. Generic1
is similar, but with modifications that
make it more efficient, as well as supporting linearity.
This module re-exports everything in GHC.Generics except Generic
,
Generic1
, Rec1
, and :.:
. The Generic1
representations here
don't need Rec1
. We expose our own, identical, :.:
. This allows
users to instantiate their Generic1
-based generic-deriving classes so
they can be used with both GHC.Generics and this package.
In addition to the usual generic types, we export one called MP1
for
use with nonlinear and multiplicity polymorphic fields. Nonlinear
generic-deriving classes should almost always handle MP1
without
restriction. Some linear generic-deriving classes will need to constrain
its m
parameter to be 'One
.
Synopsis
- class Generic a where
- class Generic1 (f :: k -> Type) where
- newtype (f :.: g) x = Comp1 {
- unComp1 :: f (g x)
- data MP1 :: forall k. Multiplicity -> (k -> Type) -> k -> Type where
- unMP1 :: MP1 m f a %n -> f a
- class Datatype (d :: k) where
- datatypeName :: forall k1 t (f :: k1 -> Type) (a :: k1). t d f a -> [Char]
- moduleName :: forall k1 t (f :: k1 -> Type) (a :: k1). t d f a -> [Char]
- packageName :: forall k1 t (f :: k1 -> Type) (a :: k1). t d f a -> [Char]
- isNewtype :: forall k1 t (f :: k1 -> Type) (a :: k1). t d f a -> Bool
- class Constructor (c :: k) where
- class Selector (s :: k) where
- selName :: forall k1 t (f :: k1 -> Type) (a :: k1). t s f a -> [Char]
- selSourceUnpackedness :: forall k1 t (f :: k1 -> Type) (a :: k1). t s f a -> SourceUnpackedness
- selSourceStrictness :: forall k1 t (f :: k1 -> Type) (a :: k1). t s f a -> SourceStrictness
- selDecidedStrictness :: forall k1 t (f :: k1 -> Type) (a :: k1). t s f a -> DecidedStrictness
- data V1 (p :: k)
- data U1 (p :: k) = U1
- newtype Par1 p = Par1 {
- unPar1 :: p
- newtype K1 i c (p :: k) = K1 {
- unK1 :: c
- newtype M1 i (c :: Meta) (f :: k -> Type) (p :: k) = M1 {
- unM1 :: f p
- data ((f :: k -> Type) :+: (g :: k -> Type)) (p :: k)
- data ((f :: k -> Type) :*: (g :: k -> Type)) (p :: k) = (f p) :*: (g p)
- data R
- data D
- data C
- data S
- type Rec0 = K1 R :: Type -> k -> Type
- type D1 = M1 D :: Meta -> (k -> Type) -> k -> Type
- type C1 = M1 C :: Meta -> (k -> Type) -> k -> Type
- type S1 = M1 S :: Meta -> (k -> Type) -> k -> Type
- data family URec a (p :: k)
- type UAddr = URec (Ptr ()) :: k -> Type
- type UChar = URec Char :: k -> Type
- type UDouble = URec Double :: k -> Type
- type UFloat = URec Float :: k -> Type
- type UInt = URec Int :: k -> Type
- type UWord = URec Word :: k -> Type
- data SourceUnpackedness
- data SourceStrictness
- data Meta
- data FixityI
- data Fixity
- data DecidedStrictness
- data Associativity
- prec :: Fixity -> Int
Documentation
class Generic a where Source #
Generic
is exactly the same as GHC.Generics.
except that Generic
to
and from
are multiplicity polymorphic. This
means they will work equally well in traditional Haskell code
and in linearly typed code.
Instances
class Generic1 (f :: k -> Type) where Source #
Generic1
is similar to GHC.Generics.
, but has
a few differences.Generic1
Multiplicity polymorphism
As with Generic
, the to1
and from1
methods are
multiplicity polymorphic.
Differences in Rep1
representation
Rec1
is not used
Given a type like
newtype Foo a = Foo (Maybe a)
where a single type constructor (here Maybe
) is applied to the
parameter, GHC.Generics represents the field as
.
We instead represent it using Rec1
MaybePar1 :.: Maybe
. It is expected
that very few real-life uses of GHC.Generics will break as a
result, and this simplification means that users don't have to
write Rec1
instances for their generic-deriving classes.
Compositions associate in the opposite order
Given a type like
newtype Bar a = Bar (Maybe [Either e a])
where multiple type constructors are layered around the parameter, "GHC.Generics@ represents the field as
Maybe:.:
([]:.:
Rec1
(Either e))
We instead represent it as
((Par1
:.:
Maybe):.:
[]):.:
Either e
Doing it this way prevents to1
and from1
from having to fmap
newtype
constructors through the composed types, which can be a considerable
performance improvement and enables multiplicity polymorphism.
In most cases, modifying generic-deriving classes to accommodate this change is simple: just swap which side of the composition is treated as a generic representation and which as a base type. In a few cases, more restructuring will be needed, which will require using different generic-deriving classes than for GHC.Generics.
Difference in specificity
Users of type application will need to be aware that the kind parameter for
Generic1
is marked as inferred, whereas for
GHC.Generics.
it is marked as specified. So you
should use, for example, Generic1
to1 @Maybe
rather than to1 @_ @Maybe
.
Instances
newtype (f :.: g) x infixl 7 Source #
The composition operator for types. We use our own here because for many
classes, it's possible to share generic deriving classes between
GHC.Generics and Generics.Linear by just instantiating them for both
composition operators (and MP1
).
Instances
Functor f => Generic1 (f :.: g :: k -> Type) Source # | |
Generic1 (f :.: g :: k1 -> Type) Source # | |
(Foldable f, Foldable g) => Foldable (f :.: g) Source # | |
Defined in Generics.Linear.Class fold :: Monoid m => (f :.: g) m -> m # foldMap :: Monoid m => (a -> m) -> (f :.: g) a -> m # foldMap' :: Monoid m => (a -> m) -> (f :.: g) a -> m # foldr :: (a -> b -> b) -> b -> (f :.: g) a -> b # foldr' :: (a -> b -> b) -> b -> (f :.: g) a -> b # foldl :: (b -> a -> b) -> b -> (f :.: g) a -> b # foldl' :: (b -> a -> b) -> b -> (f :.: g) a -> b # foldr1 :: (a -> a -> a) -> (f :.: g) a -> a # foldl1 :: (a -> a -> a) -> (f :.: g) a -> a # toList :: (f :.: g) a -> [a] # length :: (f :.: g) a -> Int # elem :: Eq a => a -> (f :.: g) a -> Bool # maximum :: Ord a => (f :.: g) a -> a # minimum :: Ord a => (f :.: g) a -> a # | |
(Eq1 f, Eq1 g) => Eq1 (f :.: g) Source # | |
(Ord1 f, Ord1 g) => Ord1 (f :.: g) Source # | |
Defined in Generics.Linear.Class | |
(Read1 f, Read1 g) => Read1 (f :.: g) Source # | |
Defined in Generics.Linear.Class | |
(Show1 f, Show1 g) => Show1 (f :.: g) Source # | |
(Functor f, Contravariant g) => Contravariant (f :.: g) Source # | |
(Traversable f, Traversable g) => Traversable (f :.: g) Source # | |
Defined in Generics.Linear.Class | |
(Alternative f, Applicative g) => Alternative (f :.: g) Source # | |
(Applicative f, Applicative g) => Applicative (f :.: g) Source # | |
(Functor f, Functor g) => Functor (f :.: g) Source # | |
(Typeable x, Typeable f, Typeable g, Typeable k2, Typeable k1, Data (f (g x))) => Data ((f :.: g) x) Source # | |
Defined in Generics.Linear.Class gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g0. g0 -> c g0) -> (f :.: g) x -> c ((f :.: g) x) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c ((f :.: g) x) # toConstr :: (f :.: g) x -> Constr # dataTypeOf :: (f :.: g) x -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c ((f :.: g) x)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ((f :.: g) x)) # gmapT :: (forall b. Data b => b -> b) -> (f :.: g) x -> (f :.: g) x # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> (f :.: g) x -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> (f :.: g) x -> r # gmapQ :: (forall d. Data d => d -> u) -> (f :.: g) x -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> (f :.: g) x -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> (f :.: g) x -> m ((f :.: g) x) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> (f :.: g) x -> m ((f :.: g) x) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> (f :.: g) x -> m ((f :.: g) x) # | |
Monoid (f (g x)) => Monoid ((f :.: g) x) Source # | |
Semigroup (f (g x)) => Semigroup ((f :.: g) x) Source # | |
Generic ((f :.: g) x) Source # | |
Read (f (g x)) => Read ((f :.: g) x) Source # | |
Show (f (g x)) => Show ((f :.: g) x) Source # | |
Eq (f (g x)) => Eq ((f :.: g) x) Source # | |
Ord (f (g x)) => Ord ((f :.: g) x) Source # | |
Defined in Generics.Linear.Class | |
Generic ((f :.: g) x) Source # | |
type Rep1 (f :.: g :: k -> Type) Source # | |
Defined in Generics.Linear.Class | |
type Rep1 (f :.: g :: k1 -> Type) Source # | |
Defined in Generics.Linear.Instances.Linear_generics | |
type Rep ((f :.: g) x) Source # | |
Defined in Generics.Linear.Class | |
type Rep ((f :.: g) x) Source # | |
Defined in Generics.Linear.Instances.Linear_generics |
data MP1 :: forall k. Multiplicity -> (k -> Type) -> k -> Type where Source #
Types with nonlinear or multiplicity-polymorphic fields should use MP1
under S1
. Unfortunately, Template Haskell (and GHC Generics) currently
lack any support for such types, so their instances must currently be
written entirely manually. We may add some functions to ease the pain at
some point.
Generic-deriving classes that do not involve linear types should treat
MP1 m
much as they treat M1
: dig through it to get to the meat.
Unfortunately, some futzing about may be necessary to convince the
type checker that multiplicities work out.
Generic-deriving classes that use linear types may have to treat MP1 m
specially. In particular, they may need to constrain m
to be
'One
or 'Many
, or to match some other type
variable.
Instances
Generic1 (MP1 m f :: k -> Type) Source # | |
Generic1 (MP1 m f :: k -> Type) Source # | |
Foldable f => Foldable (MP1 m f) Source # | |
Defined in Generics.Linear.Class fold :: Monoid m0 => MP1 m f m0 -> m0 # foldMap :: Monoid m0 => (a -> m0) -> MP1 m f a -> m0 # foldMap' :: Monoid m0 => (a -> m0) -> MP1 m f a -> m0 # foldr :: (a -> b -> b) -> b -> MP1 m f a -> b # foldr' :: (a -> b -> b) -> b -> MP1 m f a -> b # foldl :: (b -> a -> b) -> b -> MP1 m f a -> b # foldl' :: (b -> a -> b) -> b -> MP1 m f a -> b # foldr1 :: (a -> a -> a) -> MP1 m f a -> a # foldl1 :: (a -> a -> a) -> MP1 m f a -> a # elem :: Eq a => a -> MP1 m f a -> Bool # maximum :: Ord a => MP1 m f a -> a # minimum :: Ord a => MP1 m f a -> a # | |
Eq1 f => Eq1 (MP1 m f) Source # | |
Ord1 f => Ord1 (MP1 m f) Source # | |
Defined in Generics.Linear.Class | |
Read1 f => Read1 (MP1 m f) Source # | |
Defined in Generics.Linear.Class | |
Show1 f => Show1 (MP1 m f) Source # | |
Contravariant f => Contravariant (MP1 m f) Source # | |
Traversable f => Traversable (MP1 m f) Source # | |
Alternative f => Alternative (MP1 m f) Source # | |
Applicative f => Applicative (MP1 m f) Source # | |
Functor f => Functor (MP1 m f) Source # | |
Monad f => Monad (MP1 m f) Source # | |
MonadPlus f => MonadPlus (MP1 m f) Source # | |
(Typeable m, Typeable f, Data a, Data (f a)) => Data (MP1 m f a) Source # | |
Defined in Generics.Linear.Class gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> MP1 m f a -> c (MP1 m f a) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (MP1 m f a) # toConstr :: MP1 m f a -> Constr # dataTypeOf :: MP1 m f a -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (MP1 m f a)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (MP1 m f a)) # gmapT :: (forall b. Data b => b -> b) -> MP1 m f a -> MP1 m f a # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> MP1 m f a -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> MP1 m f a -> r # gmapQ :: (forall d. Data d => d -> u) -> MP1 m f a -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> MP1 m f a -> u # gmapM :: Monad m0 => (forall d. Data d => d -> m0 d) -> MP1 m f a -> m0 (MP1 m f a) # gmapMp :: MonadPlus m0 => (forall d. Data d => d -> m0 d) -> MP1 m f a -> m0 (MP1 m f a) # gmapMo :: MonadPlus m0 => (forall d. Data d => d -> m0 d) -> MP1 m f a -> m0 (MP1 m f a) # | |
Monoid (f a) => Monoid (MP1 m f a) Source # | |
Semigroup (f a) => Semigroup (MP1 m f a) Source # | |
Generic (MP1 m f a) Source # | |
Read (f a) => Read (MP1 m f a) Source # | |
Show (f a) => Show (MP1 m f a) Source # | |
Eq (f a) => Eq (MP1 m f a) Source # | |
Ord (f a) => Ord (MP1 m f a) Source # | |
Defined in Generics.Linear.Class | |
Generic (MP1 m f a) Source # | |
type Rep1 (MP1 m f :: k -> Type) Source # | |
Defined in Generics.Linear.Class | |
type Rep1 (MP1 m f :: k -> Type) Source # | |
Defined in Generics.Linear.Class | |
type Rep (MP1 m f a) Source # | |
Defined in Generics.Linear.Class | |
type Rep (MP1 m f a) Source # | |
Defined in Generics.Linear.Class |
class Datatype (d :: k) where #
Class for datatypes that represent datatypes
datatypeName :: forall k1 t (f :: k1 -> Type) (a :: k1). t d f a -> [Char] #
The name of the datatype (unqualified)
moduleName :: forall k1 t (f :: k1 -> Type) (a :: k1). t d f a -> [Char] #
The fully-qualified name of the module where the type is declared
packageName :: forall k1 t (f :: k1 -> Type) (a :: k1). t d f a -> [Char] #
The package name of the module where the type is declared
Since: base-4.9.0.0
isNewtype :: forall k1 t (f :: k1 -> Type) (a :: k1). t d f a -> Bool #
Marks if the datatype is actually a newtype
Since: base-4.7.0.0
Instances
(KnownSymbol n, KnownSymbol m, KnownSymbol p, SingI nt) => Datatype ('MetaData n m p nt :: Meta) | Since: base-4.9.0.0 |
Defined in GHC.Generics datatypeName :: forall k1 t (f :: k1 -> Type) (a :: k1). t ('MetaData n m p nt) f a -> [Char] # moduleName :: forall k1 t (f :: k1 -> Type) (a :: k1). t ('MetaData n m p nt) f a -> [Char] # packageName :: forall k1 t (f :: k1 -> Type) (a :: k1). t ('MetaData n m p nt) f a -> [Char] # isNewtype :: forall k1 t (f :: k1 -> Type) (a :: k1). t ('MetaData n m p nt) f a -> Bool # |
class Constructor (c :: k) where #
Class for datatypes that represent data constructors
conName :: forall k1 t (f :: k1 -> Type) (a :: k1). t c f a -> [Char] #
The name of the constructor
conFixity :: forall k1 t (f :: k1 -> Type) (a :: k1). t c f a -> Fixity #
The fixity of the constructor
conIsRecord :: forall k1 t (f :: k1 -> Type) (a :: k1). t c f a -> Bool #
Marks if this constructor is a record
Instances
(KnownSymbol n, SingI f, SingI r) => Constructor ('MetaCons n f r :: Meta) | Since: base-4.9.0.0 |
class Selector (s :: k) where #
Class for datatypes that represent records
selName :: forall k1 t (f :: k1 -> Type) (a :: k1). t s f a -> [Char] #
The name of the selector
selSourceUnpackedness :: forall k1 t (f :: k1 -> Type) (a :: k1). t s f a -> SourceUnpackedness #
The selector's unpackedness annotation (if any)
Since: base-4.9.0.0
selSourceStrictness :: forall k1 t (f :: k1 -> Type) (a :: k1). t s f a -> SourceStrictness #
The selector's strictness annotation (if any)
Since: base-4.9.0.0
selDecidedStrictness :: forall k1 t (f :: k1 -> Type) (a :: k1). t s f a -> DecidedStrictness #
The strictness that the compiler inferred for the selector
Since: base-4.9.0.0
Instances
(SingI mn, SingI su, SingI ss, SingI ds) => Selector ('MetaSel mn su ss ds :: Meta) | Since: base-4.9.0.0 |
Defined in GHC.Generics selName :: forall k1 t (f :: k1 -> Type) (a :: k1). t ('MetaSel mn su ss ds) f a -> [Char] # selSourceUnpackedness :: forall k1 t (f :: k1 -> Type) (a :: k1). t ('MetaSel mn su ss ds) f a -> SourceUnpackedness # selSourceStrictness :: forall k1 t (f :: k1 -> Type) (a :: k1). t ('MetaSel mn su ss ds) f a -> SourceStrictness # selDecidedStrictness :: forall k1 t (f :: k1 -> Type) (a :: k1). t ('MetaSel mn su ss ds) f a -> DecidedStrictness # |
Void: used for datatypes without constructors
Instances
Generic1 (V1 :: k -> Type) | |
Generic1 (V1 :: k -> Type) Source # | |
Foldable (V1 :: TYPE LiftedRep -> Type) | Since: base-4.9.0.0 |
Defined in Data.Foldable fold :: Monoid m => V1 m -> m # foldMap :: Monoid m => (a -> m) -> V1 a -> m # foldMap' :: Monoid m => (a -> m) -> V1 a -> m # foldr :: (a -> b -> b) -> b -> V1 a -> b # foldr' :: (a -> b -> b) -> b -> V1 a -> b # foldl :: (b -> a -> b) -> b -> V1 a -> b # foldl' :: (b -> a -> b) -> b -> V1 a -> b # foldr1 :: (a -> a -> a) -> V1 a -> a # foldl1 :: (a -> a -> a) -> V1 a -> a # elem :: Eq a => a -> V1 a -> Bool # maximum :: Ord a => V1 a -> a # | |
Contravariant (V1 :: Type -> Type) | |
Traversable (V1 :: Type -> Type) | Since: base-4.9.0.0 |
Functor (V1 :: TYPE LiftedRep -> Type) | Since: base-4.9.0.0 |
Data p => Data (V1 p) | Since: base-4.9.0.0 |
Defined in Data.Data gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> V1 p -> c (V1 p) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (V1 p) # dataTypeOf :: V1 p -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (V1 p)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (V1 p)) # gmapT :: (forall b. Data b => b -> b) -> V1 p -> V1 p # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> V1 p -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> V1 p -> r # gmapQ :: (forall d. Data d => d -> u) -> V1 p -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> V1 p -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> V1 p -> m (V1 p) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> V1 p -> m (V1 p) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> V1 p -> m (V1 p) # | |
Semigroup (V1 p) | Since: base-4.12.0.0 |
Generic (V1 p) | |
Read (V1 p) | Since: base-4.9.0.0 |
Show (V1 p) | Since: base-4.9.0.0 |
Eq (V1 p) | Since: base-4.9.0.0 |
Ord (V1 p) | Since: base-4.9.0.0 |
Generic (V1 p) Source # | |
type Rep1 (V1 :: k -> Type) | Since: base-4.9.0.0 |
type Rep1 (V1 :: k -> Type) Source # | |
type Rep (V1 p) | Since: base-4.9.0.0 |
type Rep (V1 p) Source # | |
Unit: used for constructors without arguments
Instances
Generic1 (U1 :: k -> Type) | |
Generic1 (U1 :: k -> Type) Source # | |
Foldable (U1 :: TYPE LiftedRep -> Type) | Since: base-4.9.0.0 |
Defined in Data.Foldable fold :: Monoid m => U1 m -> m # foldMap :: Monoid m => (a -> m) -> U1 a -> m # foldMap' :: Monoid m => (a -> m) -> U1 a -> m # foldr :: (a -> b -> b) -> b -> U1 a -> b # foldr' :: (a -> b -> b) -> b -> U1 a -> b # foldl :: (b -> a -> b) -> b -> U1 a -> b # foldl' :: (b -> a -> b) -> b -> U1 a -> b # foldr1 :: (a -> a -> a) -> U1 a -> a # foldl1 :: (a -> a -> a) -> U1 a -> a # elem :: Eq a => a -> U1 a -> Bool # maximum :: Ord a => U1 a -> a # | |
Contravariant (U1 :: Type -> Type) | |
Traversable (U1 :: Type -> Type) | Since: base-4.9.0.0 |
Alternative (U1 :: Type -> Type) | Since: base-4.9.0.0 |
Applicative (U1 :: Type -> Type) | Since: base-4.9.0.0 |
Functor (U1 :: Type -> Type) | Since: base-4.9.0.0 |
Monad (U1 :: Type -> Type) | Since: base-4.9.0.0 |
MonadPlus (U1 :: Type -> Type) | Since: base-4.9.0.0 |
Data p => Data (U1 p) | Since: base-4.9.0.0 |
Defined in Data.Data gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> U1 p -> c (U1 p) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (U1 p) # dataTypeOf :: U1 p -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (U1 p)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (U1 p)) # gmapT :: (forall b. Data b => b -> b) -> U1 p -> U1 p # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> U1 p -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> U1 p -> r # gmapQ :: (forall d. Data d => d -> u) -> U1 p -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> U1 p -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> U1 p -> m (U1 p) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> U1 p -> m (U1 p) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> U1 p -> m (U1 p) # | |
Monoid (U1 p) | Since: base-4.12.0.0 |
Semigroup (U1 p) | Since: base-4.12.0.0 |
Generic (U1 p) | |
Read (U1 p) | Since: base-4.9.0.0 |
Show (U1 p) | Since: base-4.9.0.0 |
Eq (U1 p) | Since: base-4.9.0.0 |
Ord (U1 p) | Since: base-4.7.0.0 |
Generic (U1 p) Source # | |
type Rep1 (U1 :: k -> Type) | Since: base-4.9.0.0 |
type Rep1 (U1 :: k -> Type) Source # | |
type Rep (U1 p) | Since: base-4.7.0.0 |
type Rep (U1 p) Source # | |
Used for marking occurrences of the parameter
Instances
Foldable Par1 | Since: base-4.9.0.0 |
Defined in Data.Foldable fold :: Monoid m => Par1 m -> m # foldMap :: Monoid m => (a -> m) -> Par1 a -> m # foldMap' :: Monoid m => (a -> m) -> Par1 a -> m # foldr :: (a -> b -> b) -> b -> Par1 a -> b # foldr' :: (a -> b -> b) -> b -> Par1 a -> b # foldl :: (b -> a -> b) -> b -> Par1 a -> b # foldl' :: (b -> a -> b) -> b -> Par1 a -> b # foldr1 :: (a -> a -> a) -> Par1 a -> a # foldl1 :: (a -> a -> a) -> Par1 a -> a # elem :: Eq a => a -> Par1 a -> Bool # maximum :: Ord a => Par1 a -> a # | |
Traversable Par1 | Since: base-4.9.0.0 |
Applicative Par1 | Since: base-4.9.0.0 |
Functor Par1 | Since: base-4.9.0.0 |
Monad Par1 | Since: base-4.9.0.0 |
Generic1 Par1 Source # | |
Data p => Data (Par1 p) | Since: base-4.9.0.0 |
Defined in Data.Data gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Par1 p -> c (Par1 p) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Par1 p) # toConstr :: Par1 p -> Constr # dataTypeOf :: Par1 p -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Par1 p)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Par1 p)) # gmapT :: (forall b. Data b => b -> b) -> Par1 p -> Par1 p # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Par1 p -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Par1 p -> r # gmapQ :: (forall d. Data d => d -> u) -> Par1 p -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Par1 p -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Par1 p -> m (Par1 p) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Par1 p -> m (Par1 p) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Par1 p -> m (Par1 p) # | |
Monoid p => Monoid (Par1 p) | Since: base-4.12.0.0 |
Semigroup p => Semigroup (Par1 p) | Since: base-4.12.0.0 |
Generic (Par1 p) | |
Read p => Read (Par1 p) | Since: base-4.7.0.0 |
Show p => Show (Par1 p) | Since: base-4.7.0.0 |
Eq p => Eq (Par1 p) | Since: base-4.7.0.0 |
Ord p => Ord (Par1 p) | Since: base-4.7.0.0 |
Generic (Par1 p) Source # | |
Generic1 Par1 | |
type Rep1 Par1 Source # | |
Defined in Generics.Linear.Instances.Base | |
type Rep (Par1 p) | Since: base-4.7.0.0 |
Defined in GHC.Generics | |
type Rep (Par1 p) Source # | |
Defined in Generics.Linear.Instances.Base | |
type Rep1 Par1 | Since: base-4.9.0.0 |
Defined in GHC.Generics |
Constants, additional parameters and recursion of kind *
Instances
Generic1 (K1 i c :: k -> Type) | |
Generic1 (K1 i c :: k -> Type) Source # | |
Foldable (K1 i c :: TYPE LiftedRep -> Type) | Since: base-4.9.0.0 |
Defined in Data.Foldable fold :: Monoid m => K1 i c m -> m # foldMap :: Monoid m => (a -> m) -> K1 i c a -> m # foldMap' :: Monoid m => (a -> m) -> K1 i c a -> m # foldr :: (a -> b -> b) -> b -> K1 i c a -> b # foldr' :: (a -> b -> b) -> b -> K1 i c a -> b # foldl :: (b -> a -> b) -> b -> K1 i c a -> b # foldl' :: (b -> a -> b) -> b -> K1 i c a -> b # foldr1 :: (a -> a -> a) -> K1 i c a -> a # foldl1 :: (a -> a -> a) -> K1 i c a -> a # elem :: Eq a => a -> K1 i c a -> Bool # maximum :: Ord a => K1 i c a -> a # minimum :: Ord a => K1 i c a -> a # | |
Contravariant (K1 i c :: Type -> Type) | |
Traversable (K1 i c :: Type -> Type) | Since: base-4.9.0.0 |
Monoid c => Applicative (K1 i c :: Type -> Type) | Since: base-4.12.0.0 |
Functor (K1 i c :: TYPE LiftedRep -> Type) | Since: base-4.9.0.0 |
(Typeable i, Data p, Data c) => Data (K1 i c p) | Since: base-4.9.0.0 |
Defined in Data.Data gfoldl :: (forall d b. Data d => c0 (d -> b) -> d -> c0 b) -> (forall g. g -> c0 g) -> K1 i c p -> c0 (K1 i c p) # gunfold :: (forall b r. Data b => c0 (b -> r) -> c0 r) -> (forall r. r -> c0 r) -> Constr -> c0 (K1 i c p) # toConstr :: K1 i c p -> Constr # dataTypeOf :: K1 i c p -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c0 (t d)) -> Maybe (c0 (K1 i c p)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c0 (t d e)) -> Maybe (c0 (K1 i c p)) # gmapT :: (forall b. Data b => b -> b) -> K1 i c p -> K1 i c p # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> K1 i c p -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> K1 i c p -> r # gmapQ :: (forall d. Data d => d -> u) -> K1 i c p -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> K1 i c p -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> K1 i c p -> m (K1 i c p) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> K1 i c p -> m (K1 i c p) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> K1 i c p -> m (K1 i c p) # | |
Monoid c => Monoid (K1 i c p) | Since: base-4.12.0.0 |
Semigroup c => Semigroup (K1 i c p) | Since: base-4.12.0.0 |
Generic (K1 i c p) | |
Read c => Read (K1 i c p) | Since: base-4.7.0.0 |
Show c => Show (K1 i c p) | Since: base-4.7.0.0 |
Eq c => Eq (K1 i c p) | Since: base-4.7.0.0 |
Ord c => Ord (K1 i c p) | Since: base-4.7.0.0 |
Defined in GHC.Generics | |
Generic (K1 i c p) Source # | |
type Rep1 (K1 i c :: k -> Type) | Since: base-4.9.0.0 |
Defined in GHC.Generics | |
type Rep1 (K1 i c :: k -> Type) Source # | |
Defined in Generics.Linear.Instances.Base | |
type Rep (K1 i c p) | Since: base-4.7.0.0 |
Defined in GHC.Generics | |
type Rep (K1 i c p) Source # | |
Defined in Generics.Linear.Instances.Base |
newtype M1 i (c :: Meta) (f :: k -> Type) (p :: k) #
Meta-information (constructor names, etc.)
Instances
Generic1 (M1 i c f :: k -> Type) | |
Generic1 (M1 i c f :: k -> Type) Source # | |
Foldable f => Foldable (M1 i c f) | Since: base-4.9.0.0 |
Defined in Data.Foldable fold :: Monoid m => M1 i c f m -> m # foldMap :: Monoid m => (a -> m) -> M1 i c f a -> m # foldMap' :: Monoid m => (a -> m) -> M1 i c f a -> m # foldr :: (a -> b -> b) -> b -> M1 i c f a -> b # foldr' :: (a -> b -> b) -> b -> M1 i c f a -> b # foldl :: (b -> a -> b) -> b -> M1 i c f a -> b # foldl' :: (b -> a -> b) -> b -> M1 i c f a -> b # foldr1 :: (a -> a -> a) -> M1 i c f a -> a # foldl1 :: (a -> a -> a) -> M1 i c f a -> a # elem :: Eq a => a -> M1 i c f a -> Bool # maximum :: Ord a => M1 i c f a -> a # minimum :: Ord a => M1 i c f a -> a # | |
Contravariant f => Contravariant (M1 i c f) | |
Traversable f => Traversable (M1 i c f) | Since: base-4.9.0.0 |
Alternative f => Alternative (M1 i c f) | Since: base-4.9.0.0 |
Applicative f => Applicative (M1 i c f) | Since: base-4.9.0.0 |
Functor f => Functor (M1 i c f) | Since: base-4.9.0.0 |
Monad f => Monad (M1 i c f) | Since: base-4.9.0.0 |
MonadPlus f => MonadPlus (M1 i c f) | Since: base-4.9.0.0 |
(Data p, Data (f p), Typeable c, Typeable i, Typeable f) => Data (M1 i c f p) | Since: base-4.9.0.0 |
Defined in Data.Data gfoldl :: (forall d b. Data d => c0 (d -> b) -> d -> c0 b) -> (forall g. g -> c0 g) -> M1 i c f p -> c0 (M1 i c f p) # gunfold :: (forall b r. Data b => c0 (b -> r) -> c0 r) -> (forall r. r -> c0 r) -> Constr -> c0 (M1 i c f p) # toConstr :: M1 i c f p -> Constr # dataTypeOf :: M1 i c f p -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c0 (t d)) -> Maybe (c0 (M1 i c f p)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c0 (t d e)) -> Maybe (c0 (M1 i c f p)) # gmapT :: (forall b. Data b => b -> b) -> M1 i c f p -> M1 i c f p # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> M1 i c f p -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> M1 i c f p -> r # gmapQ :: (forall d. Data d => d -> u) -> M1 i c f p -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> M1 i c f p -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> M1 i c f p -> m (M1 i c f p) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> M1 i c f p -> m (M1 i c f p) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> M1 i c f p -> m (M1 i c f p) # | |
Monoid (f p) => Monoid (M1 i c f p) | Since: base-4.12.0.0 |
Semigroup (f p) => Semigroup (M1 i c f p) | Since: base-4.12.0.0 |
Generic (M1 i c f p) | |
Read (f p) => Read (M1 i c f p) | Since: base-4.7.0.0 |
Show (f p) => Show (M1 i c f p) | Since: base-4.7.0.0 |
Eq (f p) => Eq (M1 i c f p) | Since: base-4.7.0.0 |
Ord (f p) => Ord (M1 i c f p) | Since: base-4.7.0.0 |
Generic (M1 i c f p) Source # | |
type Rep1 (M1 i c f :: k -> Type) | Since: base-4.9.0.0 |
Defined in GHC.Generics | |
type Rep1 (M1 i c f :: k -> Type) Source # | |
Defined in Generics.Linear.Instances.Base | |
type Rep (M1 i c f p) | Since: base-4.7.0.0 |
Defined in GHC.Generics | |
type Rep (M1 i c f p) Source # | |
Defined in Generics.Linear.Instances.Base |
data ((f :: k -> Type) :+: (g :: k -> Type)) (p :: k) infixr 5 #
Sums: encode choice between constructors
Instances
Generic1 (f :+: g :: k -> Type) | |
Generic1 (f :+: g :: k -> Type) Source # | |
(Foldable f, Foldable g) => Foldable (f :+: g) | Since: base-4.9.0.0 |
Defined in Data.Foldable fold :: Monoid m => (f :+: g) m -> m # foldMap :: Monoid m => (a -> m) -> (f :+: g) a -> m # foldMap' :: Monoid m => (a -> m) -> (f :+: g) a -> m # foldr :: (a -> b -> b) -> b -> (f :+: g) a -> b # foldr' :: (a -> b -> b) -> b -> (f :+: g) a -> b # foldl :: (b -> a -> b) -> b -> (f :+: g) a -> b # foldl' :: (b -> a -> b) -> b -> (f :+: g) a -> b # foldr1 :: (a -> a -> a) -> (f :+: g) a -> a # foldl1 :: (a -> a -> a) -> (f :+: g) a -> a # toList :: (f :+: g) a -> [a] # length :: (f :+: g) a -> Int # elem :: Eq a => a -> (f :+: g) a -> Bool # maximum :: Ord a => (f :+: g) a -> a # minimum :: Ord a => (f :+: g) a -> a # | |
(Contravariant f, Contravariant g) => Contravariant (f :+: g) | |
(Traversable f, Traversable g) => Traversable (f :+: g) | Since: base-4.9.0.0 |
(Functor f, Functor g) => Functor (f :+: g) | Since: base-4.9.0.0 |
(Typeable f, Typeable g, Data p, Data (f p), Data (g p)) => Data ((f :+: g) p) | Since: base-4.9.0.0 |
Defined in Data.Data gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g0. g0 -> c g0) -> (f :+: g) p -> c ((f :+: g) p) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c ((f :+: g) p) # toConstr :: (f :+: g) p -> Constr # dataTypeOf :: (f :+: g) p -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c ((f :+: g) p)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ((f :+: g) p)) # gmapT :: (forall b. Data b => b -> b) -> (f :+: g) p -> (f :+: g) p # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> (f :+: g) p -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> (f :+: g) p -> r # gmapQ :: (forall d. Data d => d -> u) -> (f :+: g) p -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> (f :+: g) p -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> (f :+: g) p -> m ((f :+: g) p) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> (f :+: g) p -> m ((f :+: g) p) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> (f :+: g) p -> m ((f :+: g) p) # | |
Generic ((f :+: g) p) | |
(Read (f p), Read (g p)) => Read ((f :+: g) p) | Since: base-4.7.0.0 |
(Show (f p), Show (g p)) => Show ((f :+: g) p) | Since: base-4.7.0.0 |
(Eq (f p), Eq (g p)) => Eq ((f :+: g) p) | Since: base-4.7.0.0 |
(Ord (f p), Ord (g p)) => Ord ((f :+: g) p) | Since: base-4.7.0.0 |
Generic ((f :+: g) p) Source # | |
type Rep1 (f :+: g :: k -> Type) | Since: base-4.9.0.0 |
Defined in GHC.Generics type Rep1 (f :+: g :: k -> Type) = D1 ('MetaData ":+:" "GHC.Generics" "base" 'False) (C1 ('MetaCons "L1" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec1 f)) :+: C1 ('MetaCons "R1" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec1 g))) | |
type Rep1 (f :+: g :: k -> Type) Source # | |
Defined in Generics.Linear.Instances.Base type Rep1 (f :+: g :: k -> Type) = D1 ('MetaData ":+:" "GHC.Generics" "base" 'False) (C1 ('MetaCons "L1" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Par1 :.: f)) :+: C1 ('MetaCons "R1" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Par1 :.: g))) | |
type Rep ((f :+: g) p) | Since: base-4.7.0.0 |
Defined in GHC.Generics type Rep ((f :+: g) p) = D1 ('MetaData ":+:" "GHC.Generics" "base" 'False) (C1 ('MetaCons "L1" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (f p))) :+: C1 ('MetaCons "R1" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (g p)))) | |
type Rep ((f :+: g) p) Source # | |
Defined in Generics.Linear.Instances.Base type Rep ((f :+: g) p) = D1 ('MetaData ":+:" "GHC.Generics" "base" 'False) (C1 ('MetaCons "L1" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (f p))) :+: C1 ('MetaCons "R1" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (g p)))) |
data ((f :: k -> Type) :*: (g :: k -> Type)) (p :: k) infixr 6 #
Products: encode multiple arguments to constructors
(f p) :*: (g p) infixr 6 |
Instances
Generic1 (f :*: g :: k -> Type) | |
Generic1 (f :*: g :: k -> Type) Source # | |
(Foldable f, Foldable g) => Foldable (f :*: g) | Since: base-4.9.0.0 |
Defined in Data.Foldable fold :: Monoid m => (f :*: g) m -> m # foldMap :: Monoid m => (a -> m) -> (f :*: g) a -> m # foldMap' :: Monoid m => (a -> m) -> (f :*: g) a -> m # foldr :: (a -> b -> b) -> b -> (f :*: g) a -> b # foldr' :: (a -> b -> b) -> b -> (f :*: g) a -> b # foldl :: (b -> a -> b) -> b -> (f :*: g) a -> b # foldl' :: (b -> a -> b) -> b -> (f :*: g) a -> b # foldr1 :: (a -> a -> a) -> (f :*: g) a -> a # foldl1 :: (a -> a -> a) -> (f :*: g) a -> a # toList :: (f :*: g) a -> [a] # length :: (f :*: g) a -> Int # elem :: Eq a => a -> (f :*: g) a -> Bool # maximum :: Ord a => (f :*: g) a -> a # minimum :: Ord a => (f :*: g) a -> a # | |
(Contravariant f, Contravariant g) => Contravariant (f :*: g) | |
(Traversable f, Traversable g) => Traversable (f :*: g) | Since: base-4.9.0.0 |
(Alternative f, Alternative g) => Alternative (f :*: g) | Since: base-4.9.0.0 |
(Applicative f, Applicative g) => Applicative (f :*: g) | Since: base-4.9.0.0 |
(Functor f, Functor g) => Functor (f :*: g) | Since: base-4.9.0.0 |
(Monad f, Monad g) => Monad (f :*: g) | Since: base-4.9.0.0 |
(MonadPlus f, MonadPlus g) => MonadPlus (f :*: g) | Since: base-4.9.0.0 |
(Typeable f, Typeable g, Data p, Data (f p), Data (g p)) => Data ((f :*: g) p) | Since: base-4.9.0.0 |
Defined in Data.Data gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g0. g0 -> c g0) -> (f :*: g) p -> c ((f :*: g) p) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c ((f :*: g) p) # toConstr :: (f :*: g) p -> Constr # dataTypeOf :: (f :*: g) p -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c ((f :*: g) p)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ((f :*: g) p)) # gmapT :: (forall b. Data b => b -> b) -> (f :*: g) p -> (f :*: g) p # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> (f :*: g) p -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> (f :*: g) p -> r # gmapQ :: (forall d. Data d => d -> u) -> (f :*: g) p -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> (f :*: g) p -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> (f :*: g) p -> m ((f :*: g) p) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> (f :*: g) p -> m ((f :*: g) p) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> (f :*: g) p -> m ((f :*: g) p) # | |
(Monoid (f p), Monoid (g p)) => Monoid ((f :*: g) p) | Since: base-4.12.0.0 |
(Semigroup (f p), Semigroup (g p)) => Semigroup ((f :*: g) p) | Since: base-4.12.0.0 |
Generic ((f :*: g) p) | |
(Read (f p), Read (g p)) => Read ((f :*: g) p) | Since: base-4.7.0.0 |
(Show (f p), Show (g p)) => Show ((f :*: g) p) | Since: base-4.7.0.0 |
(Eq (f p), Eq (g p)) => Eq ((f :*: g) p) | Since: base-4.7.0.0 |
(Ord (f p), Ord (g p)) => Ord ((f :*: g) p) | Since: base-4.7.0.0 |
Generic ((f :*: g) p) Source # | |
type Rep1 (f :*: g :: k -> Type) | Since: base-4.9.0.0 |
Defined in GHC.Generics type Rep1 (f :*: g :: k -> Type) = D1 ('MetaData ":*:" "GHC.Generics" "base" 'False) (C1 ('MetaCons ":*:" ('InfixI 'RightAssociative 6) 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec1 f) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec1 g))) | |
type Rep1 (f :*: g :: k -> Type) Source # | |
Defined in Generics.Linear.Instances.Base type Rep1 (f :*: g :: k -> Type) = D1 ('MetaData ":*:" "GHC.Generics" "base" 'False) (C1 ('MetaCons ":*:" ('InfixI 'RightAssociative 6) 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Par1 :.: f) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Par1 :.: g))) | |
type Rep ((f :*: g) p) | Since: base-4.7.0.0 |
Defined in GHC.Generics type Rep ((f :*: g) p) = D1 ('MetaData ":*:" "GHC.Generics" "base" 'False) (C1 ('MetaCons ":*:" ('InfixI 'RightAssociative 6) 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (f p)) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (g p)))) | |
type Rep ((f :*: g) p) Source # | |
Defined in Generics.Linear.Instances.Base type Rep ((f :*: g) p) = D1 ('MetaData ":*:" "GHC.Generics" "base" 'False) (C1 ('MetaCons ":*:" ('InfixI 'RightAssociative 6) 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (f p)) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (g p)))) |
type D1 = M1 D :: Meta -> (k -> Type) -> k -> Type #
Type synonym for encoding meta-information for datatypes
type C1 = M1 C :: Meta -> (k -> Type) -> k -> Type #
Type synonym for encoding meta-information for constructors
type S1 = M1 S :: Meta -> (k -> Type) -> k -> Type #
Type synonym for encoding meta-information for record selectors
Constants of unlifted kinds
Since: base-4.9.0.0
Instances
Generic1 (URec (Ptr ()) :: k -> Type) | |
Generic1 (URec Char :: k -> Type) | |
Generic1 (URec Double :: k -> Type) | |
Generic1 (URec Float :: k -> Type) | |
Generic1 (URec Int :: k -> Type) | |
Generic1 (URec Word :: k -> Type) | |
Generic1 (URec (Ptr ()) :: k -> Type) Source # | |
Generic1 (URec Char :: k -> Type) Source # | |
Generic1 (URec Double :: k -> Type) Source # | |
Generic1 (URec Float :: k -> Type) Source # | |
Generic1 (URec Int :: k -> Type) Source # | |
Generic1 (URec Word :: k -> Type) Source # | |
Foldable (UAddr :: TYPE LiftedRep -> Type) | Since: base-4.9.0.0 |
Defined in Data.Foldable fold :: Monoid m => UAddr m -> m # foldMap :: Monoid m => (a -> m) -> UAddr a -> m # foldMap' :: Monoid m => (a -> m) -> UAddr a -> m # foldr :: (a -> b -> b) -> b -> UAddr a -> b # foldr' :: (a -> b -> b) -> b -> UAddr a -> b # foldl :: (b -> a -> b) -> b -> UAddr a -> b # foldl' :: (b -> a -> b) -> b -> UAddr a -> b # foldr1 :: (a -> a -> a) -> UAddr a -> a # foldl1 :: (a -> a -> a) -> UAddr a -> a # elem :: Eq a => a -> UAddr a -> Bool # maximum :: Ord a => UAddr a -> a # minimum :: Ord a => UAddr a -> a # | |
Foldable (UChar :: TYPE LiftedRep -> Type) | Since: base-4.9.0.0 |
Defined in Data.Foldable fold :: Monoid m => UChar m -> m # foldMap :: Monoid m => (a -> m) -> UChar a -> m # foldMap' :: Monoid m => (a -> m) -> UChar a -> m # foldr :: (a -> b -> b) -> b -> UChar a -> b # foldr' :: (a -> b -> b) -> b -> UChar a -> b # foldl :: (b -> a -> b) -> b -> UChar a -> b # foldl' :: (b -> a -> b) -> b -> UChar a -> b # foldr1 :: (a -> a -> a) -> UChar a -> a # foldl1 :: (a -> a -> a) -> UChar a -> a # elem :: Eq a => a -> UChar a -> Bool # maximum :: Ord a => UChar a -> a # minimum :: Ord a => UChar a -> a # | |
Foldable (UDouble :: TYPE LiftedRep -> Type) | Since: base-4.9.0.0 |
Defined in Data.Foldable fold :: Monoid m => UDouble m -> m # foldMap :: Monoid m => (a -> m) -> UDouble a -> m # foldMap' :: Monoid m => (a -> m) -> UDouble a -> m # foldr :: (a -> b -> b) -> b -> UDouble a -> b # foldr' :: (a -> b -> b) -> b -> UDouble a -> b # foldl :: (b -> a -> b) -> b -> UDouble a -> b # foldl' :: (b -> a -> b) -> b -> UDouble a -> b # foldr1 :: (a -> a -> a) -> UDouble a -> a # foldl1 :: (a -> a -> a) -> UDouble a -> a # elem :: Eq a => a -> UDouble a -> Bool # maximum :: Ord a => UDouble a -> a # minimum :: Ord a => UDouble a -> a # | |
Foldable (UFloat :: TYPE LiftedRep -> Type) | Since: base-4.9.0.0 |
Defined in Data.Foldable fold :: Monoid m => UFloat m -> m # foldMap :: Monoid m => (a -> m) -> UFloat a -> m # foldMap' :: Monoid m => (a -> m) -> UFloat a -> m # foldr :: (a -> b -> b) -> b -> UFloat a -> b # foldr' :: (a -> b -> b) -> b -> UFloat a -> b # foldl :: (b -> a -> b) -> b -> UFloat a -> b # foldl' :: (b -> a -> b) -> b -> UFloat a -> b # foldr1 :: (a -> a -> a) -> UFloat a -> a # foldl1 :: (a -> a -> a) -> UFloat a -> a # elem :: Eq a => a -> UFloat a -> Bool # maximum :: Ord a => UFloat a -> a # minimum :: Ord a => UFloat a -> a # | |
Foldable (UInt :: TYPE LiftedRep -> Type) | Since: base-4.9.0.0 |
Defined in Data.Foldable fold :: Monoid m => UInt m -> m # foldMap :: Monoid m => (a -> m) -> UInt a -> m # foldMap' :: Monoid m => (a -> m) -> UInt a -> m # foldr :: (a -> b -> b) -> b -> UInt a -> b # foldr' :: (a -> b -> b) -> b -> UInt a -> b # foldl :: (b -> a -> b) -> b -> UInt a -> b # foldl' :: (b -> a -> b) -> b -> UInt a -> b # foldr1 :: (a -> a -> a) -> UInt a -> a # foldl1 :: (a -> a -> a) -> UInt a -> a # elem :: Eq a => a -> UInt a -> Bool # maximum :: Ord a => UInt a -> a # | |
Foldable (UWord :: TYPE LiftedRep -> Type) | Since: base-4.9.0.0 |
Defined in Data.Foldable fold :: Monoid m => UWord m -> m # foldMap :: Monoid m => (a -> m) -> UWord a -> m # foldMap' :: Monoid m => (a -> m) -> UWord a -> m # foldr :: (a -> b -> b) -> b -> UWord a -> b # foldr' :: (a -> b -> b) -> b -> UWord a -> b # foldl :: (b -> a -> b) -> b -> UWord a -> b # foldl' :: (b -> a -> b) -> b -> UWord a -> b # foldr1 :: (a -> a -> a) -> UWord a -> a # foldl1 :: (a -> a -> a) -> UWord a -> a # elem :: Eq a => a -> UWord a -> Bool # maximum :: Ord a => UWord a -> a # minimum :: Ord a => UWord a -> a # | |
Traversable (UAddr :: Type -> Type) | Since: base-4.9.0.0 |
Traversable (UChar :: Type -> Type) | Since: base-4.9.0.0 |
Traversable (UDouble :: Type -> Type) | Since: base-4.9.0.0 |
Traversable (UFloat :: Type -> Type) | Since: base-4.9.0.0 |
Traversable (UInt :: Type -> Type) | Since: base-4.9.0.0 |
Traversable (UWord :: Type -> Type) | Since: base-4.9.0.0 |
Functor (URec (Ptr ()) :: TYPE LiftedRep -> Type) | Since: base-4.9.0.0 |
Functor (URec Char :: TYPE LiftedRep -> Type) | Since: base-4.9.0.0 |
Functor (URec Double :: TYPE LiftedRep -> Type) | Since: base-4.9.0.0 |
Functor (URec Float :: TYPE LiftedRep -> Type) | Since: base-4.9.0.0 |
Functor (URec Int :: TYPE LiftedRep -> Type) | Since: base-4.9.0.0 |
Functor (URec Word :: TYPE LiftedRep -> Type) | Since: base-4.9.0.0 |
Generic (URec (Ptr ()) p) | |
Generic (URec Char p) | |
Generic (URec Double p) | |
Generic (URec Float p) | |
Generic (URec Int p) | |
Generic (URec Word p) | |
Show (URec Char p) | Since: base-4.9.0.0 |
Show (URec Double p) | Since: base-4.9.0.0 |
Show (URec Float p) | |
Show (URec Int p) | Since: base-4.9.0.0 |
Show (URec Word p) | Since: base-4.9.0.0 |
Eq (URec (Ptr ()) p) | Since: base-4.9.0.0 |
Eq (URec Char p) | Since: base-4.9.0.0 |
Eq (URec Double p) | Since: base-4.9.0.0 |
Eq (URec Float p) | |
Eq (URec Int p) | Since: base-4.9.0.0 |
Eq (URec Word p) | Since: base-4.9.0.0 |
Ord (URec (Ptr ()) p) | Since: base-4.9.0.0 |
Defined in GHC.Generics compare :: URec (Ptr ()) p -> URec (Ptr ()) p -> Ordering # (<) :: URec (Ptr ()) p -> URec (Ptr ()) p -> Bool # (<=) :: URec (Ptr ()) p -> URec (Ptr ()) p -> Bool # (>) :: URec (Ptr ()) p -> URec (Ptr ()) p -> Bool # (>=) :: URec (Ptr ()) p -> URec (Ptr ()) p -> Bool # max :: URec (Ptr ()) p -> URec (Ptr ()) p -> URec (Ptr ()) p # min :: URec (Ptr ()) p -> URec (Ptr ()) p -> URec (Ptr ()) p # | |
Ord (URec Char p) | Since: base-4.9.0.0 |
Ord (URec Double p) | Since: base-4.9.0.0 |
Defined in GHC.Generics compare :: URec Double p -> URec Double p -> Ordering # (<) :: URec Double p -> URec Double p -> Bool # (<=) :: URec Double p -> URec Double p -> Bool # (>) :: URec Double p -> URec Double p -> Bool # (>=) :: URec Double p -> URec Double p -> Bool # | |
Ord (URec Float p) | |
Defined in GHC.Generics | |
Ord (URec Int p) | Since: base-4.9.0.0 |
Ord (URec Word p) | Since: base-4.9.0.0 |
Generic (URec (Ptr ()) p) Source # | |
Generic (URec Char p) Source # | |
Generic (URec Double p) Source # | |
Generic (URec Float p) Source # | |
Generic (URec Int p) Source # | |
Generic (URec Word p) Source # | |
data URec Char (p :: k) | Used for marking occurrences of Since: base-4.9.0.0 |
data URec Double (p :: k) | Used for marking occurrences of Since: base-4.9.0.0 |
data URec Float (p :: k) | Used for marking occurrences of Since: base-4.9.0.0 |
data URec Int (p :: k) | Used for marking occurrences of Since: base-4.9.0.0 |
data URec Word (p :: k) | Used for marking occurrences of Since: base-4.9.0.0 |
data URec (Ptr ()) (p :: k) | Used for marking occurrences of Since: base-4.9.0.0 |
type Rep1 (URec (Ptr ()) :: k -> Type) | Since: base-4.9.0.0 |
Defined in GHC.Generics | |
type Rep1 (URec Char :: k -> Type) | Since: base-4.9.0.0 |
Defined in GHC.Generics | |
type Rep1 (URec Double :: k -> Type) | Since: base-4.9.0.0 |
Defined in GHC.Generics | |
type Rep1 (URec Float :: k -> Type) | Since: base-4.9.0.0 |
Defined in GHC.Generics | |
type Rep1 (URec Int :: k -> Type) | Since: base-4.9.0.0 |
Defined in GHC.Generics | |
type Rep1 (URec Word :: k -> Type) | Since: base-4.9.0.0 |
Defined in GHC.Generics | |
type Rep1 (URec (Ptr ()) :: k -> Type) Source # | |
Defined in Generics.Linear.Instances.Base | |
type Rep1 (URec Char :: k -> Type) Source # | |
Defined in Generics.Linear.Instances.Base | |
type Rep1 (URec Double :: k -> Type) Source # | |
Defined in Generics.Linear.Instances.Base | |
type Rep1 (URec Float :: k -> Type) Source # | |
Defined in Generics.Linear.Instances.Base | |
type Rep1 (URec Int :: k -> Type) Source # | |
Defined in Generics.Linear.Instances.Base | |
type Rep1 (URec Word :: k -> Type) Source # | |
Defined in Generics.Linear.Instances.Base | |
type Rep (URec (Ptr ()) p) | Since: base-4.9.0.0 |
Defined in GHC.Generics | |
type Rep (URec Char p) | Since: base-4.9.0.0 |
Defined in GHC.Generics | |
type Rep (URec Double p) | Since: base-4.9.0.0 |
Defined in GHC.Generics | |
type Rep (URec Float p) | |
Defined in GHC.Generics | |
type Rep (URec Int p) | Since: base-4.9.0.0 |
Defined in GHC.Generics | |
type Rep (URec Word p) | Since: base-4.9.0.0 |
Defined in GHC.Generics | |
type Rep (URec (Ptr ()) p) Source # | |
Defined in Generics.Linear.Instances.Base | |
type Rep (URec Char p) Source # | |
Defined in Generics.Linear.Instances.Base | |
type Rep (URec Double p) Source # | |
Defined in Generics.Linear.Instances.Base | |
type Rep (URec Float p) Source # | |
Defined in Generics.Linear.Instances.Base | |
type Rep (URec Int p) Source # | |
Defined in Generics.Linear.Instances.Base | |
type Rep (URec Word p) Source # | |
Defined in Generics.Linear.Instances.Base |
data SourceUnpackedness #
The unpackedness of a field as the user wrote it in the source code. For example, in the following data type:
data E = ExampleConstructor Int {-# NOUNPACK #-} Int {-# UNPACK #-} Int
The fields of ExampleConstructor
have NoSourceUnpackedness
,
SourceNoUnpack
, and SourceUnpack
, respectively.
Since: base-4.9.0.0
Instances
data SourceStrictness #
The strictness of a field as the user wrote it in the source code. For example, in the following data type:
data E = ExampleConstructor Int ~Int !Int
The fields of ExampleConstructor
have NoSourceStrictness
,
SourceLazy
, and SourceStrict
, respectively.
Since: base-4.9.0.0
Instances
Datatype to represent metadata associated with a datatype (MetaData
),
constructor (MetaCons
), or field selector (MetaSel
).
- In
MetaData n m p nt
,n
is the datatype's name,m
is the module in which the datatype is defined,p
is the package in which the datatype is defined, andnt
is'True
if the datatype is anewtype
. - In
MetaCons n f s
,n
is the constructor's name,f
is its fixity, ands
is'True
if the constructor contains record selectors. - In
MetaSel mn su ss ds
, if the field uses record syntax, thenmn
isJust
the record name. Otherwise,mn
isNothing
.su
andss
are the field's unpackedness and strictness annotations, andds
is the strictness that GHC infers for the field.
Since: base-4.9.0.0
MetaData Symbol Symbol Symbol Bool | |
MetaCons Symbol FixityI Bool | |
MetaSel (Maybe Symbol) SourceUnpackedness SourceStrictness DecidedStrictness |
Instances
(KnownSymbol n, SingI f, SingI r) => Constructor ('MetaCons n f r :: Meta) | Since: base-4.9.0.0 |
(KnownSymbol n, KnownSymbol m, KnownSymbol p, SingI nt) => Datatype ('MetaData n m p nt :: Meta) | Since: base-4.9.0.0 |
Defined in GHC.Generics datatypeName :: forall k1 t (f :: k1 -> Type) (a :: k1). t ('MetaData n m p nt) f a -> [Char] # moduleName :: forall k1 t (f :: k1 -> Type) (a :: k1). t ('MetaData n m p nt) f a -> [Char] # packageName :: forall k1 t (f :: k1 -> Type) (a :: k1). t ('MetaData n m p nt) f a -> [Char] # isNewtype :: forall k1 t (f :: k1 -> Type) (a :: k1). t ('MetaData n m p nt) f a -> Bool # | |
(SingI mn, SingI su, SingI ss, SingI ds) => Selector ('MetaSel mn su ss ds :: Meta) | Since: base-4.9.0.0 |
Defined in GHC.Generics selName :: forall k1 t (f :: k1 -> Type) (a :: k1). t ('MetaSel mn su ss ds) f a -> [Char] # selSourceUnpackedness :: forall k1 t (f :: k1 -> Type) (a :: k1). t ('MetaSel mn su ss ds) f a -> SourceUnpackedness # selSourceStrictness :: forall k1 t (f :: k1 -> Type) (a :: k1). t ('MetaSel mn su ss ds) f a -> SourceStrictness # selDecidedStrictness :: forall k1 t (f :: k1 -> Type) (a :: k1). t ('MetaSel mn su ss ds) f a -> DecidedStrictness # |
This variant of Fixity
appears at the type level.
Since: base-4.9.0.0
Instances
SingKind FixityI | Since: base-4.9.0.0 |
Defined in GHC.Generics type DemoteRep FixityI | |
SingI 'PrefixI | Since: base-4.9.0.0 |
Defined in GHC.Generics | |
(SingI a, KnownNat n) => SingI ('InfixI a n :: FixityI) | Since: base-4.9.0.0 |
Defined in GHC.Generics | |
type DemoteRep FixityI | |
Defined in GHC.Generics | |
data Sing (a :: FixityI) | |
Defined in GHC.Generics |
Datatype to represent the fixity of a constructor. An infix
| declaration directly corresponds to an application of Infix
.
Instances
Data Fixity | Since: base-4.9.0.0 |
Defined in Data.Data gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Fixity -> c Fixity # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Fixity # toConstr :: Fixity -> Constr # dataTypeOf :: Fixity -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Fixity) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Fixity) # gmapT :: (forall b. Data b => b -> b) -> Fixity -> Fixity # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Fixity -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Fixity -> r # gmapQ :: (forall d. Data d => d -> u) -> Fixity -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Fixity -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Fixity -> m Fixity # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Fixity -> m Fixity # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Fixity -> m Fixity # | |
Generic Fixity | |
Read Fixity | Since: base-4.6.0.0 |
Show Fixity | Since: base-4.6.0.0 |
Eq Fixity | Since: base-4.6.0.0 |
Ord Fixity | Since: base-4.6.0.0 |
Generic Fixity Source # | |
type Rep Fixity | Since: base-4.7.0.0 |
Defined in GHC.Generics type Rep Fixity = D1 ('MetaData "Fixity" "GHC.Generics" "base" 'False) (C1 ('MetaCons "Prefix" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Infix" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Associativity) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int))) | |
type Rep Fixity Source # | |
Defined in Generics.Linear.Instances.Base type Rep Fixity = D1 ('MetaData "Fixity" "GHC.Generics" "base" 'False) (C1 ('MetaCons "Prefix" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Infix" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Associativity) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int))) |
data DecidedStrictness #
The strictness that GHC infers for a field during compilation. Whereas
there are nine different combinations of SourceUnpackedness
and
SourceStrictness
, the strictness that GHC decides will ultimately be one
of lazy, strict, or unpacked. What GHC decides is affected both by what the
user writes in the source code and by GHC flags. As an example, consider
this data type:
data E = ExampleConstructor {-# UNPACK #-} !Int !Int Int
- If compiled without optimization or other language extensions, then the
fields of
ExampleConstructor
will haveDecidedStrict
,DecidedStrict
, andDecidedLazy
, respectively. - If compiled with
-XStrictData
enabled, then the fields will haveDecidedStrict
,DecidedStrict
, andDecidedStrict
, respectively. - If compiled with
-O2
enabled, then the fields will haveDecidedUnpack
,DecidedStrict
, andDecidedLazy
, respectively.
Since: base-4.9.0.0
Instances
data Associativity #
Datatype to represent the associativity of a constructor