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

Safe HaskellNone
LanguageHaskell98

Data.Vector.Heterogenous

Contents

Description

Heterogenous vectors. For more info on heterogenous collections, see http://www.haskell.org/haskellwiki/Heterogenous_collections

Synopsis

Documentation

newtype HVector box xs Source

Constructors

HVector 

Fields

getvec :: Vector box
 

Instances

Show box => Show (HVector k box xs) 
(Monoid (HList xs), Downcast (HList xs) box, HLength (HList xs), HListBuilder (Indexer (HVector * box xs)) (HList xs)) => Monoid (HVector * box xs) 
(View (Indexer (HVector k box xs)) (Empty Nat1 (ToNat1 n)) ret, KnownNat n) => View (HVector k box xs) (proxy n) ret 

vec :: (HLength (HList xs), Downcast (HList xs) box) => (a -> box) -> HList xs -> HVector box (xs :: [*]) Source

creates an HVector from an HList. For example:

class View vec i ret | vec i -> ret where Source

Methods

view :: vec -> i -> ret Source

Instances

(View (Indexer (HVector k box xs)) (Empty Nat1 (ToNat1 n)) ret, KnownNat n) => View (HVector k box xs) (proxy n) ret 

Construction helpers

class (Downcast (HList xs) box, HLength (HList xs), HListBuilder (Indexer (HVector box xs)) (HList xs)) => ValidHVector box xs Source

Instances

(Downcast (HList xs) box, HLength (HList xs), HListBuilder (Indexer (HVector * box xs)) (HList xs)) => ValidHVector box xs 

toHList :: HListBuilder (Indexer (HVector box xs)) ys => HVector box xs -> ys Source

Modules