type-combinators-0.2.0.0: A collection of data types for type-level programming

CopyrightCopyright (C) 2015 Kyle Carter
LicenseBSD3
MaintainerKyle Carter <kylcarte@indiana.edu>
Stabilityexperimental
PortabilityRankNTypes
Safe HaskellNone
LanguageHaskell2010

Data.Type.Index

Description

A singleton-esque type for representing indices in a type-level list.

Documentation

data Index :: [k] -> k -> * where Source

Constructors

IZ :: Index (a :< as) a 
IS :: !(Index as a) -> Index (b :< as) a 

Instances

TestEquality k (Index k as) Source 
Show1 k (Index k as) Source 
Ord1 k (Index k as) Source 
Eq1 k (Index k as) Source 
Known k (Index k as) a => Known k (Index k ((:<) k b as)) a Source 
Known k (Index k ((:<) k a as)) a Source 
Read2 [k] k (Index k) Source 
IxTraversable1 [k] k (Index k) (Sum k) Source 
IxTraversable1 [k] k (Index k) (Prod k) Source 
IxFoldable1 [k] k (Index k) (Sum k) Source 
IxFoldable1 [k] k (Index k) (Prod k) Source 
IxFunctor1 [k] k (Index k) (Sum k) Source 
IxFunctor1 [k] k (Index k) (Prod k) Source 
Eq (Index k as a) Source 
Ord (Index k as a) Source 
Show (Index k as a) Source 
type KnownC k (Index k ((:<) k b as)) a = ØC 
type KnownC k (Index k ((:<) k a as)) a = ØC 

elimIndex :: (forall xs. p (a :< xs) a) -> (forall x xs. Index xs a -> p xs a -> p (x :< xs) a) -> Index as a -> p as a Source

onIxPred :: (Index as a -> Index bs a) -> Index (b :< as) a -> Index (b :< bs) a Source

type (∈) a as = Elem as a infix 6 Source

class Elem as a where Source

Methods

elemIndex :: Index as a Source

Instances

Elem k as a => Elem k ((:<) k b as) a Source 
Elem k ((:<) k a as) a Source