numerical-0.0.0.0: core package for Numerical Haskell project

Safe HaskellNone
LanguageHaskell2010

Numerical.Data.Vector.HPair

Description

This module is pretty cool because it gives you a way to talk about heterogeneous representations for different columns!

might be replaced with an HList of Vectors approach

Documentation

data VHProd (prd :: HProd (* -> *)) val where Source #

Constructors

VHLeaf :: !(v a) -> VHProd (HUnit v) a 
VHNode :: !(VHProd pra a) -> !(VHProd prb b) -> VHProd (HPair pra prb) (a, b) 
Instances
(MVector (MVHProd (HUnit (Mutable v))) a, Vector v a) => Vector (VHProd (HUnit v)) a Source # 
Instance details

Defined in Numerical.Data.Vector.HPair

Methods

basicUnsafeFreeze :: PrimMonad m => Mutable (VHProd (HUnit v)) (PrimState m) a -> m (VHProd (HUnit v) a) #

basicUnsafeThaw :: PrimMonad m => VHProd (HUnit v) a -> m (Mutable (VHProd (HUnit v)) (PrimState m) a) #

basicLength :: VHProd (HUnit v) a -> Int #

basicUnsafeSlice :: Int -> Int -> VHProd (HUnit v) a -> VHProd (HUnit v) a #

basicUnsafeIndexM :: Monad m => VHProd (HUnit v) a -> Int -> m a #

basicUnsafeCopy :: PrimMonad m => Mutable (VHProd (HUnit v)) (PrimState m) a -> VHProd (HUnit v) a -> m () #

elemseq :: VHProd (HUnit v) a -> a -> b -> b #

(MVector (MVHProd (MutableHProdTree (HPair pa pb))) (a, b), Vector (VHProd pa) a, Vector (VHProd pb) b) => Vector (VHProd (HPair pa pb)) (a, b) Source # 
Instance details

Defined in Numerical.Data.Vector.HPair

Methods

basicUnsafeFreeze :: PrimMonad m => Mutable (VHProd (HPair pa pb)) (PrimState m) (a, b) -> m (VHProd (HPair pa pb) (a, b)) #

basicUnsafeThaw :: PrimMonad m => VHProd (HPair pa pb) (a, b) -> m (Mutable (VHProd (HPair pa pb)) (PrimState m) (a, b)) #

basicLength :: VHProd (HPair pa pb) (a, b) -> Int #

basicUnsafeSlice :: Int -> Int -> VHProd (HPair pa pb) (a, b) -> VHProd (HPair pa pb) (a, b) #

basicUnsafeIndexM :: Monad m => VHProd (HPair pa pb) (a, b) -> Int -> m (a, b) #

basicUnsafeCopy :: PrimMonad m => Mutable (VHProd (HPair pa pb)) (PrimState m) (a, b) -> VHProd (HPair pa pb) (a, b) -> m () #

elemseq :: VHProd (HPair pa pb) (a, b) -> (a, b) -> b0 -> b0 #

type Mutable (VHProd prod) Source # 
Instance details

Defined in Numerical.Data.Vector.HPair

type Mutable (VHProd prod) = MVHProd (MutableHProdTree prod)

vHPair :: (va a, vb b) -> VHProd (HPair (HUnit va) (HUnit vb)) (a, b) Source #

vUnHPair :: VHProd (HPair (HUnit va) (HUnit vb)) (a, b) -> (va a, vb b) Source #

data MVHProd (prd :: HProd (* -> * -> *)) (st :: *) val where Source #

Constructors

MVHLeaf :: !(mv st a) -> MVHProd (HUnit mv) st a 
MVHNode :: !(MVHProd pra st a) -> !(MVHProd prb st b) -> MVHProd (HPair pra prb) st (a, b) 
Instances
MVector mv a => MVector (MVHProd (HUnit mv)) a Source # 
Instance details

Defined in Numerical.Data.Vector.HPair

Methods

basicLength :: MVHProd (HUnit mv) s a -> Int #

basicUnsafeSlice :: Int -> Int -> MVHProd (HUnit mv) s a -> MVHProd (HUnit mv) s a #

