kind-generics-0.2.1.0: Generic programming in GHC style for arbitrary kinds and GADTs.

Safe HaskellSafe
LanguageHaskell2010

Generics.Kind.Examples

Contents

Documentation

data Tree a Source #

Constructors

Branch (Tree a) (Tree a) 
Leaf a 
Instances
Generic (Tree a) Source # 
Instance details

Defined in Generics.Kind.Examples

Associated Types

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

Methods

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

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

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

Defined in Generics.Kind.Examples

Associated Types

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

Methods

fromK :: (Tree a :@@: LoT0) -> RepK (Tree a) LoT0 Source #

toK :: RepK (Tree a) LoT0 -> Tree a :@@: LoT0 Source #

GenericK Tree (a :&&: LoT0 :: LoT (Type -> Type)) Source # 
Instance details

Defined in Generics.Kind.Examples

Associated Types

type RepK Tree :: LoT k -> Type Source #

type Rep (Tree a) Source # 
Instance details

Defined in Generics.Kind.Examples

type RepK (Tree a :: Type) Source # 
Instance details

Defined in Generics.Kind.Examples

type RepK (Tree a :: Type) = SubstRep (RepK Tree) a
type RepK Tree Source # 
Instance details

Defined in Generics.Kind.Examples

type RepK Tree = (F (Tree :$: (V0 :: Atom (Type -> Type) Type)) :*: F (Tree :$: (V0 :: Atom (Type -> Type) Type))) :+: F (V0 :: Atom (Type -> Type) Type)

data family HappyFamily t Source #

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

Defined in Generics.Kind.Examples

Associated Types

type RepK (HappyFamily [a]) :: LoT k -> Type Source #

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

Defined in Generics.Kind.Examples

Associated Types

type RepK (HappyFamily (Maybe a)) :: LoT k -> Type Source #

GenericK HappyFamily (a :&&: LoT0 :: LoT (Type -> Type)) Source # 
Instance details

Defined in Generics.Kind.Examples

Associated Types

type RepK HappyFamily :: LoT k -> Type Source #

data HappyFamily [a] Source # 
Instance details

Defined in Generics.Kind.Examples

data HappyFamily [a] = HFL a
data HappyFamily (Maybe a) Source # 
Instance details

Defined in Generics.Kind.Examples

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

Defined in Generics.Kind.Examples

type RepK (HappyFamily [a] :: Type) = F (Kon a :: Atom Type Type)
type RepK (HappyFamily (Maybe a) :: Type) Source # 
Instance details

Defined in Generics.Kind.Examples

type RepK (HappyFamily (Maybe a) :: Type) = F (Kon Bool :: Atom Type Type)
type RepK HappyFamily Source # 
Instance details

Defined in Generics.Kind.Examples

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

data WeirdTree a where Source #

Constructors

WeirdBranch :: WeirdTree a -> WeirdTree a -> WeirdTree a 
WeirdLeaf :: Show a => t -> a -> WeirdTree a 
Instances
GenericK WeirdTree (a :&&: LoT0 :: LoT (Type -> Type)) Source # 
Instance details

Defined in Generics.Kind.Examples

Associated Types

type RepK WeirdTree :: LoT k -> Type Source #

type RepK WeirdTree Source # 
Instance details

Defined in Generics.Kind.Examples

type RepK WeirdTree = (F (WeirdTree :$: (V0 :: Atom (Type -> Type) Type)) :*: F (WeirdTree :$: (V0 :: Atom (Type -> Type) Type))) :+: E ((Show :$: (V1 :: Atom (Type -> Type -> Type) Type)) :=>: (F (V0 :: Atom (Type -> Type -> Type) Type) :*: F (V1 :: Atom (Type -> Type -> Type) Type)))

data WeirdTreeR a where Source #

Constructors

WeirdBranchR :: WeirdTreeR a -> WeirdTreeR a -> WeirdTreeR a 
WeirdLeafR :: (Show a, Eq t, Typeable t) => t -> a -> WeirdTreeR a 
Instances
GenericK (WeirdTreeR a :: Type) LoT0 Source # 
Instance details

Defined in Generics.Kind.Examples

Associated Types

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

GenericK WeirdTreeR (a :&&: LoT0 :: LoT (Type -> Type)) Source # 
Instance details

Defined in Generics.Kind.Examples

Associated Types

type RepK WeirdTreeR :: LoT k -> Type Source #

type RepK (WeirdTreeR a :: Type) Source # 
Instance details

Defined in Generics.Kind.Examples

type RepK (WeirdTreeR a :: Type) = (F (Kon (WeirdTreeR a) :: Atom Type Type) :*: F (Kon (WeirdTreeR a) :: Atom Type Type)) :+: E (((Kon (Show a) :: Atom (Type -> Type) Constraint) :&: ((Eq :$: (V0 :: Atom (Type -> Type) Type)) :&: ((Typeable :: Type -> Constraint) :$: (V0 :: Atom (Type -> Type) Type)))) :=>: (F (V0 :: Atom (Type -> Type) Type) :*: F (Kon a :: Atom (Type -> Type) Type)))
type RepK WeirdTreeR Source # 
Instance details

Defined in Generics.Kind.Examples

type RepK WeirdTreeR = (F (WeirdTreeR :$: (V0 :: Atom (Type -> Type) Type)) :*: F (WeirdTreeR :$: (V0 :: Atom (Type -> Type) Type))) :+: E (((Show :$: (V1 :: Atom (Type -> Type -> Type) Type)) :&: ((Eq :$: (V0 :: Atom (Type -> Type -> Type) Type)) :&: ((Typeable :: Type -> Constraint) :$: (V0 :: Atom (Type -> Type -> Type) Type)))) :=>: (F (V0 :: Atom (Type -> Type -> Type) Type) :*: F (V1 :: Atom (Type -> Type -> Type) Type)))

Orphan instances

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

Associated Types

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

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

Associated Types

type RepK (Either a b) :: LoT k -> Type Source #

Methods

fromK :: (Either a b :@@: LoT0) -> RepK (Either a b) LoT0 Source #

toK :: RepK (Either a b) LoT0 -> Either a b :@@: LoT0 Source #

GenericK Either (a :&&: (b :&&: LoT0) :: LoT (Type -> Type -> Type)) Source # 
Instance details

Associated Types

type RepK Either :: LoT k -> Type Source #

Methods

fromK :: (Either :@@: (a :&&: (b :&&: LoT0))) -> RepK Either (a :&&: (b :&&: LoT0)) Source #

toK :: RepK Either (a :&&: (b :&&: LoT0)) -> Either :@@: (a :&&: (b :&&: LoT0)) Source #

GenericK Maybe (a :&&: LoT0 :: LoT (Type -> Type)) Source # 
Instance details

Associated Types

type RepK Maybe :: LoT k -> Type Source #

GenericK (Either a :: Type -> Type) (b :&&: LoT0 :: LoT (Type -> Type)) Source # 
Instance details

Associated Types

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

Methods

fromK :: (Either a :@@: (b :&&: LoT0)) -> RepK (Either a) (b :&&: LoT0) Source #

toK :: RepK (Either a) (b :&&: LoT0) -> Either a :@@: (b :&&: LoT0) Source #