Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- gbmapDefault :: CanDeriveFunctorB b f g => ( forall a. f a -> g a) -> b f -> b g
- class GFunctor (n :: Nat ) f g repbf repbg where
- type CanDeriveFunctorB b f g = ( GenericP 0 (b f), GenericP 0 (b g), GFunctor 0 f g ( RepP 0 (b f)) ( RepP 0 (b g)))
- type CanDeriveFunctorT t f g x = ( GenericP 1 (t f x), GenericP 1 (t g x), GFunctor 1 f g ( RepP 1 (t f x)) ( RepP 1 (t g x)))
- gbtraverseDefault :: forall b f g e. ( Applicative e, CanDeriveTraversableB b f g) => ( forall a. f a -> e (g a)) -> b f -> e (b g)
-
class
GTraversable
n f g repbf repbg
where
- gtraverse :: Applicative t => Proxy n -> ( forall a. f a -> t (g a)) -> repbf x -> t (repbg x)
- type CanDeriveTraversableB b f g = ( GenericP 0 (b f), GenericP 0 (b g), GTraversable 0 f g ( RepP 0 (b f)) ( RepP 0 (b g)))
- type CanDeriveTraversableT t f g x = ( GenericP 1 (t f x), GenericP 1 (t g x), GTraversable 1 f g ( RepP 1 (t f x)) ( RepP 1 (t g x)))
- gbdistributeDefault :: CanDeriveDistributiveB b f g => Functor f => f (b g) -> b ( Compose f g)
-
class
Functor
f =>
GDistributive
(n ::
Nat
) f repbg repbfg
where
- gdistribute :: Proxy n -> f (repbg x) -> repbfg x
- type CanDeriveDistributiveB b f g = ( GenericP 0 (b g), GenericP 0 (b ( Compose f g)), GDistributive 0 f ( RepP 0 (b g)) ( RepP 0 (b ( Compose f g))))
- type CanDeriveDistributiveT (t :: ( Type -> Type ) -> i -> Type ) f g x = ( GenericP 1 (t g x), GenericP 1 (t ( Compose f g) x), GDistributive 1 f ( RepP 1 (t g x)) ( RepP 1 (t ( Compose f g) x)))
- gbpureDefault :: forall b f. CanDeriveApplicativeB b f f => ( forall a. f a) -> b f
- gbprodDefault :: forall b f g. CanDeriveApplicativeB b f g => b f -> b g -> b (f `Product` g)
- class GApplicative n (f :: k -> Type ) (g :: k -> Type ) repbf repbg repbfg where
- type CanDeriveApplicativeB b f g = ( GenericP 0 (b f), GenericP 0 (b g), GenericP 0 (b (f `Product` g)), GApplicative 0 f g ( RepP 0 (b f)) ( RepP 0 (b g)) ( RepP 0 (b (f `Product` g))))
- type CanDeriveApplicativeT t f g x = ( GenericP 1 (t f x), GenericP 1 (t g x), GenericP 1 (t (f `Product` g) x), GApplicative 1 f g ( RepP 1 (t f x)) ( RepP 1 (t g x)) ( RepP 1 (t (f `Product` g) x)))
- gbaddDictsDefault :: forall b c f. ( CanDeriveConstraintsB c b f, AllB c b) => b f -> b ( Dict c `Product` f)
- class GConstraints n c f repbx repbf repbdf where
- type CanDeriveConstraintsB c b f = ( GenericN (b f), GenericN (b ( Dict c `Product` f)), AllB c b ~ GAll 0 c ( GAllRepB b), GConstraints 0 c f ( GAllRepB b) ( RepN (b f)) ( RepN (b ( Dict c `Product` f))))
- type CanDeriveConstraintsT c t f x = ( GenericN (t f x), GenericN (t ( Dict c `Product` f) x), AllT c t ~ GAll 1 c ( GAllRepT t), GConstraints 1 c f ( GAllRepT t) ( RepN (t f x)) ( RepN (t ( Dict c `Product` f) x)))
- type family GAll (n :: Nat ) (c :: k -> Constraint ) (repbf :: Type -> Type ) :: Constraint
- type GAllRepB b = TagSelf0 b
- type GAllRepT t = TagSelf1 t
- data X a
- data family Y :: k
- data Self (p :: Type ) (a :: Type ) (x :: Type )
- data Other (p :: Type ) (a :: Type ) (x :: Type )
- type family SelfOrOther (b :: k) (b' :: k) :: Type -> Type -> Type -> Type where ...
- type TagSelf0 b = TagSelf0' ( Indexed b 1) ( RepN (b X ))
- type family TagSelf0' (b :: kf -> Type ) (repbf :: Type -> Type ) :: Type -> Type where ...
- type TagSelf1 b = TagSelf1' ( Indexed b 2) ( Zip ( Rep ( Indexed (b X ) 1 Y )) ( Rep (b X Y )))
- type family TagSelf1' (b :: kf -> kg -> Type ) (repbf :: Type -> Type ) :: Type -> Type where ...
- gbcoverDefault :: CanDeriveBareB b => b Bare Identity -> b Covered Identity
- gbstripDefault :: CanDeriveBareB b => b Covered Identity -> b Bare Identity
- class GBare (n :: Nat ) repbi repbb where
- type CanDeriveBareB b = ( GenericP 0 (b Bare Identity ), GenericP 0 (b Covered Identity ), GBare 0 ( RepP 0 (b Covered Identity )) ( RepP 0 (b Bare Identity )))
- data family Param (n :: Nat ) (a :: k) :: k
- type family Indexed (t :: k) (i :: Nat ) :: k where ...
- type family FilterIndex (n :: Nat ) (t :: k) :: k where ...
- type family Zip (a :: Type -> Type ) (b :: Type -> Type ) :: Type -> Type where ...
- newtype Rec (p :: Type ) a x = Rec { }
- class ( Coercible ( Rep a) ( RepN a), Generic a) => GenericN (a :: Type ) where
- class ( Coercible ( Rep a) ( RepP n a), Generic a) => GenericP (n :: Nat ) (a :: Type ) where
- module GHC.Generics
Functor
gbmapDefault :: CanDeriveFunctorB b f g => ( forall a. f a -> g a) -> b f -> b g Source #
class GFunctor (n :: Nat ) f g repbf repbg where Source #
Instances
GFunctor n (f :: k1 -> Type ) (g :: k1 -> Type ) ( U1 :: k2 -> Type ) ( U1 :: k2 -> Type ) Source # | |
GFunctor n (f :: k1 -> Type ) (g :: k1 -> Type ) ( V1 :: k2 -> Type ) ( V1 :: k2 -> Type ) Source # | |
GFunctor n (f :: k1 -> Type ) (g :: k1 -> Type ) ( Rec x x :: k2 -> Type ) ( Rec x x :: k2 -> Type ) Source # | |
( GFunctor n f g l l', GFunctor n f g r r') => GFunctor n (f :: k1 -> Type ) (g :: k1 -> Type ) (l :+: r :: k2 -> Type ) (l' :+: r' :: k2 -> Type ) Source # | |
( GFunctor n f g l l', GFunctor n f g r r') => GFunctor n (f :: k1 -> Type ) (g :: k1 -> Type ) (l :*: r :: k2 -> Type ) (l' :*: r' :: k2 -> Type ) Source # | |
GFunctor n f g bf bg => GFunctor n (f :: k1 -> Type ) (g :: k1 -> Type ) ( M1 i c bf :: k2 -> Type ) ( M1 i c bg :: k2 -> Type ) Source # | |
type CanDeriveFunctorB b f g = ( GenericP 0 (b f), GenericP 0 (b g), GFunctor 0 f g ( RepP 0 (b f)) ( RepP 0 (b g))) Source #
is in practice a predicate about
CanDeriveFunctorB
B f g
B
only.
Intuitively, it says that the following holds, for any arbitrary
f
:
type CanDeriveFunctorT t f g x = ( GenericP 1 (t f x), GenericP 1 (t g x), GFunctor 1 f g ( RepP 1 (t f x)) ( RepP 1 (t g x))) Source #
is in practice a predicate about
CanDeriveFunctorT
T f g x
T
only.
Intuitively, it says that the following holds, for any arbitrary
f
:
-
There is an instance of
Generic
(T f) -
T f x
can contain fields of typet f y
as long as there exists aFunctorT
tT f y
are allowed. -
T f x
can also contain usages oft f y
under aFunctor
hMaybe
(T f y)T f y
.
Traversable
gbtraverseDefault :: forall b f g e. ( Applicative e, CanDeriveTraversableB b f g) => ( forall a. f a -> e (g a)) -> b f -> e (b g) Source #
class GTraversable n f g repbf repbg where Source #
gtraverse :: Applicative t => Proxy n -> ( forall a. f a -> t (g a)) -> repbf x -> t (repbg x) Source #
Instances
GTraversable (n :: k1) (f :: k2 -> Type ) (g :: k2 -> Type ) ( U1 :: k3 -> Type ) ( U1 :: k3 -> Type ) Source # | |
Defined in Barbies.Generics.Traversable |
|
GTraversable (n :: k1) (f :: k2 -> Type ) (g :: k2 -> Type ) ( V1 :: k3 -> Type ) ( V1 :: k3 -> Type ) Source # | |
Defined in Barbies.Generics.Traversable |
|
GTraversable (n :: k1) (f :: k2 -> Type ) (g :: k2 -> Type ) ( Rec a a :: k3 -> Type ) ( Rec a a :: k3 -> Type ) Source # | |
Defined in Barbies.Generics.Traversable |
|
( GTraversable n f g l l', GTraversable n f g r r') => GTraversable (n :: k1) (f :: k2 -> Type ) (g :: k2 -> Type ) (l :+: r :: k3 -> Type ) (l' :+: r' :: k3 -> Type ) Source # | |
Defined in Barbies.Generics.Traversable |
|
( GTraversable n f g l l', GTraversable n f g r r') => GTraversable (n :: k1) (f :: k2 -> Type ) (g :: k2 -> Type ) (l :*: r :: k3 -> Type ) (l' :*: r' :: k3 -> Type ) Source # | |
Defined in Barbies.Generics.Traversable |
|
GTraversable n f g bf bg => GTraversable (n :: k1) (f :: k2 -> Type ) (g :: k2 -> Type ) ( M1 i c bf :: k3 -> Type ) ( M1 i c bg :: k3 -> Type ) Source # | |
Defined in Barbies.Generics.Traversable |
type CanDeriveTraversableB b f g = ( GenericP 0 (b f), GenericP 0 (b g), GTraversable 0 f g ( RepP 0 (b f)) ( RepP 0 (b g))) Source #
is in practice a predicate about
CanDeriveTraversableB
B f g
B
only.
It is analogous to
CanDeriveFunctorB
, so it
essentially requires the following to hold, for any arbitrary
f
:
-
There is an instance of
Generic
(B f) -
B f
can contain fields of typeb f
as long as there exists aTraversableB
bB f
are allowed. -
B f
can also contain usages ofb f
under aTraversable
hMaybe
(B f)B f
.
type CanDeriveTraversableT t f g x = ( GenericP 1 (t f x), GenericP 1 (t g x), GTraversable 1 f g ( RepP 1 (t f x)) ( RepP 1 (t g x))) Source #
is in practice a predicate about
CanDeriveTraversableT
T f g x
T
only.
It is analogous to
CanDeriveFunctorT
, so it
essentially requires the following to hold, for any arbitrary
f
:
-
There is an instance of
Generic
(T f x) -
T f x
can contain fields of typet f x
as long as there exists aTraversableT
tT f x
are allowed. -
T f x
can also contain usages oft f x
under aTraversable
hMaybe
(T f x)T f x
.
Distributive
gbdistributeDefault :: CanDeriveDistributiveB b f g => Functor f => f (b g) -> b ( Compose f g) Source #
Default implementation of
bdistribute
based on
Generic
.
class Functor f => GDistributive (n :: Nat ) f repbg repbfg where Source #
gdistribute :: Proxy n -> f (repbg x) -> repbfg x Source #
Instances
Functor f => GDistributive n f ( U1 :: k -> Type ) ( U1 :: k -> Type ) Source # | |
Defined in Barbies.Generics.Distributive |
|
( GDistributive n f l l', GDistributive n f r r') => GDistributive n f (l :*: r :: k -> Type ) (l' :*: r' :: k -> Type ) Source # | |
Defined in Barbies.Generics.Distributive |
|
GDistributive n f bg bfg => GDistributive n f ( M1 i c bg :: k -> Type ) ( M1 i c bfg :: k -> Type ) Source # | |
Defined in Barbies.Generics.Distributive |
type CanDeriveDistributiveB b f g = ( GenericP 0 (b g), GenericP 0 (b ( Compose f g)), GDistributive 0 f ( RepP 0 (b g)) ( RepP 0 (b ( Compose f g)))) Source #
is in practice a predicate about
CanDeriveDistributiveB
B f g
B
only.
Intuitively, it says the the following holds for any arbitrary
f
:
-
There is an instance of
Generic
(B f) -
(B f)
has only one constructor, and doesn't contain "naked" fields (that is, not covered byf
). -
B f
can contain fields of typeb f
as long as there exists aDistributiveB
bB f
are allowed. -
B f
can also contain usages ofb f
under aDistributive
ha -> (B f)
as a field ofB f
.
type CanDeriveDistributiveT (t :: ( Type -> Type ) -> i -> Type ) f g x = ( GenericP 1 (t g x), GenericP 1 (t ( Compose f g) x), GDistributive 1 f ( RepP 1 (t g x)) ( RepP 1 (t ( Compose f g) x))) Source #
is in practice a predicate about
CanDeriveDistributiveT
T f g x
T
only.
Intuitively, it says the the following holds for any arbitrary
f
:
-
There is an instance of
Generic
(B f x) -
(B f x)
has only one constructor, and doesn't contain "naked" fields (that is, not covered byf
). In particular,x
needs to occur underf
. -
B f x
can contain fields of typeb f y
as long as there exists aDistributiveT
bB f x
are allowed. -
B f x
can also contain usages ofb f y
under aDistributive
ha -> (B f x)
as a field ofB f x
.
Applicative
gbpureDefault :: forall b f. CanDeriveApplicativeB b f f => ( forall a. f a) -> b f Source #
gbprodDefault :: forall b f g. CanDeriveApplicativeB b f g => b f -> b g -> b (f `Product` g) Source #
class GApplicative n (f :: k -> Type ) (g :: k -> Type ) repbf repbg repbfg where Source #
gprod :: Proxy n -> Proxy f -> Proxy g -> repbf x -> repbg x -> repbfg x Source #
gpure :: (f ~ g, repbf ~ repbg) => Proxy n -> Proxy f -> Proxy repbf -> Proxy repbfg -> ( forall a. f a) -> repbf x Source #
Instances
GApplicative (n :: k1) (f :: k2 -> Type ) (g :: k2 -> Type ) ( U1 :: k3 -> Type ) ( U1 :: k3 -> Type ) ( U1 :: k3 -> Type ) Source # | |
Monoid x => GApplicative (n :: k1) (f :: k2 -> Type ) (g :: k2 -> Type ) ( Rec x x :: k3 -> Type ) ( Rec x x :: k3 -> Type ) ( Rec x x :: k3 -> Type ) Source # | |
Defined in Barbies.Generics.Applicative |
|
( GApplicative n f g lf lg lfg, GApplicative n f g rf rg rfg) => GApplicative (n :: k1) (f :: k2 -> Type ) (g :: k2 -> Type ) (lf :*: rf :: k3 -> Type ) (lg :*: rg :: k3 -> Type ) (lfg :*: rfg :: k3 -> Type ) Source # | |
Defined in Barbies.Generics.Applicative |
|
GApplicative n f g repf repg repfg => GApplicative (n :: k1) (f :: k2 -> Type ) (g :: k2 -> Type ) ( M1 i c repf :: k3 -> Type ) ( M1 i c repg :: k3 -> Type ) ( M1 i c repfg :: k3 -> Type ) Source # | |
Defined in Barbies.Generics.Applicative gprod :: forall (x :: k). Proxy n -> Proxy f -> Proxy g -> M1 i c repf x -> M1 i c repg x -> M1 i c repfg x Source # gpure :: forall (x :: k). (f ~ g, M1 i c repf ~ M1 i c repg) => Proxy n -> Proxy f -> Proxy ( M1 i c repf) -> Proxy ( M1 i c repfg) -> ( forall (a :: k). f a) -> M1 i c repf x Source # |
type CanDeriveApplicativeB b f g = ( GenericP 0 (b f), GenericP 0 (b g), GenericP 0 (b (f `Product` g)), GApplicative 0 f g ( RepP 0 (b f)) ( RepP 0 (b g)) ( RepP 0 (b (f `Product` g)))) Source #
is in practice a predicate about
CanDeriveApplicativeB
B f g
B
only.
Intuitively, it says that the following holds, for any arbitrary
f
:
-
There is an instance of
Generic
(B f) -
B
has only one constructor (that is, it is not a sum-type). -
Every field of
B f
is either a monoid, or of the formf a
, for some typea
.
type CanDeriveApplicativeT t f g x = ( GenericP 1 (t f x), GenericP 1 (t g x), GenericP 1 (t (f `Product` g) x), GApplicative 1 f g ( RepP 1 (t f x)) ( RepP 1 (t g x)) ( RepP 1 (t (f `Product` g) x))) Source #
is in practice a predicate about
CanDeriveApplicativeT
T f g x
T
only.
Intuitively, it says that the following holds, for any arbitrary
f
:
-
There is an instance of
Generic
(T f) -
T
has only one constructor (that is, it is not a sum-type). -
Every field of
T f x
is either a monoid, or of the formf a
, for some typea
.
Constraints
gbaddDictsDefault :: forall b c f. ( CanDeriveConstraintsB c b f, AllB c b) => b f -> b ( Dict c `Product` f) Source #
class GConstraints n c f repbx repbf repbdf where Source #
Instances
GConstraints n (c :: k1 -> Constraint ) (f :: k2) ( U1 :: Type -> Type ) ( U1 :: k3 -> Type ) ( U1 :: k3 -> Type ) Source # | |
GConstraints n (c :: k1 -> Constraint ) (f :: k2) ( V1 :: Type -> Type ) ( V1 :: k3 -> Type ) ( V1 :: k3 -> Type ) Source # | |
GConstraints n (c :: k1 -> Constraint ) (f :: k2) ( Rec a' a :: Type -> Type ) ( Rec b' b :: k3 -> Type ) ( Rec b' b :: k3 -> Type ) Source # | |
( GConstraints n c f lx lf ldf, GConstraints n c f rx rf rdf) => GConstraints n (c :: k1 -> Constraint ) (f :: k2) (lx :+: rx) (lf :+: rf :: k3 -> Type ) (ldf :+: rdf :: k3 -> Type ) Source # | |
( GConstraints n c f lx lf ldf, GConstraints n c f rx rf rdf) => GConstraints n (c :: k1 -> Constraint ) (f :: k2) (lx :*: rx) (lf :*: rf :: k3 -> Type ) (ldf :*: rdf :: k3 -> Type ) Source # | |
GConstraints n c f repbx repbf repbdf => GConstraints n (c :: k1 -> Constraint ) (f :: k2) ( M1 i k4 repbx) ( M1 i k4 repbf :: k3 -> Type ) ( M1 i k4 repbdf :: k3 -> Type ) Source # | |
type CanDeriveConstraintsB c b f = ( GenericN (b f), GenericN (b ( Dict c `Product` f)), AllB c b ~ GAll 0 c ( GAllRepB b), GConstraints 0 c f ( GAllRepB b) ( RepN (b f)) ( RepN (b ( Dict c `Product` f)))) Source #
is in practice a predicate about
CanDeriveConstraintsB
B f g
B
only.
Intuitively, it says that the following holds, for any arbitrary
f
:
-
There is an instance of
Generic
(B f) -
B f
can contain fields of typeb f
as long as there exists aConstraintsB
bB f
are allowed.
type CanDeriveConstraintsT c t f x = ( GenericN (t f x), GenericN (t ( Dict c `Product` f) x), AllT c t ~ GAll 1 c ( GAllRepT t), GConstraints 1 c f ( GAllRepT t) ( RepN (t f x)) ( RepN (t ( Dict c `Product` f) x))) Source #
is in practice a predicate about
CanDeriveConstraintsT
T f g x
T
only.
Intuitively, it says that the following holds, for any arbitrary
f
and
x
:
-
There is an instance of
Generic
(T f x) -
T f
can contain fields of typet f x
as long as there exists aConstraintsT
tT f x
are allowed.
type family GAll (n :: Nat ) (c :: k -> Constraint ) (repbf :: Type -> Type ) :: Constraint Source #
Instances
type GAll n (c :: k -> Constraint ) ( U1 :: Type -> Type ) Source # | |
Defined in Barbies.Generics.Constraints |
|
type GAll n (c :: k -> Constraint ) ( V1 :: Type -> Type ) Source # | |
Defined in Barbies.Generics.Constraints |
|
type GAll n (c :: k -> Constraint ) (l :+: r) Source # | |
Defined in Barbies.Generics.Constraints |
|
type GAll n (c :: k -> Constraint ) (l :*: r) Source # | |
Defined in Barbies.Generics.Constraints |
|
type GAll n (c :: k -> Constraint ) ( Rec l r :: Type -> Type ) Source # | |
Defined in Barbies.Generics.Constraints |
|
type GAll n (c :: k1 -> Constraint ) ( M1 i k2 repbf) Source # | |
Defined in Barbies.Generics.Constraints |
type GAllRepB b = TagSelf0 b Source #
The representation used for the generic computation of the
constraints.
AllB
c b
type GAllRepT t = TagSelf1 t Source #
The representation used for the generic computation of the
constraints. .
AllT
c t
type family SelfOrOther (b :: k) (b' :: k) :: Type -> Type -> Type -> Type where ... Source #
SelfOrOther b b = Self | |
SelfOrOther b b' = Other |
type TagSelf0 b = TagSelf0' ( Indexed b 1) ( RepN (b X )) Source #
We use the type-families to generically compute
.
Intuitively, if
AllB
c b
b' f'
occurs inside
b f
, then we should just add
to
AllB
b' c
. The problem is that if
AllB
b c
b
is a recursive type, and
b'
is
b
, then ghc will choke and blow the stack
(instead of computing a fixpoint).
So, we would like to behave differently when
b = b'
and add
()
instead
of
to break the recursion. Our trick will be to use a type
family to inspect
AllB
b c
, for an arbitrary
Rep
(b X)
X
, and distinguish
recursive usages from non-recursive ones, tagging them with different types,
so we can distinguish them in the instances.
type family TagSelf0' (b :: kf -> Type ) (repbf :: Type -> Type ) :: Type -> Type where ... Source #
TagSelf0' b ( M1 mt m s) = M1 mt m ( TagSelf0' b s) | |
TagSelf0' b (l :+: r) = TagSelf0' b l :+: TagSelf0' b r | |
TagSelf0' b (l :*: r) = TagSelf0' b l :*: TagSelf0' b r | |
TagSelf0' (b :: kf -> Type ) ( Rec ((b' :: kf -> Type ) f) ((b'' :: kf -> Type ) g)) = SelfOrOther b b' (b' f) (b'' g) | |
TagSelf0' b ( Rec x y) = Rec x y | |
TagSelf0' b U1 = U1 | |
TagSelf0' b V1 = V1 |
type TagSelf1 b = TagSelf1' ( Indexed b 2) ( Zip ( Rep ( Indexed (b X ) 1 Y )) ( Rep (b X Y ))) Source #
We use the type-families to generically compute
.
Intuitively, if
AllT
c b
t' f' x'
occurs inside
t f x
, then we should just add
to
AllT
t' c
. The problem is that if
AllT
t c
t
is a recursive type, and
t'
is
t
, then ghc will choke and blow the
stack (instead of computing a fixpoint).
So, we would like to behave differently when
t = t'
and add
()
instead
of
to break the recursion. Our trick will be to use a
type family to inspect
AllT
t c
, for arbitrary
Rep
(t X Y)
X
and
Y
and
distinguish recursive usages from non-recursive ones, tagging them with
different types, so we can distinguish them in the instances.
type family TagSelf1' (b :: kf -> kg -> Type ) (repbf :: Type -> Type ) :: Type -> Type where ... Source #
TagSelf1' b ( M1 mt m s) = M1 mt m ( TagSelf1' b s) | |
TagSelf1' b (l :+: r) = TagSelf1' b l :+: TagSelf1' b r | |
TagSelf1' b (l :*: r) = TagSelf1' b l :*: TagSelf1' b r | |
TagSelf1' (b :: kf -> kg -> Type ) ( Rec ((b' :: kf -> kg -> Type ) fl fr) ((b'' :: kf -> kg -> Type ) gl gr)) = SelfOrOther b b' (b' fl gr) (b'' gl gr) | |
TagSelf1' b ( Rec x y) = Rec x y | |
TagSelf1' b U1 = U1 | |
TagSelf1' b V1 = V1 |
Bare values
gbcoverDefault :: CanDeriveBareB b => b Bare Identity -> b Covered Identity Source #
gbstripDefault :: CanDeriveBareB b => b Covered Identity -> b Bare Identity Source #
class GBare (n :: Nat ) repbi repbb where Source #
Instances
GBare n ( U1 :: k -> Type ) ( U1 :: k -> Type ) Source # | |
GBare n ( V1 :: k -> Type ) ( V1 :: k -> Type ) Source # | |
repbi ~ repbb => GBare n ( Rec repbi repbi :: k -> Type ) ( Rec repbb repbb :: k -> Type ) Source # | |
( GBare n l l', GBare n r r') => GBare n (l :+: r :: k -> Type ) (l' :+: r' :: k -> Type ) Source # | |
( GBare n l l', GBare n r r') => GBare n (l :*: r :: k -> Type ) (l' :*: r' :: k -> Type ) Source # | |
GBare n repbi repbb => GBare n ( M1 i k2 repbi :: k1 -> Type ) ( M1 i k2 repbb :: k1 -> Type ) Source # | |
type CanDeriveBareB b = ( GenericP 0 (b Bare Identity ), GenericP 0 (b Covered Identity ), GBare 0 ( RepP 0 (b Covered Identity )) ( RepP 0 (b Bare Identity ))) Source #
Generic derivation support
type family FilterIndex (n :: Nat ) (t :: k) :: k where ... Source #
FilterIndex n (t ( Param n a)) = FilterIndex n t ( Param n a) | |
FilterIndex n (t ( Param _ a)) = FilterIndex n t a | |
FilterIndex _ t = t |
newtype Rec (p :: Type ) a x Source #
Instances
GTraversable (n :: k1) (f :: k2 -> Type ) (g :: k2 -> Type ) ( Rec a a :: k3 -> Type ) ( Rec a a :: k3 -> Type ) Source # | |
Defined in Barbies.Generics.Traversable |
|
GConstraints n (c :: k1 -> Constraint ) (f :: k2) ( Rec a' a :: Type -> Type ) ( Rec b' b :: k3 -> Type ) ( Rec b' b :: k3 -> Type ) Source # | |
Monoid x => GApplicative (n :: k1) (f :: k2 -> Type ) (g :: k2 -> Type ) ( Rec x x :: k3 -> Type ) ( Rec x x :: k3 -> Type ) ( Rec x x :: k3 -> Type ) Source # | |
Defined in Barbies.Generics.Applicative |
|
GFunctor n (f :: k1 -> Type ) (g :: k1 -> Type ) ( Rec x x :: k2 -> Type ) ( Rec x x :: k2 -> Type ) Source # | |
repbi ~ repbb => GBare n ( Rec repbi repbi :: k -> Type ) ( Rec repbb repbb :: k -> Type ) Source # | |
type GAll n (c :: k -> Constraint ) ( Rec l r :: Type -> Type ) Source # | |
Defined in Barbies.Generics.Constraints |
class ( Coercible ( Rep a) ( RepP n a), Generic a) => GenericP (n :: Nat ) (a :: Type ) where Source #
module GHC.Generics