basicOverlaps :: MVHProd (HUnit mv) s a -> MVHProd (HUnit mv) s a -> Bool #

basicUnsafeNew :: PrimMonad m => Int -> m (MVHProd (HUnit mv) (PrimState m) a) #

basicInitialize :: PrimMonad m => MVHProd (HUnit mv) (PrimState m) a -> m () #

basicUnsafeReplicate :: PrimMonad m => Int -> a -> m (MVHProd (HUnit mv) (PrimState m) a) #

basicUnsafeRead :: PrimMonad m => MVHProd (HUnit mv) (PrimState m) a -> Int -> m a #

basicUnsafeWrite :: PrimMonad m => MVHProd (HUnit mv) (PrimState m) a -> Int -> a -> m () #

basicClear :: PrimMonad m => MVHProd (HUnit mv) (PrimState m) a -> m () #

basicSet :: PrimMonad m => MVHProd (HUnit mv) (PrimState m) a -> a -> m () #

basicUnsafeCopy :: PrimMonad m => MVHProd (HUnit mv) (PrimState m) a -> MVHProd (HUnit mv) (PrimState m) a -> m () #

basicUnsafeMove :: PrimMonad m => MVHProd (HUnit mv) (PrimState m) a -> MVHProd (HUnit mv) (PrimState m) a -> m () #

basicUnsafeGrow :: PrimMonad m => MVHProd (HUnit mv) (PrimState m) a -> Int -> m (MVHProd (HUnit mv) (PrimState m) a) #

(MVector (MVHProd pra) a, MVector (MVHProd prb) b) => MVector (MVHProd (HPair pra prb)) (a, b) Source # 
Instance details

Defined in Numerical.Data.Vector.HPair

Methods

basicLength :: MVHProd (HPair pra prb) s (a, b) -> Int #

basicUnsafeSlice :: Int -> Int -> MVHProd (HPair pra prb) s (a, b) -> MVHProd (HPair pra prb) s (a, b) #

basicOverlaps :: MVHProd (HPair pra prb) s (a, b) -> MVHProd (HPair pra prb) s (a, b) -> Bool #

basicUnsafeNew :: PrimMonad m => Int -> m (MVHProd (HPair pra prb) (PrimState m) (a, b)) #

basicInitialize :: PrimMonad m => MVHProd (HPair pra prb) (PrimState m) (a, b) -> m () #

basicUnsafeReplicate :: PrimMonad m => Int -> (a, b) -> m (MVHProd (HPair pra prb) (PrimState m) (a, b)) #

basicUnsafeRead :: PrimMonad m => MVHProd (HPair pra prb) (PrimState m) (a, b) -> Int -> m (a, b) #

basicUnsafeWrite :: PrimMonad m => MVHProd (HPair pra prb) (PrimState m) (a, b) -> Int -> (a, b) -> m () #

basicClear :: PrimMonad m => MVHProd (HPair pra prb) (PrimState m) (a, b) -> m () #

basicSet :: PrimMonad m => MVHProd (HPair pra prb) (PrimState m) (a, b) -> (a, b) -> m () #

basicUnsafeCopy :: PrimMonad m => MVHProd (HPair pra prb) (PrimState m) (a, b) -> MVHProd (HPair pra prb) (PrimState m) (a, b) -> m () #

basicUnsafeMove :: PrimMonad m => MVHProd (HPair pra prb) (PrimState m) (a, b) -> MVHProd (HPair pra prb) (PrimState m) (a, b) -> m () #

basicUnsafeGrow :: PrimMonad m => MVHProd (HPair pra prb) (PrimState m) (a, b) -> Int -> m (MVHProd (HPair pra prb) (PrimState m) (a, b)) #

data HProd a where Source #

Constructors

HPair :: HProd a -> HProd a -> HProd a 
HUnit :: a -> HProd a 

type family MutableHProdTree (a :: HProd (* -> *)) = r | r -> a where ... Source #

type family TransformHProdTree (f :: k -> m) (a :: HProd k) :: HProd m where ... Source #

Equations

TransformHProdTree f (HUnit v) = HUnit (f v) 
TransformHProdTree f (HPair left right) = HPair (TransformHProdTree f left) (TransformHProdTree f right)