type-combinators-0.1.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.Product

Description

Type combinators for type-level lists, lifting (f :: k -> *) to (Prod f :: [k] -> *), as well as its constructions, manipulations, and eliminations.

Prod is similar in nature to a few others in the Haskell ecosystem, such as:

Oleg's HList, from http://hackage.haskell.org/package/HList, and

Kenneth Foner's ConicList, from http://hackage.haskell.org/package/IndexedList-0.1.0.1/docs/Data-List-Indexed-Conic.html.

Documentation

data Prod f :: [k] -> * where Source

Constructors

Ø :: Prod f Ø 
(:<) :: !(f a) -> !(Prod f as) -> Prod f (a :< as) infixr 5 

Instances

Witness ØC ØC (Prod k f (Ø k)) Source 
HTraversable k [k] (Prod k) Source 
HFoldable k [k] (Prod k) Source 
HFunctor k [k] (Prod k) Source 
HIxFoldable [k] k (Index k) (Prod k) Source 
HIxFunctor [k] k (Index k) (Prod k) Source 
Known [k] (Prod k f) (Ø k) Source 
(Known k f a, Known [k] (Prod k f) as) => Known [k] (Prod k f) ((:<) k a as) Source 
(Witness p q (f a), Witness s t (Prod k f as)) => Witness (p, s) (q, t) (Prod k f ((:<) k a as)) Source 
type WitnessC ØC ØC (Prod k f (Ø k)) = ØC 
type KnownC [k] (Prod k f) (Ø k) = ØC 
type KnownC [k] (Prod k f) ((:<) k a as) = (Known k f a, Known [k] (Prod k f) as) Source 
type WitnessC (p, s) (q, t) (Prod k f ((:<) k a as)) = (Witness p q (f a), Witness s t (Prod k f as)) Source 

pattern (:>) :: f a -> f b -> Prod k f ((:) k a ((:) k b ([] k))) infix 6 Source

only :: f a -> Prod f `[a]` Source

head' :: Prod f (a :< as) -> f a Source

tail' :: Prod f (a :< as) -> Prod f as Source

(>:) :: Prod f as -> f a -> Prod f (as >: a) infixl 6 Source

reverse' :: Prod f as -> Prod f (Reverse as) Source

init' :: Prod f (a :< as) -> Prod f (Init' a as) Source

last' :: Prod f (a :< as) -> f (Last' a as) Source

append' :: Prod f as -> Prod f bs -> Prod f (as ++ bs) Source

onHead' :: (f a -> f b) -> Prod f (a :< as) -> Prod f (b :< as) Source

onTail' :: (Prod f as -> Prod f bs) -> Prod f (a :< as) -> Prod f (a :< bs) Source

uncurry' :: (f a -> Prod f as -> r) -> Prod f (a :< as) -> r Source

curry' :: (l ~ (a :< as)) => (Prod f l -> r) -> f a -> Prod f as -> r Source

index :: Index as a -> Prod f as -> f a Source