kind-generics-0.5.0.0: Generic programming in GHC style for arbitrary kinds and GADTs.
Safe HaskellNone
LanguageHaskell2010

Generics.Kind

Description

Main module of kind-generics. Please refer to the README file for documentation on how to use this package.

Synopsis

Generic representation types

data ((f :: k -> Type) :+: (g :: k -> Type)) (p :: k) infixr 5 #

Sums: encode choice between constructors

Constructors

L1 (f p) 
R1 (g p) 

Instances

Instances details
(SubstRep' f x xs, SubstRep' g x xs) => SubstRep' (f :+: g :: LoT (t -> k) -> Type) (x :: t) (xs :: LoT k) Source # 
Instance details

Defined in Generics.Kind

Associated Types

type SubstRep (f :+: g :: LoT (t -> k) -> Type) (x :: t) 
Instance details

Defined in Generics.Kind

type SubstRep (f :+: g :: LoT (t -> k) -> Type) (x :: t) = SubstRep f x :+: SubstRep g x

Methods

substRep :: (f :+: g) (x ':&&: xs) -> SubstRep (f :+: g) x xs

unsubstRep :: SubstRep (f :+: g) x xs -> (f :+: g) (x ':&&: xs)

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

Defined in GHC.Generics

Associated Types

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

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

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

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

(Conv f f' tys, Conv g g' tys) => Conv (f :+: g) (f' :+: g' :: LoT d -> Type) (tys :: LoT d) Source # 
Instance details

Defined in Generics.Kind

Methods

toGhcGenerics :: (f' :+: g') tys -> (f :+: g) a Source #

toKindGenerics :: (f :+: g) a -> (f' :+: g') tys Source #

(Foldable f, Foldable g) => Foldable (f :+: g)

Since: base-4.9.0.0

Instance details

Defined in Data.Foldable

Methods

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] #

null :: (f :+: g) a -> Bool #

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 #

sum :: Num a => (f :+: g) a -> a #

product :: Num a => (f :+: g) a -> a #

(Foldable1 f, Foldable1 g) => Foldable1 (f :+: g)

Since: base-4.18.0.0

Instance details

Defined in Data.Foldable1

Methods

fold1 :: Semigroup m => (f :+: g) m -> m #

foldMap1 :: Semigroup m => (a -> m) -> (f :+: g) a -> m #

foldMap1' :: Semigroup m => (a -> m) -> (f :+: g) a -> m #

toNonEmpty :: (f :+: g) a -> NonEmpty a #

maximum :: Ord a => (f :+: g) a -> a #

minimum :: Ord a => (f :+: g) a -> a #

head :: (f :+: g) a -> a #

last :: (f :+: g) a -> a #

foldrMap1 :: (a -> b) -> (a -> b -> b) -> (f :+: g) a -> b #

foldlMap1' :: (a -> b) -> (b -> a -> b) -> (f :+: g) a -> b #

foldlMap1 :: (a -> b) -> (b -> a -> b) -> (f :+: g) a -> b #

foldrMap1' :: (a -> b) -> (a -> b -> b) -> (f :+: g) a -> b #

(Contravariant f, Contravariant g) => Contravariant (f :+: g) 
Instance details

Defined in Data.Functor.Contravariant

Methods

contramap :: (a' -> a) -> (f :+: g) a -> (f :+: g) a' #

(>$) :: b -> (f :+: g) b -> (f :+: g) a #

(Traversable f, Traversable g) => Traversable (f :+: g)

Since: base-4.9.0.0

Instance details

Defined in Data.Traversable

Methods

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

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

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

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

(Functor f, Functor g) => Functor (f :+: g)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

fmap :: (a -> b) -> (f :+: g) a -> (f :+: g) b #

(<$) :: a -> (f :+: g) b -> (f :+: g) a #

(Typeable f, Typeable g, Data p, Data (f p), Data (g p)) => Data ((f :+: g) p)

Since: base-4.9.0.0

Instance details

Defined in Data.Data

Methods

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) 
Instance details

Defined in GHC.Generics

Associated Types

type Rep ((f :+: g) p)

Since: base-4.7.0.0

Instance details

Defined in GHC.Generics

Methods

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

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

(Read (f p), Read (g p)) => Read ((f :+: g) p)

Since: base-4.7.0.0

Instance details

Defined in GHC.Generics

Methods

readsPrec :: Int -> ReadS ((f :+: g) p) #

readList :: ReadS [(f :+: g) p] #

readPrec :: ReadPrec ((f :+: g) p) #

readListPrec :: ReadPrec [(f :+: g) p] #

(Show (f p), Show (g p)) => Show ((f :+: g) p)

Since: base-4.7.0.0

Instance details

Defined in GHC.Generics

Methods

showsPrec :: Int -> (f :+: g) p -> ShowS #

show :: (f :+: g) p -> String #

showList :: [(f :+: g) p] -> ShowS #

(Eq (f p), Eq (g p)) => Eq ((f :+: g) p)

Since: base-4.7.0.0

Instance details

Defined in GHC.Generics

Methods

(==) :: (f :+: g) p -> (f :+: g) p -> Bool #

(/=) :: (f :+: g) p -> (f :+: g) p -> Bool #

(Ord (f p), Ord (g p)) => Ord ((f :+: g) p)

Since: base-4.7.0.0

Instance details

Defined in GHC.Generics

Methods

compare :: (f :+: g) p -> (f :+: g) p -> Ordering #

(<) :: (f :+: g) p -> (f :+: g) p -> Bool #

(<=) :: (f :+: g) p -> (f :+: g) p -> Bool #

(>) :: (f :+: g) p -> (f :+: g) p -> Bool #

(>=) :: (f :+: g) p -> (f :+: g) p -> Bool #

max :: (f :+: g) p -> (f :+: g) p -> (f :+: g) p #

min :: (f :+: g) p -> (f :+: g) p -> (f :+: g) p #

type SubstRep (f :+: g :: LoT (t -> k) -> Type) (x :: t) Source # 
Instance details

Defined in Generics.Kind

type SubstRep (f :+: g :: LoT (t -> k) -> Type) (x :: t) = SubstRep f x :+: SubstRep g x
type Rep1 (f :+: g :: k -> Type)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

type Rep ((f :+: g) p)

Since: base-4.7.0.0

Instance details

Defined in GHC.Generics

data ((f :: k -> Type) :*: (g :: k -> Type)) (p :: k) infixr 6 #

Products: encode multiple arguments to constructors

Constructors

(f p) :*: (g p) infixr 6 

Instances

Instances details
(SubstRep' f x xs, SubstRep' g x xs) => SubstRep' (f :*: g :: LoT (t -> k) -> Type) (x :: t) (xs :: LoT k) Source # 
Instance details

Defined in Generics.Kind

Associated Types

type SubstRep (f :*: g :: LoT (t -> k) -> Type) (x :: t) 
Instance details

Defined in Generics.Kind

type SubstRep (f :*: g :: LoT (t -> k) -> Type) (x :: t) = SubstRep f x :*: SubstRep g x

Methods

substRep :: (f :*: g) (x ':&&: xs) -> SubstRep (f :*: g) x xs

unsubstRep :: SubstRep (f :*: g) x xs -> (f :*: g) (x ':&&: xs)

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

Defined in GHC.Generics

Associated Types

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

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

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

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

(Conv f f' tys, Conv g g' tys) => Conv (f :*: g) (f' :*: g' :: LoT d -> Type) (tys :: LoT d) Source # 
Instance details

Defined in Generics.Kind

Methods

toGhcGenerics :: (f' :*: g') tys -> (f :*: g) a Source #

toKindGenerics :: (f :*: g) a -> (f' :*: g') tys Source #

(MonadFix f, MonadFix g) => MonadFix (f :*: g)

Since: base-4.9.0.0

Instance details

Defined in Control.Monad.Fix

Methods

mfix :: (a -> (f :*: g) a) -> (f :*: g) a #

(MonadZip f, MonadZip g) => MonadZip (f :*: g)

Since: base-4.9.0.0

Instance details

Defined in Control.Monad.Zip

Methods

mzip :: (f :*: g) a -> (f :*: g) b -> (f :*: g) (a, b) #

mzipWith :: (a -> b -> c) -> (f :*: g) a -> (f :*: g) b -> (f :*: g) c #

munzip :: (f :*: g) (a, b) -> ((f :*: g) a, (f :*: g) b) #

(Foldable f, Foldable g) => Foldable (f :*: g)

Since: base-4.9.0.0

Instance details

Defined in Data.Foldable

Methods

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] #

null :: (f :*: g) a -> Bool #

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 #

sum :: Num a => (f :*: g) a -> a #

product :: Num a => (f :*: g) a -> a #

(Foldable1 f, Foldable1 g) => Foldable1 (f :*: g)

Since: base-4.18.0.0

Instance details

Defined in Data.Foldable1

Methods

fold1 :: Semigroup m => (f :*: g) m -> m #

foldMap1 :: Semigroup m => (a -> m) -> (f :*: g) a -> m #

foldMap1' :: Semigroup m => (a -> m) -> (f :*: g) a -> m #

toNonEmpty :: (f :*: g) a -> NonEmpty a #

maximum :: Ord a => (f :*: g) a -> a #

minimum :: Ord a => (f :*: g) a -> a #

head :: (f :*: g) a -> a #

last :: (f :*: g) a -> a #

foldrMap1 :: (a -> b) -> (a -> b -> b) -> (f :*: g) a -> b #

foldlMap1' :: (a -> b) -> (b -> a -> b) -> (f :*: g) a -> b #

foldlMap1 :: (a -> b) -> (b -> a -> b) -> (f :*: g) a -> b #

foldrMap1' :: (a -> b) -> (a -> b -> b) -> (f :*: g) a -> b #

(Contravariant f, Contravariant g) => Contravariant (f :*: g) 
Instance details

Defined in Data.Functor.Contravariant

Methods

contramap :: (a' -> a) -> (f :*: g) a -> (f :*: g) a' #

(>$) :: b -> (f :*: g) b -> (f :*: g) a #

(Traversable f, Traversable g) => Traversable (f :*: g)

Since: base-4.9.0.0

Instance details

Defined in Data.Traversable

Methods

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

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

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

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

(Alternative f, Alternative g) => Alternative (f :*: g)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

empty :: (f :*: g) a #

(<|>) :: (f :*: g) a -> (f :*: g) a -> (f :*: g) a #

some :: (f :*: g) a -> (f :*: g) [a] #

many :: (f :*: g) a -> (f :*: g) [a] #

(Applicative f, Applicative g) => Applicative (f :*: g)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

pure :: a -> (f :*: g) a #

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

liftA2 :: (a -> b -> c) -> (f :*: g) a -> (f :*: g) b -> (f :*: g) c #

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

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

(Functor f, Functor g) => Functor (f :*: g)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

fmap :: (a -> b) -> (f :*: g) a -> (f :*: g) b #

(<$) :: a -> (f :*: g) b -> (f :*: g) a #

(Monad f, Monad g) => Monad (f :*: g)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

(>>=) :: (f :*: g) a -> (a -> (f :*: g) b) -> (f :*: g) b #

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

return :: a -> (f :*: g) a #

(MonadPlus f, MonadPlus g) => MonadPlus (f :*: g)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

mzero :: (f :*: g) a #

mplus :: (f :*: g) a -> (f :*: g) a -> (f :*: g) a #

(Typeable f, Typeable g, Data p, Data (f p), Data (g p)) => Data ((f :*: g) p)

Since: base-4.9.0.0

Instance details

Defined in Data.Data

Methods

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

Instance details

Defined in GHC.Generics

Methods

mempty :: (f :*: g) p #

mappend :: (f :*: g) p -> (f :*: g) p -> (f :*: g) p #

mconcat :: [(f :*: g) p] -> (f :*: g) p #

(Semigroup (f p), Semigroup (g p)) => Semigroup ((f :*: g) p)

Since: base-4.12.0.0

Instance details

Defined in GHC.Generics

Methods

(<>) :: (f :*: g) p -> (f :*: g) p -> (f :*: g) p #

sconcat :: NonEmpty ((f :*: g) p) -> (f :*: g) p #

stimes :: Integral b => b -> (f :*: g) p -> (f :*: g) p #

Generic ((f :*: g) p) 
Instance details

Defined in GHC.Generics

Associated Types

type Rep ((f :*: g) p)

Since: base-4.7.0.0

Instance details

Defined in GHC.Generics

Methods

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

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

(Read (f p), Read (g p)) => Read ((f :*: g) p)

Since: base-4.7.0.0

Instance details

Defined in GHC.Generics

Methods

readsPrec :: Int -> ReadS ((f :*: g) p) #

readList :: ReadS [(f :*: g) p] #

readPrec :: ReadPrec ((f :*: g) p) #

readListPrec :: ReadPrec [(f :*: g) p] #

(Show (f p), Show (g p)) => Show ((f :*: g) p)

Since: base-4.7.0.0

Instance details

Defined in GHC.Generics

Methods

showsPrec :: Int -> (f :*: g) p -> ShowS #

show :: (f :*: g) p -> String #

showList :: [(f :*: g) p] -> ShowS #

(Eq (f p), Eq (g p)) => Eq ((f :*: g) p)

Since: base-4.7.0.0

Instance details

Defined in GHC.Generics

Methods

(==) :: (f :*: g) p -> (f :*: g) p -> Bool #

(/=) :: (f :*: g) p -> (f :*: g) p -> Bool #

(Ord (f p), Ord (g p)) => Ord ((f :*: g) p)

Since: base-4.7.0.0

Instance details

Defined in GHC.Generics

Methods

compare :: (f :*: g) p -> (f :*: g) p -> Ordering #

(<) :: (f :*: g) p -> (f :*: g) p -> Bool #

(<=) :: (f :*: g) p -> (f :*: g) p -> Bool #

(>) :: (f :*: g) p -> (f :*: g) p -> Bool #

(>=) :: (f :*: g) p -> (f :*: g) p -> Bool #

max :: (f :*: g) p -> (f :*: g) p -> (f :*: g) p #

min :: (f :*: g) p -> (f :*: g) p -> (f :*: g) p #

type SubstRep (f :*: g :: LoT (t -> k) -> Type) (x :: t) Source # 
Instance details

Defined in Generics.Kind

type SubstRep (f :*: g :: LoT (t -> k) -> Type) (x :: t) = SubstRep f x :*: SubstRep g x
type Rep1 (f :*: g :: k -> Type)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

type Rep ((f :*: g) p)

Since: base-4.7.0.0

Instance details

Defined in GHC.Generics

data V1 (p :: k) #

Void: used for datatypes without constructors

Instances

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

Defined in GHC.Generics

Associated Types

type Rep1 (V1 :: k -> Type)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

type Rep1 (V1 :: k -> Type) = D1 ('MetaData "V1" "GHC.Generics" "base" 'False) (V1 :: k -> Type)

Methods

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

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

Foldable (V1 :: Type -> Type)

Since: base-4.9.0.0

Instance details

Defined in Data.Foldable

Methods

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 #

toList :: V1 a -> [a] #

null :: V1 a -> Bool #

length :: V1 a -> Int #

elem :: Eq a => a -> V1 a -> Bool #

maximum :: Ord a => V1 a -> a #

minimum :: Ord a => V1 a -> a #

sum :: Num a => V1 a -> a #

product :: Num a => V1 a -> a #

Foldable1 (V1 :: Type -> Type)

Since: base-4.18.0.0

Instance details

Defined in Data.Foldable1

Methods

fold1 :: Semigroup m => V1 m -> m #

foldMap1 :: Semigroup m => (a -> m) -> V1 a -> m #

foldMap1' :: Semigroup m => (a -> m) -> V1 a -> m #

toNonEmpty :: V1 a -> NonEmpty a #

maximum :: Ord a => V1 a -> a #

minimum :: Ord a => V1 a -> a #

head :: V1 a -> a #

last :: V1 a -> a #

foldrMap1 :: (a -> b) -> (a -> b -> b) -> V1 a -> b #

foldlMap1' :: (a -> b) -> (b -> a -> b) -> V1 a -> b #

foldlMap1 :: (a -> b) -> (b -> a -> b) -> V1 a -> b #

foldrMap1' :: (a -> b) -> (a -> b -> b) -> V1 a -> b #

Contravariant (V1 :: Type -> Type) 
Instance details

Defined in Data.Functor.Contravariant

Methods

contramap :: (a' -> a) -> V1 a -> V1 a' #

(>$) :: b -> V1 b -> V1 a #

Traversable (V1 :: Type -> Type)

Since: base-4.9.0.0

Instance details

Defined in Data.Traversable

Methods

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

sequenceA :: Applicative f => V1 (f a) -> f (V1 a) #

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

sequence :: Monad m => V1 (m a) -> m (V1 a) #

Functor (V1 :: Type -> Type)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

fmap :: (a -> b) -> V1 a -> V1 b #

(<$) :: a -> V1 b -> V1 a #

Data p => Data (V1 p)

Since: base-4.9.0.0

Instance details

Defined in Data.Data

Methods

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) #

toConstr :: V1 p -> Constr #

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

Instance details

Defined in GHC.Generics

Methods

(<>) :: V1 p -> V1 p -> V1 p #

sconcat :: NonEmpty (V1 p) -> V1 p #

stimes :: Integral b => b -> V1 p -> V1 p #

Generic (V1 p) 
Instance details

Defined in GHC.Generics

Associated Types

type Rep (V1 p)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

type Rep (V1 p) = D1 ('MetaData "V1" "GHC.Generics" "base" 'False) (V1 :: Type -> Type)

Methods

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

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

Read (V1 p)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Show (V1 p)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

showsPrec :: Int -> V1 p -> ShowS #

show :: V1 p -> String #

showList :: [V1 p] -> ShowS #

Eq (V1 p)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

(==) :: V1 p -> V1 p -> Bool #

(/=) :: V1 p -> V1 p -> Bool #

Ord (V1 p)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

compare :: V1 p -> V1 p -> Ordering #

(<) :: V1 p -> V1 p -> Bool #

(<=) :: V1 p -> V1 p -> Bool #

(>) :: V1 p -> V1 p -> Bool #

(>=) :: V1 p -> V1 p -> Bool #

max :: V1 p -> V1 p -> V1 p #

min :: V1 p -> V1 p -> V1 p #

type Rep1 (V1 :: k -> Type)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

type Rep1 (V1 :: k -> Type) = D1 ('MetaData "V1" "GHC.Generics" "base" 'False) (V1 :: k -> Type)
type Rep (V1 p)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

type Rep (V1 p) = D1 ('MetaData "V1" "GHC.Generics" "base" 'False) (V1 :: Type -> Type)

data U1 (p :: k) #

Unit: used for constructors without arguments

Constructors

U1 

Instances

Instances details
SubstRep' (U1 :: LoT (t -> k) -> Type) (x :: t) (xs :: LoT k) Source # 
Instance details

Defined in Generics.Kind

Associated Types

type SubstRep (U1 :: LoT (t -> k) -> Type) (x :: t) 
Instance details

Defined in Generics.Kind

type SubstRep (U1 :: LoT (t -> k) -> Type) (x :: t) = U1 :: LoT k -> Type

Methods

substRep :: U1 (x ':&&: xs) -> SubstRep (U1 :: LoT (t -> k) -> Type) x xs

unsubstRep :: SubstRep (U1 :: LoT (t -> k) -> Type) x xs -> U1 (x ':&&: xs)

Generic1 (U1 :: k -> Type) 
Instance details

Defined in GHC.Generics

Associated Types

type Rep1 (U1 :: k -> Type)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

type Rep1 (U1 :: k -> Type) = D1 ('MetaData "U1" "GHC.Generics" "base" 'False) (C1 ('MetaCons "U1" 'PrefixI 'False) (U1 :: k -> Type))

Methods

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

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

Conv (U1 :: Type -> Type) (U1 :: LoT d -> Type) (tys :: LoT d) Source # 
Instance details

Defined in Generics.Kind

Methods

toGhcGenerics :: U1 tys -> U1 a Source #

toKindGenerics :: U1 a -> U1 tys Source #

MonadZip (U1 :: Type -> Type)

Since: base-4.9.0.0

Instance details

Defined in Control.Monad.Zip

Methods

mzip :: U1 a -> U1 b -> U1 (a, b) #

mzipWith :: (a -> b -> c) -> U1 a -> U1 b -> U1 c #

munzip :: U1 (a, b) -> (U1 a, U1 b) #

Foldable (U1 :: Type -> Type)

Since: base-4.9.0.0

Instance details

Defined in Data.Foldable

Methods

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 #

toList :: U1 a -> [a] #

null :: U1 a -> Bool #

length :: U1 a -> Int #

elem :: Eq a => a -> U1 a -> Bool #

maximum :: Ord a => U1 a -> a #

minimum :: Ord a => U1 a -> a #

sum :: Num a => U1 a -> a #

product :: Num a => U1 a -> a #

Contravariant (U1 :: Type -> Type) 
Instance details

Defined in Data.Functor.Contravariant

Methods

contramap :: (a' -> a) -> U1 a -> U1 a' #

(>$) :: b -> U1 b -> U1 a #

Traversable (U1 :: Type -> Type)

Since: base-4.9.0.0

Instance details

Defined in Data.Traversable

Methods

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

sequenceA :: Applicative f => U1 (f a) -> f (U1 a) #

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

sequence :: Monad m => U1 (m a) -> m (U1 a) #

Alternative (U1 :: Type -> Type)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

empty :: U1 a #

(<|>) :: U1 a -> U1 a -> U1 a #

some :: U1 a -> U1 [a] #

many :: U1 a -> U1 [a] #

Applicative (U1 :: Type -> Type)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

pure :: a -> U1 a #

(<*>) :: U1 (a -> b) -> U1 a -> U1 b #

liftA2 :: (a -> b -> c) -> U1 a -> U1 b -> U1 c #

(*>) :: U1 a -> U1 b -> U1 b #

(<*) :: U1 a -> U1 b -> U1 a #

Functor (U1 :: Type -> Type)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

fmap :: (a -> b) -> U1 a -> U1 b #

(<$) :: a -> U1 b -> U1 a #

Monad (U1 :: Type -> Type)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

(>>=) :: U1 a -> (a -> U1 b) -> U1 b #

(>>) :: U1 a -> U1 b -> U1 b #

return :: a -> U1 a #

MonadPlus (U1 :: Type -> Type)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

mzero :: U1 a #

mplus :: U1 a -> U1 a -> U1 a #

Data p => Data (U1 p)

Since: base-4.9.0.0

Instance details

Defined in Data.Data

Methods

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) #

toConstr :: U1 p -> Constr #

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

Instance details

Defined in GHC.Generics

Methods

mempty :: U1 p #

mappend :: U1 p -> U1 p -> U1 p #

mconcat :: [U1 p] -> U1 p #

Semigroup (U1 p)

Since: base-4.12.0.0

Instance details

Defined in GHC.Generics

Methods

(<>) :: U1 p -> U1 p -> U1 p #

sconcat :: NonEmpty (U1 p) -> U1 p #

stimes :: Integral b => b -> U1 p -> U1 p #

Generic (U1 p) 
Instance details

Defined in GHC.Generics

Associated Types

type Rep (U1 p)

Since: base-4.7.0.0

Instance details

Defined in GHC.Generics

type Rep (U1 p) = D1 ('MetaData "U1" "GHC.Generics" "base" 'False) (C1 ('MetaCons "U1" 'PrefixI 'False) (U1 :: Type -> Type))

Methods

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

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

Read (U1 p)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Show (U1 p)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

showsPrec :: Int -> U1 p -> ShowS #

show :: U1 p -> String #

showList :: [U1 p] -> ShowS #

Eq (U1 p)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

(==) :: U1 p -> U1 p -> Bool #

(/=) :: U1 p -> U1 p -> Bool #

Ord (U1 p)

Since: base-4.7.0.0

Instance details

Defined in GHC.Generics

Methods

compare :: U1 p -> U1 p -> Ordering #

(<) :: U1 p -> U1 p -> Bool #

(<=) :: U1 p -> U1 p -> Bool #

(>) :: U1 p -> U1 p -> Bool #

(>=) :: U1 p -> U1 p -> Bool #

max :: U1 p -> U1 p -> U1 p #

min :: U1 p -> U1 p -> U1 p #

type SubstRep (U1 :: LoT (t -> k) -> Type) (x :: t) Source # 
Instance details

Defined in Generics.Kind

type SubstRep (U1 :: LoT (t -> k) -> Type) (x :: t) = U1 :: LoT k -> Type
type Rep1 (U1 :: k -> Type)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

type Rep1 (U1 :: k -> Type) = D1 ('MetaData "U1" "GHC.Generics" "base" 'False) (C1 ('MetaCons "U1" 'PrefixI 'False) (U1 :: k -> Type))
type Rep (U1 p)

Since: base-4.7.0.0

Instance details

Defined in GHC.Generics

type Rep (U1 p) = D1 ('MetaData "U1" "GHC.Generics" "base" 'False) (C1 ('MetaCons "U1" 'PrefixI 'False) (U1 :: Type -> Type))

newtype M1 i (c :: Meta) (f :: k -> Type) (p :: k) #

Meta-information (constructor names, etc.)

Constructors

M1 

Fields

Instances

Instances details
SubstRep' f x xs => SubstRep' (M1 i c f :: LoT (t -> k) -> Type) (x :: t) (xs :: LoT k) Source # 
Instance details

Defined in Generics.Kind

Associated Types

type SubstRep (M1 i c f :: LoT (t -> k) -> Type) (x :: t) 
Instance details

Defined in Generics.Kind

type SubstRep (M1 i c f :: LoT (t -> k) -> Type) (x :: t) = M1 i c (SubstRep f x)

Methods

substRep :: M1 i c f (x ':&&: xs) -> SubstRep (M1 i c f) x xs

unsubstRep :: SubstRep (M1 i c f) x xs -> M1 i c f (x ':&&: xs)

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

Defined in GHC.Generics

Associated Types

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

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

type Rep1 (M1 i c f :: k -> Type) = D1 ('MetaData "M1" "GHC.Generics" "base" 'True) (C1 ('MetaCons "M1" 'PrefixI 'True) (S1 ('MetaSel ('Just "unM1") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec1 f)))

Methods

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

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

Conv f f' tys => Conv (M1 i c f) (f' :: LoT d -> Type) (tys :: LoT d) Source # 
Instance details

Defined in Generics.Kind

Methods

toGhcGenerics :: f' tys -> M1 i c f a Source #

toKindGenerics :: M1 i c f a -> f' tys Source #

Conv f f' tys => Conv (M1 i c f) (M1 i c f' :: LoT d -> Type) (tys :: LoT d) Source # 
Instance details

Defined in Generics.Kind

Methods

toGhcGenerics :: M1 i c f' tys -> M1 i c f a Source #

toKindGenerics :: M1 i c f a -> M1 i c f' tys Source #

MonadFix f => MonadFix (M1 i c f)

Since: base-4.9.0.0

Instance details

Defined in Control.Monad.Fix

Methods

mfix :: (a -> M1 i c f a) -> M1 i c f a #

MonadZip f => MonadZip (M1 i c f)

Since: base-4.9.0.0

Instance details

Defined in Control.Monad.Zip

Methods

mzip :: M1 i c f a -> M1 i c f b -> M1 i c f (a, b) #

mzipWith :: (a -> b -> c0) -> M1 i c f a -> M1 i c f b -> M1 i c f c0 #

munzip :: M1 i c f (a, b) -> (M1 i c f a, M1 i c f b) #

Foldable f => Foldable (M1 i c f)

Since: base-4.9.0.0

Instance details

Defined in Data.Foldable

Methods

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 #

toList :: M1 i c f a -> [a] #

null :: M1 i c f a -> Bool #

length :: M1 i c f a -> Int #

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 #

sum :: Num a => M1 i c f a -> a #

product :: Num a => M1 i c f a -> a #

Foldable1 f => Foldable1 (M1 i c f)

Since: base-4.18.0.0

Instance details

Defined in Data.Foldable1

Methods

fold1 :: Semigroup m => M1 i c f m -> m #

foldMap1 :: Semigroup m => (a -> m) -> M1 i c f a -> m #

foldMap1' :: Semigroup m => (a -> m) -> M1 i c f a -> m #

toNonEmpty :: M1 i c f a -> NonEmpty a #

maximum :: Ord a => M1 i c f a -> a #

minimum :: Ord a => M1 i c f a -> a #

head :: M1 i c f a -> a #

last :: M1 i c f a -> a #

foldrMap1 :: (a -> b) -> (a -> b -> b) -> M1 i c f a -> b #

foldlMap1' :: (a -> b) -> (b -> a -> b) -> M1 i c f a -> b #

foldlMap1 :: (a -> b) -> (b -> a -> b) -> M1 i c f a -> b #

foldrMap1' :: (a -> b) -> (a -> b -> b) -> M1 i c f a -> b #

Contravariant f => Contravariant (M1 i c f) 
Instance details

Defined in Data.Functor.Contravariant

Methods

contramap :: (a' -> a) -> M1 i c f a -> M1 i c f a' #

(>$) :: b -> M1 i c f b -> M1 i c f a #

Traversable f => Traversable (M1 i c f)

Since: base-4.9.0.0

Instance details

Defined in Data.Traversable

Methods

traverse :: Applicative f0 => (a -> f0 b) -> M1 i c f a -> f0 (M1 i c f b) #

sequenceA :: Applicative f0 => M1 i c f (f0 a) -> f0 (M1 i c f a) #

mapM :: Monad m => (a -> m b) -> M1 i c f a -> m (M1 i c f b) #

sequence :: Monad m => M1 i c f (m a) -> m (M1 i c f a) #

Alternative f => Alternative (M1 i c f)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

empty :: M1 i c f a #

(<|>) :: M1 i c f a -> M1 i c f a -> M1 i c f a #

some :: M1 i c f a -> M1 i c f [a] #

many :: M1 i c f a -> M1 i c f [a] #

Applicative f => Applicative (M1 i c f)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

pure :: a -> M1 i c f a #

(<*>) :: M1 i c f (a -> b) -> M1 i c f a -> M1 i c f b #

liftA2 :: (a -> b -> c0) -> M1 i c f a -> M1 i c f b -> M1 i c f c0 #

(*>) :: M1 i c f a -> M1 i c f b -> M1 i c f b #

(<*) :: M1 i c f a -> M1 i c f b -> M1 i c f a #

Functor f => Functor (M1 i c f)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

fmap :: (a -> b) -> M1 i c f a -> M1 i c f b #

(<$) :: a -> M1 i c f b -> M1 i c f a #

Monad f => Monad (M1 i c f)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

(>>=) :: M1 i c f a -> (a -> M1 i c f b) -> M1 i c f b #

(>>) :: M1 i c f a -> M1 i c f b -> M1 i c f b #

return :: a -> M1 i c f a #

MonadPlus f => MonadPlus (M1 i c f)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

mzero :: M1 i c f a #

mplus :: M1 i c f a -> M1 i c f a -> M1 i c f a #

(Data p, Data (f p), Typeable c, Typeable i, Typeable f) => Data (M1 i c f p)

Since: base-4.9.0.0

Instance details

Defined in Data.Data

Methods

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

Instance details

Defined in GHC.Generics

Methods

mempty :: M1 i c f p #

mappend :: M1 i c f p -> M1 i c f p -> M1 i c f p #

mconcat :: [M1 i c f p] -> M1 i c f p #

Semigroup (f p) => Semigroup (M1 i c f p)

Since: base-4.12.0.0

Instance details

Defined in GHC.Generics

Methods

(<>) :: M1 i c f p -> M1 i c f p -> M1 i c f p #

sconcat :: NonEmpty (M1 i c f p) -> M1 i c f p #

stimes :: Integral b => b -> M1 i c f p -> M1 i c f p #

Generic (M1 i c f p) 
Instance details

Defined in GHC.Generics

Associated Types

type Rep (M1 i c f p)

Since: base-4.7.0.0

Instance details

Defined in GHC.Generics

type Rep (M1 i c f p) = D1 ('MetaData "M1" "GHC.Generics" "base" 'True) (C1 ('MetaCons "M1" 'PrefixI 'True) (S1 ('MetaSel ('Just "unM1") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (f p))))

Methods

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

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

Read (f p) => Read (M1 i c f p)

Since: base-4.7.0.0

Instance details

Defined in GHC.Generics

Methods

readsPrec :: Int -> ReadS (M1 i c f p) #

readList :: ReadS [M1 i c f p] #

readPrec :: ReadPrec (M1 i c f p) #

readListPrec :: ReadPrec [M1 i c f p] #

Show (f p) => Show (M1 i c f p)

Since: base-4.7.0.0

Instance details

Defined in GHC.Generics

Methods

showsPrec :: Int -> M1 i c f p -> ShowS #

show :: M1 i c f p -> String #

showList :: [M1 i c f p] -> ShowS #

Eq (f p) => Eq (M1 i c f p)

Since: base-4.7.0.0

Instance details

Defined in GHC.Generics

Methods

(==) :: M1 i c f p -> M1 i c f p -> Bool #

(/=) :: M1 i c f p -> M1 i c f p -> Bool #

Ord (f p) => Ord (M1 i c f p)

Since: base-4.7.0.0

Instance details

Defined in GHC.Generics

Methods

compare :: M1 i c f p -> M1 i c f p -> Ordering #

(<) :: M1 i c f p -> M1 i c f p -> Bool #

(<=) :: M1 i c f p -> M1 i c f p -> Bool #

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

(>=) :: M1 i c f p -> M1 i c f p -> Bool #

max :: M1 i c f p -> M1 i c f p -> M1 i c f p #

min :: M1 i c f p -> M1 i c f p -> M1 i c f p #

type SubstRep (M1 i c f :: LoT (t -> k) -> Type) (x :: t) Source # 
Instance details

Defined in Generics.Kind

type SubstRep (M1 i c f :: LoT (t -> k) -> Type) (x :: t) = M1 i c (SubstRep f x)
type Rep1 (M1 i c f :: k -> Type)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

type Rep1 (M1 i c f :: k -> Type) = D1 ('MetaData "M1" "GHC.Generics" "base" 'True) (C1 ('MetaCons "M1" 'PrefixI 'True) (S1 ('MetaSel ('Just "unM1") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec1 f)))
type Rep (M1 i c f p)

Since: base-4.7.0.0

Instance details

Defined in GHC.Generics

type Rep (M1 i c f p) = D1 ('MetaData "M1" "GHC.Generics" "base" 'True) (C1 ('MetaCons "M1" 'PrefixI 'True) (S1 ('MetaSel ('Just "unM1") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (f p))))

newtype Field (t :: Atom d Type) (x :: LoT d) where Source #

Fields: used to represent each of the (visible) arguments to a constructor. Replaces the K1 type from Generics. The type of the field is represented by an Atom from Atom.

instance GenericK [] (a :&&: LoT0) where
  type RepK [] = Field Var0 :*: Field ([] :$: Var0)

Constructors

Field 

Fields

Instances

Instances details
Interpret (SubstAtom t2 x) xs ~ Interpret t2 (x ':&&: xs) => SubstRep' (Field t2 :: LoT (t1 -> k) -> Type) (x :: t1) (xs :: LoT k) Source # 
Instance details

Defined in Generics.Kind

Associated Types

type SubstRep (Field t2 :: LoT (t1 -> k) -> Type) (x :: t1) 
Instance details

Defined in Generics.Kind

type SubstRep (Field t2 :: LoT (t1 -> k) -> Type) (x :: t1) = Field (SubstAtom t2 x)

Methods

substRep :: Field t2 (x ':&&: xs) -> SubstRep (Field t2) x xs

unsubstRep :: SubstRep (Field t2) x xs -> Field t2 (x ':&&: xs)

k ~ Interpret t tys => Conv (K1 p k :: Type -> Type) (Field t :: LoT d -> Type) (tys :: LoT d) Source # 
Instance details

Defined in Generics.Kind

Methods

toGhcGenerics :: Field t tys -> K1 p k a Source #

toKindGenerics :: K1 p k a -> Field t tys Source #

Monoid (Interpret t x) => Monoid (Field t x) Source # 
Instance details

Defined in Generics.Kind

Methods

mempty :: Field t x #

mappend :: Field t x -> Field t x -> Field t x #

mconcat :: [Field t x] -> Field t x #

Semigroup (Interpret t x) => Semigroup (Field t x) Source # 
Instance details

Defined in Generics.Kind

Methods

(<>) :: Field t x -> Field t x -> Field t x #

sconcat :: NonEmpty (Field t x) -> Field t x #

stimes :: Integral b => b -> Field t x -> Field t x #

Show (Interpret t x) => Show (Field t x) Source # 
Instance details

Defined in Generics.Kind

Methods

showsPrec :: Int -> Field t x -> ShowS #

show :: Field t x -> String #

showList :: [Field t x] -> ShowS #

Eq (Interpret t x) => Eq (Field t x) Source # 
Instance details

Defined in Generics.Kind

Methods

(==) :: Field t x -> Field t x -> Bool #

(/=) :: Field t x -> Field t x -> Bool #

Ord (Interpret t x) => Ord (Field t x) Source # 
Instance details

Defined in Generics.Kind

Methods

compare :: Field t x -> Field t x -> Ordering #

(<) :: Field t x -> Field t x -> Bool #

(<=) :: Field t x -> Field t x -> Bool #

(>) :: Field t x -> Field t x -> Bool #

(>=) :: Field t x -> Field t x -> Bool #

max :: Field t x -> Field t x -> Field t x #

min :: Field t x -> Field t x -> Field t x #

type SubstRep (Field t2 :: LoT (t1 -> k) -> Type) (x :: t1) Source # 
Instance details

Defined in Generics.Kind

type SubstRep (Field t2 :: LoT (t1 -> k) -> Type) (x :: t1) = Field (SubstAtom t2 x)

data ((c :: Atom d Constraint) :=>: (f :: LoT d -> Type)) (x :: LoT d) where Source #

Constraints: used to represent constraints in a constructor. Replaces the (:=>:) type from GHC.Generics.Extra.

data Showable a = Show a => a -> X a

instance GenericK Showable (a :&&: LoT0) where
  type RepK Showable = (Show :$: a) :=>: (Field Var0)

Constructors

SuchThat :: forall {d} (c :: Atom d Constraint) (x :: LoT d) (f :: LoT d -> Type). Interpret c x => f x -> (c :=>: f) x 

Instances

Instances details
(Interpret (SubstAtom c x) xs => InterpretCons c x xs, Interpret c (x ':&&: xs) => InterpretSubst c x xs, SubstRep' f x xs) => SubstRep' (c :=>: f :: LoT (t -> k) -> Type) (x :: t) (xs :: LoT k) Source # 
Instance details

Defined in Generics.Kind

Associated Types

type SubstRep (c :=>: f :: LoT (t -> k) -> Type) (x :: t) 
Instance details

Defined in Generics.Kind

type SubstRep (c :=>: f :: LoT (t -> k) -> Type) (x :: t) = SubstAtom c x :=>: SubstRep f x

Methods

substRep :: (c :=>: f) (x ':&&: xs) -> SubstRep (c :=>: f) x xs

unsubstRep :: SubstRep (c :=>: f) x xs -> (c :=>: f) (x ':&&: xs)

(k ~ Interpret t tys, Conv f f' tys) => Conv (k :=>: f) (t :=>: f' :: LoT d -> Type) (tys :: LoT d) Source # 
Instance details

Defined in Generics.Kind

Methods

toGhcGenerics :: (t :=>: f') tys -> (k :=>: f) a Source #

toKindGenerics :: (k :=>: f) a -> (t :=>: f') tys Source #

(Interpret c x => Show (f x)) => Show ((c :=>: f) x) Source # 
Instance details

Defined in Generics.Kind

Methods

showsPrec :: Int -> (c :=>: f) x -> ShowS #

show :: (c :=>: f) x -> String #

showList :: [(c :=>: f) x] -> ShowS #

(Interpret c x => Eq (f x)) => Eq ((c :=>: f) x) Source # 
Instance details

Defined in Generics.Kind

Methods

(==) :: (c :=>: f) x -> (c :=>: f) x -> Bool #

(/=) :: (c :=>: f) x -> (c :=>: f) x -> Bool #

(Interpret c x => Ord (f x)) => Ord ((c :=>: f) x) Source # 
Instance details

Defined in Generics.Kind

Methods

compare :: (c :=>: f) x -> (c :=>: f) x -> Ordering #

(<) :: (c :=>: f) x -> (c :=>: f) x -> Bool #

(<=) :: (c :=>: f) x -> (c :=>: f) x -> Bool #

(>) :: (c :=>: f) x -> (c :=>: f) x -> Bool #

(>=) :: (c :=>: f) x -> (c :=>: f) x -> Bool #

max :: (c :=>: f) x -> (c :=>: f) x -> (c :=>: f) x #

min :: (c :=>: f) x -> (c :=>: f) x -> (c :=>: f) x #

type SubstRep (c :=>: f :: LoT (t -> k) -> Type) (x :: t) Source # 
Instance details

Defined in Generics.Kind

type SubstRep (c :=>: f :: LoT (t -> k) -> Type) (x :: t) = SubstAtom c x :=>: SubstRep f x

data Exists k (f :: LoT (k -> d) -> Type) (x :: LoT d) where Source #

Existentials: a representation of the form E f describes a constructor whose inner type is represented by f, and where the type variable at index 0, Var0, is existentially quantified.

data E where
 E :: t -> Exists

instance GenericK E LoT0 where
  type RepK E = Exists Type (Field Var0)

Constructors

Exists 

Fields

Instances

Instances details
(forall (t :: k). Show (f (t ':&&: x))) => Show (Exists k f x) Source # 
Instance details

Defined in Generics.Kind

Methods

showsPrec :: Int -> Exists k f x -> ShowS #

show :: Exists k f x -> String #

showList :: [Exists k f x] -> ShowS #

Atoms for Field

data Atom d (k :: TYPE r) where #

Shape of a type, possibly with type variables.

>>> :kind Kon [] :@: Var0 -- the type [a] for unknown a
Kon [] :@: Var0 :: Atom (* -> xs) *

Representation of type families

Expand

Type families are represented using first-class-families.

For example, the type-level n + m :: Nat-- may expand to the following--

n + m         -- using (+) from GHC.TypeNats
~
Eval (n + m)  -- using Eval from Fcf.Core and (+) from Fcf.Data.Nat

which may be encoded as the following Atom (using Var0 for n and Var1 for m):

Eval ((Kon (+) :@: Var0) :@: Var1)  -- Eval as Atom's constructor
  :: Atom (Nat -> Nat -> Type) Nat

kind-generics uses a different, more systematic encoding of type families for GenericK instances; see fcf-family for more details. For example, n + m is instead expanded to the following:

n + m
~
Eval (NDFamily (MkName "base" "GHC.TypeNats" "+") P0 '(n, '(m, '())))

which gets encoded as the following Atom:

Eval (Kon (NDFamily (MkName "base" "GHC.TypeNats" "+") P0)
        :@: ((Kon '(,) :@: Var0) :@: ((Kon '(,) :@: Var1) :@: Kon '())))
  :: Atom (Nat -> Nat -> Type) Nat

Constructors

Var :: forall d k1. TyVar d k1 -> Atom d k1

Represents a type variable.

Kon :: forall k1 d. k1 -> Atom d k1

Represents a constant type, like Int.

(:@:) :: forall d k1 k2. Atom d (k1 -> k2) -> Atom d k1 -> Atom d k2

Represents type application.

(:&:) :: forall d. Atom d Constraint -> Atom d Constraint -> Atom d Constraint infixr 5

Represents the conjunction of two constraints.

ForAll :: forall d1 d. Atom (d1 -> d) Type -> Atom d Type

Represents universal quantification.

(:=>>:) :: forall d. Atom d Constraint -> Atom d Type -> Atom d Type infixr 5

Represents constraint requirement, the "thick arrow" =>.

Eval :: forall d k1. Atom d (Exp k1) -> Atom d k1

Represents a type family application.

data TyVar d (k :: TYPE r) where #

Well-scoped de Bruijn representation of type variables. TyVar d represents all the possible type variables which can refer to the holes in kind d.

We recommend using the aliases Var0, Var1, ... instead of the constructors, for further clarity.

Constructors

VZ :: forall x xs. TyVar (x -> xs) x

First hole in d.

VS :: forall xs k1 x. TyVar xs k1 -> TyVar (x -> xs) k1

Successor hole, increases the hole reference by 1.

type (:$:) (f :: k1 -> k2) (x :: Atom d k1) = ('Kon f :: Atom d (k1 -> k2)) ':@: x #

Represents an applied constructor. Instead of Kon [] :: Var0$ you can write @[] :$: Var0$.

type (:~:) (a :: Atom d k1) (b :: Atom d k1) = (('Kon ((~) :: k1 -> k1 -> Constraint) :: Atom d (k1 -> k1 -> Constraint)) ':@: a) ':@: b #

Represents (homogeneous) type equality.

type (:~~:) (a :: Atom d k1) (b :: Atom d k2) = (('Kon ((~~) :: k1 -> k2 -> Constraint) :: Atom d (k1 -> k2 -> Constraint)) ':@: a) ':@: b #

Represents heterogeneous type equality.

type Var0 = 'Var ('VZ :: TyVar (k -> xs) k) #

type Var1 = 'Var ('VS ('VZ :: TyVar (k -> xs) k) :: TyVar (x -> k -> xs) k) #

type Var2 = 'Var ('VS ('VS ('VZ :: TyVar (k -> xs) k) :: TyVar (x1 -> k -> xs) k) :: TyVar (x -> x1 -> k -> xs) k) #

type Var3 = 'Var ('VS ('VS ('VS ('VZ :: TyVar (k -> xs) k) :: TyVar (x2 -> k -> xs) k) :: TyVar (x1 -> x2 -> k -> xs) k) :: TyVar (x -> x1 -> x2 -> k -> xs) k) #

type Var4 = 'Var ('VS ('VS ('VS ('VS ('VZ :: TyVar (k -> xs) k) :: TyVar (x3 -> k -> xs) k) :: TyVar (x2 -> x3 -> k -> xs) k) :: TyVar (x1 -> x2 -> x3 -> k -> xs) k) :: TyVar (x -> x1 -> x2 -> x3 -> k -> xs) k) #

type Var5 = 'Var ('VS ('VS ('VS ('VS ('VS ('VZ :: TyVar (k -> xs) k) :: TyVar (x4 -> k -> xs) k) :: TyVar (x3 -> x4 -> k -> xs) k) :: TyVar (x2 -> x3 -> x4 -> k -> xs) k) :: TyVar (x1 -> x2 -> x3 -> x4 -> k -> xs) k) :: TyVar (x -> x1 -> x2 -> x3 -> x4 -> k -> xs) k) #

type Var6 = 'Var ('VS ('VS ('VS ('VS ('VS ('VS ('VZ :: TyVar (k -> xs) k) :: TyVar (x5 -> k -> xs) k) :: TyVar (x4 -> x5 -> k -> xs) k) :: TyVar (x3 -> x4 -> x5 -> k -> xs) k) :: TyVar (x2 -> x3 -> x4 -> x5 -> k -> xs) k) :: TyVar (x1 -> x2 -> x3 -> x4 -> x5 -> k -> xs) k) :: TyVar (x -> x1 -> x2 -> x3 -> x4 -> x5 -> k -> xs) k) #

type Var7 = 'Var ('VS ('VS ('VS ('VS ('VS ('VS ('VS ('VZ :: TyVar (k -> xs) k) :: TyVar (x6 -> k -> xs) k) :: TyVar (x5 -> x6 -> k -> xs) k) :: TyVar (x4 -> x5 -> x6 -> k -> xs) k) :: TyVar (x3 -> x4 -> x5 -> x6 -> k -> xs) k) :: TyVar (x2 -> x3 -> x4 -> x5 -> x6 -> k -> xs) k) :: TyVar (x1 -> x2 -> x3 -> x4 -> x5 -> x6 -> k -> xs) k) :: TyVar (x -> x1 -> x2 -> x3 -> x4 -> x5 -> x6 -> k -> xs) k) #

type Var8 = 'Var ('VS ('VS ('VS ('VS ('VS ('VS ('VS ('VS ('VZ :: TyVar (k -> xs) k) :: TyVar (x7 -> k -> xs) k) :: TyVar (x6 -> x7 -> k -> xs) k) :: TyVar (x5 -> x6 -> x7 -> k -> xs) k) :: TyVar (x4 -> x5 -> x6 -> x7 -> k -> xs) k) :: TyVar (x3 -> x4 -> x5 -> x6 -> x7 -> k -> xs) k) :: TyVar (x2 -> x3 -> x4 -> x5 -> x6 -> x7 -> k -> xs) k) :: TyVar (x1 -> x2 -> x3 -> x4 -> x5 -> x6 -> x7 -> k -> xs) k) :: TyVar (x -> x1 -> x2 -> x3 -> x4 -> x5 -> x6 -> x7 -> k -> xs) k) #

type Var9 = 'Var ('VS ('VS ('VS ('VS ('VS ('VS ('VS ('VS ('VS ('VZ :: TyVar (k -> xs) k) :: TyVar (x8 -> k -> xs) k) :: TyVar (x7 -> x8 -> k -> xs) k) :: TyVar (x6 -> x7 -> x8 -> k -> xs) k) :: TyVar (x5 -> x6 -> x7 -> x8 -> k -> xs) k) :: TyVar (x4 -> x5 -> x6 -> x7 -> x8 -> k -> xs) k) :: TyVar (x3 -> x4 -> x5 -> x6 -> x7 -> x8 -> k -> xs) k) :: TyVar (x2 -> x3 -> x4 -> x5 -> x6 -> x7 -> x8 -> k -> xs) k) :: TyVar (x1 -> x2 -> x3 -> x4 -> x5 -> x6 -> x7 -> x8 -> k -> xs) k) :: TyVar (x -> x1 -> x2 -> x3 -> x4 -> x5 -> x6 -> x7 -> x8 -> k -> xs) k) #

Lists of types

data LoT k where #

LoT k represents a list of types which can be applied to a data type of kind k.

Constructors

LoT0 :: LoT Type

Empty list of types.

(:&&:) :: forall k1 ks. k1 -> LoT ks -> LoT (k1 -> ks) infixr 5

Cons a type with a list of types.

Instances

Instances details
SubstRep' (U1 :: LoT (t -> k) -> Type) (x :: t) (xs :: LoT k) Source # 
Instance details

Defined in Generics.Kind

Associated Types

type SubstRep (U1 :: LoT (t -> k) -> Type) (x :: t) 
Instance details

Defined in Generics.Kind

type SubstRep (U1 :: LoT (t -> k) -> Type) (x :: t) = U1 :: LoT k -> Type

Methods

substRep :: U1 (x ':&&: xs) -> SubstRep (U1 :: LoT (t -> k) -> Type) x xs

unsubstRep :: SubstRep (U1 :: LoT (t -> k) -> Type) x xs -> U1 (x ':&&: xs)

(SubstRep' f x xs, SubstRep' g x xs) => SubstRep' (f :*: g :: LoT (t -> k) -> Type) (x :: t) (xs :: LoT k) Source # 
Instance details

Defined in Generics.Kind

Associated Types

type SubstRep (f :*: g :: LoT (t -> k) -> Type) (x :: t) 
Instance details

Defined in Generics.Kind

type SubstRep (f :*: g :: LoT (t -> k) -> Type) (x :: t) = SubstRep f x :*: SubstRep g x

Methods

substRep :: (f :*: g) (x ':&&: xs) -> SubstRep (f :*: g) x xs

unsubstRep :: SubstRep (f :*: g) x xs -> (f :*: g) (x ':&&: xs)

(SubstRep' f x xs, SubstRep' g x xs) => SubstRep' (f :+: g :: LoT (t -> k) -> Type) (x :: t) (xs :: LoT k) Source # 
Instance details

Defined in Generics.Kind

Associated Types

type SubstRep (f :+: g :: LoT (t -> k) -> Type) (x :: t) 
Instance details

Defined in Generics.Kind

type SubstRep (f :+: g :: LoT (t -> k) -> Type) (x :: t) = SubstRep f x :+: SubstRep g x

Methods

substRep :: (f :+: g) (x ':&&: xs) -> SubstRep (f :+: g) x xs

unsubstRep :: SubstRep (f :+: g) x xs -> (f :+: g) (x ':&&: xs)

SubstRep' f x xs => SubstRep' (M1 i c f :: LoT (t -> k) -> Type) (x :: t) (xs :: LoT k) Source # 
Instance details

Defined in Generics.Kind

Associated Types

type SubstRep (M1 i c f :: LoT (t -> k) -> Type) (x :: t) 
Instance details

Defined in Generics.Kind

type SubstRep (M1 i c f :: LoT (t -> k) -> Type) (x :: t) = M1 i c (SubstRep f x)

Methods

substRep :: M1 i c f (x ':&&: xs) -> SubstRep (M1 i c f) x xs

unsubstRep :: SubstRep (M1 i c f) x xs -> M1 i c f (x ':&&: xs)

Conv (U1 :: Type -> Type) (U1 :: LoT d -> Type) (tys :: LoT d) Source # 
Instance details

Defined in Generics.Kind

Methods

toGhcGenerics :: U1 tys -> U1 a Source #

toKindGenerics :: U1 a -> U1 tys Source #

(Conv f f' tys, Conv g g' tys) => Conv (f :*: g) (f' :*: g' :: LoT d -> Type) (tys :: LoT d) Source # 
Instance details

Defined in Generics.Kind

Methods

toGhcGenerics :: (f' :*: g') tys -> (f :*: g) a Source #

toKindGenerics :: (f :*: g) a -> (f' :*: g') tys Source #

(Conv f f' tys, Conv g g' tys) => Conv (f :+: g) (f' :+: g' :: LoT d -> Type) (tys :: LoT d) Source # 
Instance details

Defined in Generics.Kind

Methods

toGhcGenerics :: (f' :+: g') tys -> (f :+: g) a Source #

toKindGenerics :: (f :+: g) a -> (f' :+: g') tys Source #

Conv f f' tys => Conv (M1 i c f) (M1 i c f' :: LoT d -> Type) (tys :: LoT d) Source # 
Instance details

Defined in Generics.Kind

Methods

toGhcGenerics :: M1 i c f' tys -> M1 i c f a Source #

toKindGenerics :: M1 i c f a -> M1 i c f' tys Source #

type SubstRep (U1 :: LoT (t -> k) -> Type) (x :: t) Source # 
Instance details

Defined in Generics.Kind

type SubstRep (U1 :: LoT (t -> k) -> Type) (x :: t) = U1 :: LoT k -> Type
type SubstRep (f :*: g :: LoT (t -> k) -> Type) (x :: t) Source # 
Instance details

Defined in Generics.Kind

type SubstRep (f :*: g :: LoT (t -> k) -> Type) (x :: t) = SubstRep f x :*: SubstRep g x
type SubstRep (f :+: g :: LoT (t -> k) -> Type) (x :: t) Source # 
Instance details

Defined in Generics.Kind

type SubstRep (f :+: g :: LoT (t -> k) -> Type) (x :: t) = SubstRep f x :+: SubstRep g x
type SubstRep (M1 i c f :: LoT (t -> k) -> Type) (x :: t) Source # 
Instance details

Defined in Generics.Kind

type SubstRep (M1 i c f :: LoT (t -> k) -> Type) (x :: t) = M1 i c (SubstRep f x)

type family (f :: k) :@@: (tys :: LoT k) where ... #

Apply a list of types to a type constructor.

>>> :kind! Either :@@: (Int :&&: Bool :&&: LoT0)
Either Int Bool :: Type

Equations

(f :: Type) :@@: (_1 :: LoT Type) = f 
(f :: k -> k') :@@: (as :: LoT (k -> k')) = f (HeadLoT as) :@@: TailLoT as 

type LoT1 (a :: k) = a ':&&: 'LoT0 #

List of types with a single element.

type LoT2 (a :: k) (b :: k1) = a ':&&: (b ':&&: 'LoT0) #

List of types with two elements.

data TyEnv where #

A type constructor and a list of types that can be applied to it.

Constructors

TyEnv :: forall k. k -> LoT k -> TyEnv 

Generic type classes

class GenericK (f :: k) where Source #

Representable types of any kind. Examples:

instance GenericK Int
instance GenericK []
instance GenericK Either
instance GenericK (Either a)
instance GenericK (Either a b)

Minimal complete definition

Nothing

Associated Types

type RepK (f :: k) :: LoT k -> Type Source #

Methods

fromK :: forall (x :: LoT k). (f :@@: x) -> RepK f x Source #

Convert the data type to its representation.

default fromK :: forall (x :: LoT k). (Generic (f :@@: x), Conv (Rep (f :@@: x)) (RepK f) x) => (f :@@: x) -> RepK f x Source #

toK :: forall (x :: LoT k). RepK f x -> f :@@: x Source #

Convert from a representation to its corresponding data type.

default toK :: forall (x :: LoT k). (Generic (f :@@: x), Conv (Rep (f :@@: x)) (RepK f) x) => RepK f x -> f :@@: x Source #

Instances

Instances details
GenericK Ranky Source # 
Instance details

Defined in Generics.Kind.Examples

Associated Types

type RepK Ranky 
Instance details

Defined in Generics.Kind.Examples

type RepK Ranky = Field ('ForAll (((->) :$: (Var0 :: Atom (Type -> Type) Type)) ':@: (Var0 :: Atom (Type -> Type) Type)))

Methods

fromK :: forall (x :: LoT Type). (Ranky :@@: x) -> RepK Ranky x Source #

toK :: forall (x :: LoT Type). RepK Ranky x -> Ranky :@@: x Source #

GenericK (HappyFamily (Maybe a) :: Type) Source # 
Instance details

Defined in Generics.Kind.Examples

Associated Types

type RepK (HappyFamily (Maybe a) :: Type) 
Instance details

Defined in Generics.Kind.Examples

Methods

fromK :: forall (x :: LoT Type). (HappyFamily (Maybe a) :@@: x) -> RepK (HappyFamily (Maybe a)) x Source #

toK :: forall (x :: LoT Type). RepK (HappyFamily (Maybe a)) x -> HappyFamily (Maybe a) :@@: x Source #

GenericK (HappyFamily [a] :: Type) Source # 
Instance details

Defined in Generics.Kind.Examples

Associated Types

type RepK (HappyFamily [a] :: Type) 
Instance details

Defined in Generics.Kind.Examples

type RepK (HappyFamily [a] :: Type) = Field ('Kon a :: Atom Type Type)

Methods

fromK :: forall (x :: LoT Type). (HappyFamily [a] :@@: x) -> RepK (HappyFamily [a]) x Source #

toK :: forall (x :: LoT Type). RepK (HappyFamily [a]) x -> HappyFamily [a] :@@: x Source #

GenericK (Tree a :: Type) Source # 
Instance details

Defined in Generics.Kind.Examples

Associated Types

type RepK (Tree a :: Type) 
Instance details

Defined in Generics.Kind.Examples

type RepK (Tree a :: Type) = SubstRep (RepK Tree) a

Methods

fromK :: forall (x :: LoT Type). (Tree a :@@: x) -> RepK (Tree a) x Source #

toK :: forall (x :: LoT Type). RepK (Tree a) x -> Tree a :@@: x Source #

GenericK (WeirdTreeR a :: Type) Source # 
Instance details

Defined in Generics.Kind.Examples

Associated Types

type RepK (WeirdTreeR a :: Type) 
Instance details

Defined in Generics.Kind.Examples

type RepK (WeirdTreeR a :: Type) = (Field ('Kon (WeirdTreeR a) :: Atom Type Type) :*: Field ('Kon (WeirdTreeR a) :: Atom Type Type)) :+: Exists Type ((('Kon (Show a) :: Atom (Type -> Type) Constraint) ':&: ((Eq :$: (Var0 :: Atom (Type -> Type) Type)) ':&: ((Typeable :: Type -> Constraint) :$: (Var0 :: Atom (Type -> Type) Type)))) :=>: (Field (Var0 :: Atom (Type -> Type) Type) :*: Field ('Kon a :: Atom (Type -> Type) Type)))

Methods

fromK :: forall (x :: LoT Type). (WeirdTreeR a :@@: x) -> RepK (WeirdTreeR a) x Source #

toK :: forall (x :: LoT Type). RepK (WeirdTreeR a) x -> WeirdTreeR a :@@: x Source #

GenericK (Maybe a :: Type) Source # 
Instance details

Defined in Generics.Kind.Examples

Associated Types

type RepK (Maybe a :: Type) 
Instance details

Defined in Generics.Kind.Examples

type RepK (Maybe a :: Type) = SubstRep (RepK Maybe) a

Methods

fromK :: forall (x :: LoT Type). (Maybe a :@@: x) -> RepK (Maybe a) x Source #

toK :: forall (x :: LoT Type). RepK (Maybe a) x -> Maybe a :@@: x Source #

GenericK ([a] :: Type) Source # 
Instance details

Defined in Generics.Kind.Examples

Associated Types

type RepK ([a] :: Type) 
Instance details

Defined in Generics.Kind.Examples

type RepK ([a] :: Type) = SubstRep (RepK []) a

Methods

fromK :: forall (x :: LoT Type). ([a] :@@: x) -> RepK [a] x Source #

toK :: forall (x :: LoT Type). RepK [a] x -> [a] :@@: x Source #

GenericK (Either a b :: Type) Source # 
Instance details

Defined in Generics.Kind.Examples

Associated Types

type RepK (Either a b :: Type) 
Instance details

Defined in Generics.Kind.Examples

type RepK (Either a b :: Type) = SubstRep (RepK (Either a)) b

Methods

fromK :: forall (x :: LoT Type). (Either a b :@@: x) -> RepK (Either a b) x Source #

toK :: forall (x :: LoT Type). RepK (Either a b) x -> Either a b :@@: x Source #

GenericK (SimpleIndex a b :: Type) Source # 
Instance details

Defined in Generics.Kind.Examples

Associated Types

type RepK (SimpleIndex a b :: Type) 
Instance details

Defined in Generics.Kind.Examples

type RepK (SimpleIndex a b :: Type) = Exists Type ((('Kon a :: Atom (Type -> Type) Type) :~: ([] :$: (Var0 :: Atom (Type -> Type) Type))) :=>: Field ([] :$: (Var0 :: Atom (Type -> Type) Type)))

Methods

fromK :: forall (x :: LoT Type). (SimpleIndex a b :@@: x) -> RepK (SimpleIndex a b) x Source #

toK :: forall (x :: LoT Type). RepK (SimpleIndex a b) x -> SimpleIndex a b :@@: x Source #

GenericK (Hkd f a :: Type) Source # 
Instance details

Defined in Generics.Kind.Examples

Associated Types

type RepK (Hkd f a :: Type) 
Instance details

Defined in Generics.Kind.Examples

type RepK (Hkd f a :: Type) = Field ('Kon (Eval (f a)) :: Atom Type Type)

Methods

fromK :: forall (x :: LoT Type). (Hkd f a :@@: x) -> RepK (Hkd f a) x Source #

toK :: forall (x :: LoT Type). RepK (Hkd f a) x -> Hkd f a :@@: x Source #

GenericK (TTY m a :: Type) Source # 
Instance details

Defined in Generics.Kind.Examples

Associated Types

type RepK (TTY m a :: Type) 
Instance details

Defined in Generics.Kind.Examples

type RepK (TTY m a :: Type) = ((('Kon a :: Atom Type Type) :~: ('Kon () :: Atom Type Type)) :=>: Field ('Kon String :: Atom Type Type)) :+: ((('Kon a :: Atom Type Type) :~: ('Kon String :: Atom Type Type)) :=>: (U1 :: LoT Type -> Type))

Methods

fromK :: forall (x :: LoT Type). (TTY m a :@@: x) -> RepK (TTY m a) x Source #

toK :: forall (x :: LoT Type). RepK (TTY m a) x -> TTY m a :@@: x Source #

GenericK Either Source # 
Instance details

Defined in Generics.Kind.Examples

Associated Types

type RepK Either 
Instance details

Defined in Generics.Kind.Examples

type RepK Either = Field (Var0 :: Atom (Type -> Type -> Type) Type) :+: Field (Var1 :: Atom (Type -> Type -> Type) Type)

Methods

fromK :: forall (x :: LoT (Type -> Type -> Type)). (Either :@@: x) -> RepK Either x Source #

toK :: forall (x :: LoT (Type -> Type -> Type)). RepK Either x -> Either :@@: x Source #

GenericK SimpleIndex Source # 
Instance details

Defined in Generics.Kind.Examples

Associated Types

type RepK SimpleIndex 
Instance details

Defined in Generics.Kind.Examples

type RepK SimpleIndex = Exists Type (((Var1 :: Atom (Type -> Type -> Type -> Type) Type) :~: ([] :$: (Var0 :: Atom (Type -> Type -> Type -> Type) Type))) :=>: Field ([] :$: (Var0 :: Atom (Type -> Type -> Type -> Type) Type)))

Methods

fromK :: forall (x :: LoT (Type -> Type -> Type)). (SimpleIndex :@@: x) -> RepK SimpleIndex x Source #

toK :: forall (x :: LoT (Type -> Type -> Type)). RepK SimpleIndex x -> SimpleIndex :@@: x Source #

GenericK HappyFamily Source # 
Instance details

Defined in Generics.Kind.Examples

Associated Types

type RepK HappyFamily 
Instance details

Defined in Generics.Kind.Examples

type RepK HappyFamily = TypeError ('Text "Cannot describe this family uniformly") :: LoT (Type -> Type) -> Type

Methods

fromK :: forall (x :: LoT (Type -> Type)). (HappyFamily :@@: x) -> RepK HappyFamily x Source #

toK :: forall (x :: LoT (Type -> Type)). RepK HappyFamily x -> HappyFamily :@@: x Source #

GenericK Ranky2 Source # 
Instance details

Defined in Generics.Kind.Examples

Associated Types

type RepK Ranky2 
Instance details

Defined in Generics.Kind.Examples

type RepK Ranky2 = Field (((->) :$: 'ForAll (((->) :$: (Var0 :: Atom (Type -> Type -> Type) Type)) ':@: (Var0 :: Atom (Type -> Type -> Type) Type))) ':@: (Var0 :: Atom (Type -> Type) Type))

Methods

fromK :: forall (x :: LoT (Type -> Type)). (Ranky2 :@@: x) -> RepK Ranky2 x Source #

toK :: forall (x :: LoT (Type -> Type)). RepK Ranky2 x -> Ranky2 :@@: x Source #

GenericK Shower Source # 
Instance details

Defined in Generics.Kind.Examples

Associated Types

type RepK Shower 
Instance details

Defined in Generics.Kind.Examples

type RepK Shower = Field ((Show :$: (Var0 :: Atom (Type -> Type) Type)) ':=>>: (((->) :$: (Var0 :: Atom (Type -> Type) Type)) ':@: ('Kon String :: Atom (Type -> Type) Type)))

Methods

fromK :: forall (x :: LoT (Type -> Type)). (Shower :@@: x) -> RepK Shower x Source #

toK :: forall (x :: LoT (Type -> Type)). RepK Shower x -> Shower :@@: x Source #

GenericK Tree Source # 
Instance details

Defined in Generics.Kind.Examples

Associated Types

type RepK Tree 
Instance details

Defined in Generics.Kind.Examples

Methods

fromK :: forall (x :: LoT (Type -> Type)). (Tree :@@: x) -> RepK Tree x Source #

toK :: forall (x :: LoT (Type -> Type)). RepK Tree x -> Tree :@@: x Source #

GenericK WeirdTree Source # 
Instance details

Defined in Generics.Kind.Examples

Associated Types

type RepK WeirdTree 
Instance details

Defined in Generics.Kind.Examples

Methods

fromK :: forall (x :: LoT (Type -> Type)). (WeirdTree :@@: x) -> RepK WeirdTree x Source #

toK :: forall (x :: LoT (Type -> Type)). RepK WeirdTree x -> WeirdTree :@@: x Source #

GenericK WeirdTreeR Source # 
Instance details

Defined in Generics.Kind.Examples

Associated Types

type RepK WeirdTreeR 
Instance details

Defined in Generics.Kind.Examples

Methods

fromK :: forall (x :: LoT (Type -> Type)). (WeirdTreeR :@@: x) -> RepK WeirdTreeR x Source #

toK :: forall (x :: LoT (Type -> Type)). RepK WeirdTreeR x -> WeirdTreeR :@@: x Source #

GenericK Maybe Source # 
Instance details

Defined in Generics.Kind.Examples

Associated Types

type RepK Maybe 
Instance details

Defined in Generics.Kind.Examples

type RepK Maybe = (U1 :: LoT (Type -> Type) -> Type) :+: Field (Var0 :: Atom (Type -> Type) Type)

Methods

fromK :: forall (x :: LoT (Type -> Type)). (Maybe :@@: x) -> RepK Maybe x Source #

toK :: forall (x :: LoT (Type -> Type)). RepK Maybe x -> Maybe :@@: x Source #

GenericK [] Source # 
Instance details

Defined in Generics.Kind.Examples

Associated Types

type RepK [] 
Instance details

Defined in Generics.Kind.Examples

type RepK [] = (U1 :: LoT (Type -> Type) -> Type) :+: (Field (Var0 :: Atom (Type -> Type) Type) :*: Field ([] :$: (Var0 :: Atom (Type -> Type) Type)))

Methods

fromK :: forall (x :: LoT (Type -> Type)). ([] :@@: x) -> RepK [] x Source #

toK :: forall (x :: LoT (Type -> Type)). RepK [] x -> [] :@@: x Source #

GenericK (Hkd :: (k -> Exp Type) -> k -> Type) Source # 
Instance details

Defined in Generics.Kind.Examples

Associated Types

type RepK (Hkd :: (k -> Exp Type) -> k -> Type) 
Instance details

Defined in Generics.Kind.Examples

type RepK (Hkd :: (k -> Exp Type) -> k -> Type) = Field ('Eval ((Var0 :: Atom ((k -> Exp Type) -> k -> Type) (k -> Exp Type)) ':@: (Var1 :: Atom ((k -> Exp Type) -> k -> Type) k)))

Methods

fromK :: forall (x :: LoT ((k -> Exp Type) -> k -> Type)). ((Hkd :: (k -> Exp Type) -> k -> Type) :@@: x) -> RepK (Hkd :: (k -> Exp Type) -> k -> Type) x Source #

toK :: forall (x :: LoT ((k -> Exp Type) -> k -> Type)). RepK (Hkd :: (k -> Exp Type) -> k -> Type) x -> (Hkd :: (k -> Exp Type) -> k -> Type) :@@: x Source #

GenericK (P' :: Type -> k -> Type) Source # 
Instance details

Defined in Generics.Kind.Examples

Associated Types

type RepK (P' :: Type -> k -> Type) 
Instance details

Defined in Generics.Kind.Examples

type RepK (P' :: Type -> k -> Type) = (('Kon k :: Atom (Type -> k -> Type) Type) :~: (Var0 :: Atom (Type -> k -> Type) Type)) :=>: (U1 :: LoT (Type -> k -> Type) -> Type)

Methods

fromK :: forall (x :: LoT (Type -> k -> Type)). ((P' :: Type -> k -> Type) :@@: x) -> RepK (P' :: Type -> k -> Type) x Source #

toK :: forall (x :: LoT (Type -> k -> Type)). RepK (P' :: Type -> k -> Type) x -> (P' :: Type -> k -> Type) :@@: x Source #

GenericK (Either a :: Type -> Type) Source # 
Instance details

Defined in Generics.Kind.Examples

Associated Types

type RepK (Either a :: Type -> Type) 
Instance details

Defined in Generics.Kind.Examples

type RepK (Either a :: Type -> Type) = SubstRep (RepK Either) a

Methods

fromK :: forall (x :: LoT (Type -> Type)). (Either a :@@: x) -> RepK (Either a) x Source #

toK :: forall (x :: LoT (Type -> Type)). RepK (Either a) x -> Either a :@@: x Source #

GenericK (SimpleIndex a :: Type -> Type) Source # 
Instance details

Defined in Generics.Kind.Examples

Associated Types

type RepK (SimpleIndex a :: Type -> Type) 
Instance details

Defined in Generics.Kind.Examples

type RepK (SimpleIndex a :: Type -> Type) = Exists Type ((('Kon a :: Atom (Type -> Type -> Type) Type) :~: ([] :$: (Var0 :: Atom (Type -> Type -> Type) Type))) :=>: Field ([] :$: (Var0 :: Atom (Type -> Type -> Type) Type)))

Methods

fromK :: forall (x :: LoT (Type -> Type)). (SimpleIndex a :@@: x) -> RepK (SimpleIndex a) x Source #

toK :: forall (x :: LoT (Type -> Type)). RepK (SimpleIndex a) x -> SimpleIndex a :@@: x Source #

GenericK (P k :: k -> Type) Source # 
Instance details

Defined in Generics.Kind.Examples

Associated Types

type RepK (P k :: k -> Type) 
Instance details

Defined in Generics.Kind.Examples

type RepK (P k :: k -> Type) = U1 :: LoT (k -> Type) -> Type

Methods

fromK :: forall (x :: LoT (k -> Type)). (P k :@@: x) -> RepK (P k) x Source #

toK :: forall (x :: LoT (k -> Type)). RepK (P k) x -> P k :@@: x Source #

GenericK (T :: k -> Type) Source # 
Instance details

Defined in Generics.Kind.Examples

Associated Types

type RepK (T :: k -> Type) 
Instance details

Defined in Generics.Kind.Examples

type RepK (T :: k -> Type) = Exists Type ((('Kon (k ~ Type) :: Atom (Type -> k -> Type) Constraint) ':&: ((Var0 :: Atom (Type -> k -> Type) Type) :~~: (Var1 :: Atom (Type -> k -> Type) k))) :=>: Field (Maybe :$: (Var0 :: Atom (Type -> k -> Type) Type)))

Methods

fromK :: forall (x :: LoT (k -> Type)). ((T :: k -> Type) :@@: x) -> RepK (T :: k -> Type) x Source #

toK :: forall (x :: LoT (k -> Type)). RepK (T :: k -> Type) x -> (T :: k -> Type) :@@: x Source #

GenericK (Hkd f :: k -> Type) Source # 
Instance details

Defined in Generics.Kind.Examples

Associated Types

type RepK (Hkd f :: k -> Type) 
Instance details

Defined in Generics.Kind.Examples

type RepK (Hkd f :: k -> Type) = Field ('Eval (('Kon f :: Atom (k -> Type) (k -> Exp Type)) ':@: (Var0 :: Atom (k -> Type) k)))

Methods

fromK :: forall (x :: LoT (k -> Type)). (Hkd f :@@: x) -> RepK (Hkd f) x Source #

toK :: forall (x :: LoT (k -> Type)). RepK (Hkd f) x -> Hkd f :@@: x Source #

GenericK (P' j :: k -> Type) Source # 
Instance details

Defined in Generics.Kind.Examples

Associated Types

type RepK (P' j :: k -> Type) 
Instance details

Defined in Generics.Kind.Examples

type RepK (P' j :: k -> Type) = (('Kon k :: Atom (k -> Type) Type) :~: ('Kon j :: Atom (k -> Type) Type)) :=>: (U1 :: LoT (k -> Type) -> Type)

Methods

fromK :: forall (x :: LoT (k -> Type)). ((P' j :: k -> Type) :@@: x) -> RepK (P' j :: k -> Type) x Source #

toK :: forall (x :: LoT (k -> Type)). RepK (P' j :: k -> Type) x -> (P' j :: k -> Type) :@@: x Source #

type GenericF t (f :: k) (x :: LoT k) = (GenericK f, x ~ SplitF t f, t ~ (f :@@: x)) Source #

fromF :: forall {k} (f :: k) t (x :: LoT k). GenericF t f x => t -> RepK f x Source #

toF :: forall {k} (f :: k) t (x :: LoT k). GenericF t f x => RepK f x -> t Source #

type GenericN (n :: Nat) t (f :: k) (x :: LoT k) = (GenericK f, 'TyEnv f x ~ SplitN n t, t ~ (f :@@: x)) Source #

fromN :: forall {k} (n :: Nat) t (f :: k) (x :: LoT k). GenericN n t f x => t -> RepK f x Source #

toN :: forall {k} (n :: Nat) t (f :: k) (x :: LoT k). GenericN n t f x => RepK f x -> t Source #

Getting more instances almost for free

fromRepK :: forall {t} {k} (f :: t -> k) (x :: t) (xs :: LoT k). (GenericK f, SubstRep' (RepK f) x xs) => (f x :@@: xs) -> SubstRep (RepK f) x xs Source #

toRepK :: forall {t} {k} (f :: t -> k) (x :: t) (xs :: LoT k). (GenericK f, SubstRep' (RepK f) x xs) => SubstRep (RepK f) x xs -> f x :@@: xs Source #

type family SubstRep (f :: LoT (t -> k) -> Type) (x :: t) :: LoT k -> Type Source #

Instances

Instances details
type SubstRep (U1 :: LoT (t -> k) -> Type) (x :: t) Source # 
Instance details

Defined in Generics.Kind

type SubstRep (U1 :: LoT (t -> k) -> Type) (x :: t) = U1 :: LoT k -> Type
type SubstRep (Field t2 :: LoT (t1 -> k) -> Type) (x :: t1) Source # 
Instance details

Defined in Generics.Kind

type SubstRep (Field t2 :: LoT (t1 -> k) -> Type) (x :: t1) = Field (SubstAtom t2 x)
type SubstRep (f :*: g :: LoT (t -> k) -> Type) (x :: t) Source # 
Instance details

Defined in Generics.Kind

type SubstRep (f :*: g :: LoT (t -> k) -> Type) (x :: t) = SubstRep f x :*: SubstRep g x
type SubstRep (f :+: g :: LoT (t -> k) -> Type) (x :: t) Source # 
Instance details

Defined in Generics.Kind

type SubstRep (f :+: g :: LoT (t -> k) -> Type) (x :: t) = SubstRep f x :+: SubstRep g x
type SubstRep (c :=>: f :: LoT (t -> k) -> Type) (x :: t) Source # 
Instance details

Defined in Generics.Kind

type SubstRep (c :=>: f :: LoT (t -> k) -> Type) (x :: t) = SubstAtom c x :=>: SubstRep f x
type SubstRep (M1 i c f :: LoT (t -> k) -> Type) (x :: t) Source # 
Instance details

Defined in Generics.Kind

type SubstRep (M1 i c f :: LoT (t -> k) -> Type) (x :: t) = M1 i c (SubstRep f x)

class SubstRep' (f :: LoT (t -> k) -> Type) (x :: t) (xs :: LoT k) Source #

Minimal complete definition

substRep, unsubstRep

Instances

Instances details
SubstRep' (U1 :: LoT (t -> k) -> Type) (x :: t) (xs :: LoT k) Source # 
Instance details

Defined in Generics.Kind

Associated Types

type SubstRep (U1 :: LoT (t -> k) -> Type) (x :: t) 
Instance details

Defined in Generics.Kind

type SubstRep (U1 :: LoT (t -> k) -> Type) (x :: t) = U1 :: LoT k -> Type

Methods

substRep :: U1 (x ':&&: xs) -> SubstRep (U1 :: LoT (t -> k) -> Type) x xs

unsubstRep :: SubstRep (U1 :: LoT (t -> k) -> Type) x xs -> U1 (x ':&&: xs)

Interpret (SubstAtom t2 x) xs ~ Interpret t2 (x ':&&: xs) => SubstRep' (Field t2 :: LoT (t1 -> k) -> Type) (x :: t1) (xs :: LoT k) Source # 
Instance details

Defined in Generics.Kind

Associated Types

type SubstRep (Field t2 :: LoT (t1 -> k) -> Type) (x :: t1) 
Instance details

Defined in Generics.Kind

type SubstRep (Field t2 :: LoT (t1 -> k) -> Type) (x :: t1) = Field (SubstAtom t2 x)

Methods

substRep :: Field t2 (x ':&&: xs) -> SubstRep (Field t2) x xs

unsubstRep :: SubstRep (Field t2) x xs -> Field t2 (x ':&&: xs)

(SubstRep' f x xs, SubstRep' g x xs) => SubstRep' (f :*: g :: LoT (t -> k) -> Type) (x :: t) (xs :: LoT k) Source # 
Instance details

Defined in Generics.Kind

Associated Types

type SubstRep (f :*: g :: LoT (t -> k) -> Type) (x :: t) 
Instance details

Defined in Generics.Kind

type SubstRep (f :*: g :: LoT (t -> k) -> Type) (x :: t) = SubstRep f x :*: SubstRep g x

Methods

substRep :: (f :*: g) (x ':&&: xs) -> SubstRep (f :*: g) x xs

unsubstRep :: SubstRep (f :*: g) x xs -> (f :*: g) (x ':&&: xs)

(SubstRep' f x xs, SubstRep' g x xs) => SubstRep' (f :+: g :: LoT (t -> k) -> Type) (x :: t) (xs :: LoT k) Source # 
Instance details

Defined in Generics.Kind

Associated Types

type SubstRep (f :+: g :: LoT (t -> k) -> Type) (x :: t) 
Instance details

Defined in Generics.Kind

type SubstRep (f :+: g :: LoT (t -> k) -> Type) (x :: t) = SubstRep f x :+: SubstRep g x

Methods

substRep :: (f :+: g) (x ':&&: xs) -> SubstRep (f :+: g) x xs

unsubstRep :: SubstRep (f :+: g) x xs -> (f :+: g) (x ':&&: xs)

(Interpret (SubstAtom c x) xs => InterpretCons c x xs, Interpret c (x ':&&: xs) => InterpretSubst c x xs, SubstRep' f x xs) => SubstRep' (c :=>: f :: LoT (t -> k) -> Type) (x :: t) (xs :: LoT k) Source # 
Instance details

Defined in Generics.Kind

Associated Types

type SubstRep (c :=>: f :: LoT (t -> k) -> Type) (x :: t) 
Instance details

Defined in Generics.Kind

type SubstRep (c :=>: f :: LoT (t -> k) -> Type) (x :: t) = SubstAtom c x :=>: SubstRep f x

Methods

substRep :: (c :=>: f) (x ':&&: xs) -> SubstRep (c :=>: f) x xs

unsubstRep :: SubstRep (c :=>: f) x xs -> (c :=>: f) (x ':&&: xs)

SubstRep' f x xs => SubstRep' (M1 i c f :: LoT (t -> k) -> Type) (x :: t) (xs :: LoT k) Source # 
Instance details

Defined in Generics.Kind

Associated Types

type SubstRep (M1 i c f :: LoT (t -> k) -> Type) (x :: t) 
Instance details

Defined in Generics.Kind

type SubstRep (M1 i c f :: LoT (t -> k) -> Type) (x :: t) = M1 i c (SubstRep f x)

Methods

substRep :: M1 i c f (x ':&&: xs) -> SubstRep (M1 i c f) x xs

unsubstRep :: SubstRep (M1 i c f) x xs -> M1 i c f (x ':&&: xs)

type family SubstAtom (f :: Atom (t -> k) d) (x :: t) :: Atom k d where ... Source #

Equations

SubstAtom ('Var ('VZ :: TyVar (k1 -> k) k1) :: Atom (k1 -> k) k1) (x :: k1) = 'Kon x :: Atom k k1 
SubstAtom ('Var ('VS v :: TyVar (t -> d) k1) :: Atom (t -> d) k1) (x :: t) = 'Var v 
SubstAtom ('Kon t2 :: Atom (t1 -> k) k1) (x :: t1) = 'Kon t2 :: Atom k k1 
SubstAtom (t1 ':@: t2 :: Atom (t -> k) k2) (x :: t) = SubstAtom t1 x ':@: SubstAtom t2 x 
SubstAtom (t1 ':&: t2 :: Atom (t -> k) Constraint) (x :: t) = SubstAtom t1 x ':&: SubstAtom t2 x 

Bridging with GHC.Generics

class Conv (gg :: Type -> Type) (kg :: LoT d -> Type) (tys :: LoT d) where Source #

Bridges a representation of a data type using the combinators in GHC.Generics with a representation using this module. You are never expected to manipulate this type class directly, it is part of the deriving mechanism for GenericK.

Methods

toGhcGenerics :: kg tys -> gg a Source #

toKindGenerics :: gg a -> kg tys Source #

Instances

Instances details
Conv (U1 :: Type -> Type) (U1 :: LoT d -> Type) (tys :: LoT d) Source # 
Instance details

Defined in Generics.Kind

Methods

toGhcGenerics :: U1 tys -> U1 a Source #

toKindGenerics :: U1 a -> U1 tys Source #

k ~ Interpret t tys => Conv (K1 p k :: Type -> Type) (Field t :: LoT d -> Type) (tys :: LoT d) Source # 
Instance details

Defined in Generics.Kind

Methods

toGhcGenerics :: Field t tys -> K1 p k a Source #

toKindGenerics :: K1 p k a -> Field t tys Source #

(Conv f f' tys, Conv g g' tys) => Conv (f :*: g) (f' :*: g' :: LoT d -> Type) (tys :: LoT d) Source # 
Instance details

Defined in Generics.Kind

Methods

toGhcGenerics :: (f' :*: g') tys -> (f :*: g) a Source #

toKindGenerics :: (f :*: g) a -> (f' :*: g') tys Source #

(Conv f f' tys, Conv g g' tys) => Conv (f :+: g) (f' :+: g' :: LoT d -> Type) (tys :: LoT d) Source # 
Instance details

Defined in Generics.Kind

Methods

toGhcGenerics :: (f' :+: g') tys -> (f :+: g) a Source #

toKindGenerics :: (f :+: g) a -> (f' :+: g') tys Source #

(k ~ Interpret t tys, Conv f f' tys) => Conv (k :=>: f) (t :=>: f' :: LoT d -> Type) (tys :: LoT d) Source # 
Instance details

Defined in Generics.Kind

Methods

toGhcGenerics :: (t :=>: f') tys -> (k :=>: f) a Source #

toKindGenerics :: (k :=>: f) a -> (t :=>: f') tys Source #

Conv f f' tys => Conv (M1 i c f) (f' :: LoT d -> Type) (tys :: LoT d) Source # 
Instance details

Defined in Generics.Kind

Methods

toGhcGenerics :: f' tys -> M1 i c f a Source #

toKindGenerics :: M1 i c f a -> f' tys Source #

Conv f f' tys => Conv (M1 i c f) (M1 i c f' :: LoT d -> Type) (tys :: LoT d) Source # 
Instance details

Defined in Generics.Kind

Methods

toGhcGenerics :: M1 i c f' tys -> M1 i c f a Source #

toKindGenerics :: M1 i c f a -> M1 i c f' tys Source #

Re-exported from Atom

Interpretation of atoms

type family Interpret (t :: Atom d k) (tys :: LoT d) :: k where ... #

Replaces the holes in the Atom t by the elements of the list of types tys. The amount and kind of types in tys must match statically those required by the Atom.

>>> :kind! Interpret ([] :$: Var0) (LoT1 Int)
Interpret ([] :$: Var0) (LoT1 Int) :: *
= [Int]

Equations

Interpret ('Var v :: Atom d k) (tys :: LoT d) = InterpretVar v tys 
Interpret ('Kon t :: Atom d k) (tys :: LoT d) = t 
Interpret (f ':@: x :: Atom d k2) (tys :: LoT d) = Interpret f tys (Interpret x tys) 
Interpret (c ':&: d2 :: Atom d1 Constraint) (tys :: LoT d1) = (Interpret c tys, Interpret d2 tys) 
Interpret ('ForAll f :: Atom d Type) (tys :: LoT d) = ForAllI f tys 
Interpret (c ':=>>: f :: Atom d Type) (tys :: LoT d) = SuchThatI c f tys 
Interpret ('Eval f :: Atom d a) (tys :: LoT d) = Eval (Interpret f tys) 

type family InterpretVar (t :: TyVar d k) (tys :: LoT d) :: k where ... #

Obtains the type in the list tys referenced by the type variable t.

>>> :kind! Interpret Var0 (LoT2 Int Bool)
Interpret Var0 (LoT2 Int Bool) :: *
= Int
>>> :kind! Interpret Var1 (LoT2 Int Bool)
Interpret Var1 (LoT2 Int Bool) :: *
= Bool

Equations

InterpretVar ('VZ :: TyVar (k -> k') k) (tys :: LoT (k -> k')) = HeadLoT tys 
InterpretVar ('VS v :: TyVar (k2 -> k') k1) (tys :: LoT (k2 -> k')) = InterpretVar v (TailLoT tys) 

type family Satisfies (cs :: [Atom d Constraint]) (tys :: LoT d) where ... #

Interprets a list of Atom representing constraints into the actual constraints. This is a specialization of Interpret for the case of constraints.

>>> :kind! Satisfies '[Eq :$: Var0, Show :$: Var0] (LoT1 Int)
Satisfies '[Eq :$: Var0, Show :$: Var0] (LoT1 Int) :: Constraint
= (Eq Int, (Show Int, () :: Constraint))

Equations

Satisfies ('[] :: [Atom d Constraint]) (tys :: LoT d) = () 
Satisfies (c ': cs :: [Atom d Constraint]) (tys :: LoT d) = (Interpret c tys, Satisfies cs tys) 

type family ContainsTyVar (v :: TyVar d k) (t :: Atom d p) :: Bool where ... #

Determines whether a given type variable v is used within an Atom t. If not, we know that the atom is constant with respect to that variable.

Equations

ContainsTyVar (v :: TyVar d p) ('Var v :: Atom d p) = 'True 
ContainsTyVar (v :: TyVar d k) ('Var w :: Atom d p) = 'False 
ContainsTyVar (v :: TyVar d k) ('Kon t :: Atom d p) = 'False 
ContainsTyVar (v :: TyVar d k) (f ':@: x :: Atom d p2) = Or (ContainsTyVar v f) (ContainsTyVar v x) 
ContainsTyVar (v :: TyVar d k) (x ':&: y :: Atom d Constraint) = Or (ContainsTyVar v x) (ContainsTyVar v y) 
ContainsTyVar (v :: TyVar d k) (c ':=>>: f :: Atom d Type) = Or (ContainsTyVar v c) (ContainsTyVar v f) 
ContainsTyVar (v :: TyVar xs k) ('ForAll f :: Atom xs Type) = ContainsTyVar ('VS v :: TyVar (x -> xs) k) f 

Auxiliary data types for interpretation

newtype ForAllI (f :: Atom (d1 -> d) Type) (tys :: LoT d) where #

Auxiliary type for interpretation of the ForAll atom. Required because a type family like Interpret cannot return a polymorphic type.

Constructors

ForAllI :: forall {d1} {d} (f :: Atom (d1 -> d) Type) (tys :: LoT d). (forall (t :: d1). Interpret f (t ':&&: tys)) -> ForAllI f tys 

newtype SuchThatI (c :: Atom d Constraint) (f :: Atom d Type) (tys :: LoT d) where #

Auxiliary type for interpretation of the (:=>>:) atom. Required because a type family like Interpret cannot return a type with constraints.

Constructors

SuchThatI 

Fields

newtype WrappedI (f :: Atom d Type) (tys :: LoT d) #

Records a value of type f applied to the list tys.

>>> :t WrapI [1] :: WrappedI ([] :$: Var0) (LoT1 Int)
WrapI [1] :: WrappedI ([] :$: Var0) (LoT1 Int)

Constructors

WrapI 

Fields

toWrappedI :: forall {d1} {ks} (f :: Atom (d1 -> ks) Type) (tys :: LoT ks) (t :: d1). ForAllI f tys -> WrappedI f (t ':&&: tys) #

fromWrappedI :: forall {d1} {d} (f :: Atom (d1 -> d) Type) (tys :: LoT d). (forall (t :: d1). WrappedI f (t ':&&: tys)) -> ForAllI f tys #