kind-generics-0.4.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) Source # 
Instance details

Defined in Generics.Kind.Examples

Associated Types

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

Methods

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

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

GenericK Tree Source # 
Instance details

Defined in Generics.Kind.Examples

Associated Types

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

Methods

fromK :: (Tree :@@: x) -> RepK Tree x Source #

toK :: RepK Tree x -> Tree :@@: x 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) Source # 
Instance details

Defined in Generics.Kind.Examples

Associated Types

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

Methods

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

toK :: RepK (HappyFamily [a]) x -> HappyFamily [a] :@@: x Source #

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

Defined in Generics.Kind.Examples

Associated Types

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

Methods

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

toK :: RepK (HappyFamily (Maybe a)) x -> HappyFamily (Maybe a) :@@: x Source #

GenericK HappyFamily 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) = 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) Source # 
Instance details

Defined in Generics.Kind.Examples

Associated Types

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

Methods

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

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

GenericK SimpleIndex Source # 
Instance details

Defined in Generics.Kind.Examples

Associated Types

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

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

Defined in Generics.Kind.Examples

Associated Types

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

Methods

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

toK :: RepK (SimpleIndex a) x -> SimpleIndex a :@@: x 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 Source # 
Instance details

Defined in Generics.Kind.Examples

Associated Types

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

Methods

fromK :: (WeirdTree :@@: x) -> RepK WeirdTree x Source #

toK :: RepK WeirdTree x -> WeirdTree :@@: x 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) Source # 
Instance details

Defined in Generics.Kind.Examples

Associated Types

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

Methods

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

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

GenericK WeirdTreeR Source # 
Instance details

Defined in Generics.Kind.Examples

Associated Types

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

Methods

fromK :: (WeirdTreeR :@@: x) -> RepK WeirdTreeR x Source #

toK :: RepK WeirdTreeR x -> WeirdTreeR :@@: x 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 TTY m a where Source #

Constructors

WriteTTY :: String -> TTY m () 
ReadTTY :: TTY m String 
Instances
GenericK (TTY m a :: Type) Source # 
Instance details

Defined in Generics.Kind.Examples

Associated Types

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

Methods

fromK :: (TTY m a :@@: x) -> RepK (TTY m a) x Source #

toK :: RepK (TTY m a) x -> TTY m a :@@: x Source #

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

data T (a :: k) where Source #

Constructors

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

Defined in Generics.Kind.Examples

Associated Types

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

Methods

fromK :: (T :@@: x) -> RepK T x Source #

toK :: RepK T x -> T :@@: x 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) Source # 
Instance details

Defined in Generics.Kind.Examples

Associated Types

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

Methods

fromK :: (P k :@@: x) -> RepK (P k) x Source #

toK :: RepK (P k) x -> P k :@@: x 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) Source # 
Instance details

Defined in Generics.Kind.Examples

Associated Types

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

Methods

fromK :: (P' :@@: x) -> RepK P' x Source #

toK :: RepK P' x -> P' :@@: x Source #

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

Defined in Generics.Kind.Examples

Associated Types

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

Methods

fromK :: (P' j :@@: x) -> RepK (P' j) x Source #

toK :: RepK (P' j) x -> P' j :@@: x 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 Source # 
Instance details

Defined in Generics.Kind.Examples

Associated Types

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

Methods

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

toK :: RepK Ranky x -> Ranky :@@: x 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 Source # 
Instance details

Defined in Generics.Kind.Examples

Associated Types

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

Methods

fromK :: (Ranky2 :@@: x) -> RepK Ranky2 x Source #

toK :: RepK Ranky2 x -> Ranky2 :@@: x 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 Source # 
Instance details

Defined in Generics.Kind.Examples

Associated Types

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

Methods

fromK :: (Shower :@@: x) -> RepK Shower x Source #

toK :: RepK Shower x -> Shower :@@: x 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 ([a] :: Type) Source # 
Instance details

Associated Types

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

Methods

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

toK :: RepK [a] x -> [a] :@@: x Source #

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

Associated Types

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

Methods

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

toK :: RepK (Maybe a) x -> Maybe a :@@: x Source #

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

Associated Types

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

Methods

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

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

GenericK Either Source # 
Instance details

Associated Types

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

Methods

fromK :: (Either :@@: x) -> RepK Either x Source #

toK :: RepK Either x -> Either :@@: x Source #

GenericK [] Source # 
Instance details

Associated Types

type RepK [] :: LoT k -> Type Source #

Methods

fromK :: ([] :@@: x) -> RepK [] x Source #

toK :: RepK [] x -> [] :@@: x Source #

GenericK Maybe Source # 
Instance details

Associated Types

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

Methods

fromK :: (Maybe :@@: x) -> RepK Maybe x Source #

toK :: RepK Maybe x -> Maybe :@@: x Source #

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

Associated Types

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

Methods

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

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