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

Safe HaskellNone
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 #

Methods

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

toK :: RepK Tree (a :&&: LoT0) -> Tree :@@: (a :&&: LoT0) 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 = (Field (Tree :$: (Var0 :: Atom (Type -> Type) Type)) :*: Field (Tree :$: (Var0 :: Atom (Type -> Type) Type))) :+: Field (Var0 :: 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 #

Methods

fromK :: (HappyFamily [a] :@@: LoT0) -> RepK (HappyFamily [a]) LoT0 Source #

toK :: RepK (HappyFamily [a]) LoT0 -> HappyFamily [a] :@@: LoT0 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 #

Methods

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

toK :: RepK (HappyFamily (Maybe a)) LoT0 -> HappyFamily (Maybe a) :@@: LoT0 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 #

Methods

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

toK :: RepK HappyFamily (a :&&: LoT0) -> HappyFamily :@@: (a :&&: LoT0) 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) = Field (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) = Field (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 SimpleIndex :: * -> * -> * where Source #

Constructors

MkSimpleIndex :: [a] -> SimpleIndex [a] b 
Instances
GenericK (SimpleIndex a b :: Type) LoT0 Source # 
Instance details

Defined in Generics.Kind.Examples

Associated Types

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

Methods

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

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

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

Defined in Generics.Kind.Examples

Associated Types

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

Methods

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

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

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

Defined in Generics.Kind.Examples

Associated Types

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

Methods

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

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

type RepK (SimpleIndex a b :: Type) Source # 
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)))
type RepK SimpleIndex Source # 
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)))
type RepK (SimpleIndex a :: Type -> Type) Source # 
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)))

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 #

Methods

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

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

type RepK WeirdTree Source # 
Instance details

Defined in Generics.Kind.Examples

type RepK WeirdTree = (Field (WeirdTree :$: (Var0 :: Atom (Type -> Type) Type)) :*: Field (WeirdTree :$: (Var0 :: Atom (Type -> Type) Type))) :+: Exists Type ((Show :$: (Var1 :: Atom (Type -> Type -> Type) Type)) :=>: (Field (Var0 :: Atom (Type -> Type -> Type) Type) :*: Field (Var1 :: 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 #

Methods

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

toK :: RepK (WeirdTreeR a) LoT0 -> WeirdTreeR a :@@: LoT0 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 #

Methods

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

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

type RepK (WeirdTreeR a :: Type) Source # 
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)))
type RepK WeirdTreeR Source # 
Instance details

Defined in Generics.Kind.Examples

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

data T (a :: k) where Source #

Constructors

MkT :: forall (a :: *). Maybe a -> T a 
Instances
GenericK (T :: k -> Type) (a :&&: LoT0 :: LoT (k -> Type)) Source # 
Instance details

Defined in Generics.Kind.Examples

Associated Types

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

Methods

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

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

type RepK (T :: k -> Type) Source # 
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)))

data P k (a :: k) where Source #

Constructors

P :: forall k (a :: k). P k a 
Instances
GenericK (P k :: k -> Type) (a :&&: LoT0 :: LoT (k -> Type)) Source # 
Instance details

Defined in Generics.Kind.Examples

Associated Types

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

Methods

fromK :: (P k :@@: (a :&&: LoT0)) -> RepK (P k) (a :&&: LoT0) Source #

toK :: RepK (P k) (a :&&: LoT0) -> P k :@@: (a :&&: LoT0) Source #

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

Defined in Generics.Kind.Examples

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

data P' j (a :: k) where Source #

Constructors

P' :: forall k (a :: k). P' k a 
Instances
GenericK (P' :: Type -> k -> Type) (j :&&: (a :&&: LoT0) :: LoT (Type -> k -> Type)) Source # 
Instance details

Defined in Generics.Kind.Examples

Associated Types

type RepK P' :: LoT k -> Type Source #

Methods

fromK :: (P' :@@: (j :&&: (a :&&: LoT0))) -> RepK P' (j :&&: (a :&&: LoT0)) Source #

toK :: RepK P' (j :&&: (a :&&: LoT0)) -> P' :@@: (j :&&: (a :&&: LoT0)) Source #

GenericK (P' j :: k -> Type) (a :&&: LoT0 :: LoT (k -> Type)) Source # 
Instance details

Defined in Generics.Kind.Examples

Associated Types

type RepK (P' j) :: LoT k -> Type Source #

Methods

fromK :: (P' j :@@: (a :&&: LoT0)) -> RepK (P' j) (a :&&: LoT0) Source #

toK :: RepK (P' j) (a :&&: LoT0) -> P' j :@@: (a :&&: LoT0) Source #

type RepK (P' :: Type -> k -> Type) Source # 
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)
type RepK (P' j :: k -> Type) Source # 
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)

data Ranky Source #

Constructors

MkRanky (forall a. a -> a) 
Instances
GenericK Ranky LoT0 Source # 
Instance details

Defined in Generics.Kind.Examples

Associated Types

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

Methods

fromK :: (Ranky :@@: LoT0) -> RepK Ranky LoT0 Source #

toK :: RepK Ranky LoT0 -> Ranky :@@: LoT0 Source #

type RepK Ranky Source # 
Instance details

Defined in Generics.Kind.Examples

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

newtype Ranky2 b Source #

Constructors

MkRanky2 ((forall a. a -> a) -> b) 
Instances
GenericK Ranky2 (b :&&: LoT0 :: LoT (Type -> Type)) Source # 
Instance details

Defined in Generics.Kind.Examples

Associated Types

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

Methods

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

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

type RepK Ranky2 Source # 
Instance details

Defined in Generics.Kind.Examples

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

data Shower a where Source #

Constructors

MkShower :: (Show a => a -> String) -> Shower a 
Instances
GenericK Shower (a :&&: LoT0 :: LoT (Type -> Type)) Source # 
Instance details

Defined in Generics.Kind.Examples

Associated Types

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

Methods

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

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

type RepK Shower Source # 
Instance details

Defined in Generics.Kind.Examples

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

data Unboxed1 Source #

Constructors

MkUnboxed1 (#Int, Int#) 

Orphan instances

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

Associated Types

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

Methods

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

toK :: RepK (Maybe a) LoT0 -> Maybe a :@@: LoT0 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 #

Methods

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

toK :: RepK Maybe (a :&&: LoT0) -> Maybe :@@: (a :&&: LoT0) 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 #