Hoogle Search

Within LTS Haskell 22.21 (ghc-9.6.5)

Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.

  1. module Data.Vector.Unboxed

    Adaptive unboxed vectors. The implementation is based on type families and picks an efficient, specialised representation for every element type. For example, unboxed vectors of pairs are represented as pairs of unboxed vectors. Implementing unboxed vectors for new data types can be very easy. Here is how the library does this for Complex by simply wrapping vectors of pairs.

    newtype instance MVector s (Complex a) = MV_Complex (MVector s (a,a))
    newtype instance Vector    (Complex a) = V_Complex  (Vector    (a,a))
    
    instance (RealFloat a, Unbox a) => MVector MVector (Complex a) where
    {-# INLINE basicLength #-}
    basicLength (MV_Complex v) = basicLength v
    ...
    
    instance (RealFloat a, Unbox a) => Data.Vector.Generic.Vector Vector (Complex a) where
    {-# INLINE basicLength #-}
    basicLength (V_Complex v) = Data.Vector.Generic.basicLength v
    ...
    
    instance (RealFloat a, Unbox a) => Unbox (Complex a)
    
    For newtypes, defining instances is easier since one could use GeneralizedNewtypeDeriving in order to derive instances for Vector and MVector, since they're very cumbersome to write by hand:
    >>> :set -XTypeFamilies -XStandaloneDeriving -XMultiParamTypeClasses -XGeneralizedNewtypeDeriving
    
    >>> 
    
    >>> import qualified Data.Vector.Generic         as VG
    
    >>> import qualified Data.Vector.Generic.Mutable as VGM
    
    >>> import qualified Data.Vector.Unboxed         as VU
    
    >>> 
    
    >>> newtype Foo = Foo Int
    
    >>> 
    
    >>> newtype instance VU.MVector s Foo = MV_Int (VU.MVector s Int)
    
    >>> newtype instance VU.Vector    Foo = V_Int  (VU.Vector    Int)
    
    >>> deriving instance VGM.MVector VU.MVector Foo
    
    >>> deriving instance VG.Vector   VU.Vector  Foo
    
    >>> instance VU.Unbox Foo
    

  2. module Data.Vector.Unboxed

    No documentation available.

  3. module Rebase.Data.Vector.Unboxed

    No documentation available.

  4. module Data.Vector.Fixed.Unboxed

    Unboxed vectors with fixed length.

  5. coercionWithUnboxedVector :: (Unboxable a, Rep a ~ a, IsTrivial a ~ 'True) => Coercion (Vector a) (Vector a)

    unboxing-vector Data.Vector.Unboxing

    No documentation available.

  6. fromUnboxedVector :: (Unboxable a, Rep a ~ a, IsTrivial a ~ 'True) => Vector a -> Vector a

    unboxing-vector Data.Vector.Unboxing

    No documentation available.

  7. toUnboxedVector :: (Unboxable a, Rep a ~ a, IsTrivial a ~ 'True) => Vector a -> Vector a

    unboxing-vector Data.Vector.Unboxing

    No documentation available.

  8. coercionWithUnboxedMVector :: (Unboxable a, Rep a ~ a, IsTrivial a ~ 'True) => Coercion (MVector s a) (MVector s a)

    unboxing-vector Data.Vector.Unboxing.Mutable

    No documentation available.

  9. fromUnboxedMVector :: (Unboxable a, Rep a ~ a, IsTrivial a ~ 'True) => MVector s a -> MVector s a

    unboxing-vector Data.Vector.Unboxing.Mutable

    No documentation available.

  10. toUnboxedMVector :: (Unboxable a, Rep a ~ a, IsTrivial a ~ 'True) => MVector s a -> MVector s a

    unboxing-vector Data.Vector.Unboxing.Mutable

    No documentation available.

Page 1 of 2 | Next