vector-heterogenous-0.1.0: A type-safe library for vectors whose elements can be of any type, or any type satisfying some constraints

Safe HaskellNone

Data.Vector.Heterogenous.HList

Contents

Synopsis

Heterogenous List

data HList whereSource

The heterogenous list

Constructors

HNil :: HList `[]` 
::: :: t -> HList ts -> HList (t : ts) 

Instances

(Eq x, Eq (HList xs)) => Eq (HList (: * x xs)) 
Eq (HList ([] *)) 
(Ord x, Ord (HList xs)) => Ord (HList (: * x xs)) 
Ord (HList ([] *)) 
(Show x, Show (HList xs)) => Show (HList (: * x xs)) 
Show (HList ([] *)) 
(Monoid x, Monoid (HList xs)) => Monoid (HList (: * x xs)) 
Monoid (HList ([] *)) 
HLength (HList xs) => HLength (HList (: * x xs)) 
HLength (HList ([] *)) 
(ConstraintBox box x, Downcast (HList xs) box) => Downcast (HList (: * x xs)) box 
Downcast (HList ([] *)) a 

class HLength xs whereSource

Used only for the HList class to determine its length

Methods

hlength :: xs -> IntSource

Instances

HLength (HList xs) => HLength (HList (: * x xs)) 
HLength (HList ([] *)) 

class List2HList x xs whereSource

For construction from lists

Methods

list2hlist :: [x] -> HList (x : xs)Source

Instances

List2HList x ([] *) 
List2HList x xs => List2HList x (: * x xs) 

Downcasting

class ConstraintBox box a whereSource

Methods

box :: a -> boxSource

unsafeUnbox :: box -> aSource

Instances

class Downcast h box whereSource

Methods

downcast :: h -> [box]Source

downcastAs :: (a -> box) -> h -> [box]Source

Instances

(ConstraintBox box x, Downcast (HList xs) box) => Downcast (HList (: * x xs)) box 
Downcast (HList ([] *)) a 

Boxes

data ShowBox Source

Use this box unless you know for certain that your types won't have a show instance.

Constructors

forall a . Show a => ShowBox !a 

data AnyBox Source

Most generic box, can be used on any type.

Constructors

forall a . AnyBox !a 

Type functions

HList

type family HCons x xs :: *Source

type family UnHList xs :: [a]Source

Type Lists

type family Distribute xs t :: [b]Source

type family Replicate n x :: [a]Source

type family Map f xs :: [a]Source

type family Reverse xs :: [a]Source

type family xs :! i :: aSource

type family xs (++) ys :: [a]Source

type family f ($) a :: bSource

type family Concat xs :: [a]Source

type family Length xs :: NatSource

Type Nats

data Nat1 Source

Constructors

Zero 
Succ Nat1 

type family ToNat1 n :: Nat1Source

type family FromNat1 n :: NatSource