Hoogle Search

Within LTS Haskell 24.40 (ghc-9.10.3)

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

  1. unsafeArrayToForeignPtr :: Index ix => Array S ix e -> (ForeignPtr e, Int)

    massiv Data.Massiv.Array.Unsafe

    O(1) - Yield the underlying ForeignPtr together with its length.

  2. unsafeMArrayFromForeignPtr :: Storable e => ForeignPtr e -> Int -> Sz1 -> MArray s S Ix1 e

    massiv Data.Massiv.Array.Unsafe

    O(1) - Wrap a ForeignPtr, an offset and it's size into a mutable storable array. It is still safe to modify the pointer, unless the array gets frozen prior to modification.

  3. unsafeMArrayFromForeignPtr0 :: ForeignPtr e -> Sz1 -> MArray s S Ix1 e

    massiv Data.Massiv.Array.Unsafe

    O(1) - Wrap a ForeignPtr and it's size into a mutable storable array. It is still safe to modify the pointer, unless the array gets frozen prior to modification.

  4. unsafeMArrayToForeignPtr :: Index ix => MArray s S ix e -> (ForeignPtr e, Int)

    massiv Data.Massiv.Array.Unsafe

    O(1) - Yield the underlying ForeignPtr together with its length.

  5. unsafeTransform :: (Index ix', Source r' e', Index ix) => (Sz ix' -> (Sz ix, a)) -> (a -> (ix' -> e') -> ix -> e) -> Array r' ix' e' -> Array D ix e

    massiv Data.Massiv.Array.Unsafe

    Same transform', except no bounds checking is performed, thus making it faster, but unsafe.

  6. unsafeTransform2 :: (Index ix1, Source r1 e1, Index ix2, Source r2 e2, Index ix) => (Sz ix1 -> Sz ix2 -> (Sz ix, a)) -> (a -> (ix1 -> e1) -> (ix2 -> e2) -> ix -> e) -> Array r1 ix1 e1 -> Array r2 ix2 e2 -> Array D ix e

    massiv Data.Massiv.Array.Unsafe

    Same transform2', except no bounds checking is performed, thus making it faster, but unsafe.

  7. unsafeTransformStencil :: (Sz ix' -> Sz ix) -> (ix' -> ix) -> (((ix' -> e) -> (ix' -> e) -> ix' -> a) -> (ix -> e) -> (ix -> e) -> ix -> a) -> Stencil ix' e a -> Stencil ix e a

    massiv Data.Massiv.Array.Unsafe

    Perform an arbitrary transformation of a stencil. This stencil modifier can be used for example to turn a vector stencil into a matrix stencil implement, or transpose a matrix stencil. It is really easy to get this wrong, so be extremely careful.

    Examples

    Convert a 1D stencil into a row or column 2D stencil:
    >>> import Data.Massiv.Array
    
    >>> import Data.Massiv.Array.Unsafe
    
    >>> let arr = compute $ iterateN 3 succ 0 :: Array P Ix2 Int
    
    >>> arr
    Array P Seq (Sz (3 :. 3))
    [ [ 1, 2, 3 ]
    , [ 4, 5, 6 ]
    , [ 7, 8, 9 ]
    ]
    
    >>> let rowStencil = unsafeTransformStencil (\(Sz n) -> Sz (1 :. n)) (0 :.) $ \ f uget getVal (i :. j) -> f (uget  . (i :.)) (getVal . (i :.)) j
    
    >>> applyStencil noPadding (rowStencil (sumStencil (Sz1 3))) arr
    Array DW Seq (Sz (3 :. 1))
    [ [ 6 ]
    , [ 15 ]
    , [ 24 ]
    ]
    
    >>> let columnStencil = unsafeTransformStencil (\(Sz n) -> Sz (n :. 1)) (:. 0) $ \ f uget getVal (i :. j) -> f (uget . (:. j)) (getVal . (:. j)) i
    
    >>> applyStencil noPadding (columnStencil (sumStencil (Sz1 3))) arr
    Array DW Seq (Sz (1 :. 3))
    [ [ 12, 15, 18 ]
    ]
    

  8. sforM :: forall r ix a b m . (Stream r ix a, Monad m) => Array r ix a -> (a -> m b) -> m (Vector DS b)

    massiv Data.Massiv.Vector

    Same as smapM, but with arguments flipped.

    Examples

  9. sforM_ :: (Stream r ix a, Monad m) => Array r ix a -> (a -> m b) -> m ()

    massiv Data.Massiv.Vector

    Same as smapM_, but with arguments flipped.

    Examples

  10. siforM :: forall r ix a b m . (Stream r ix a, Monad m) => Array r ix a -> (ix -> a -> m b) -> m (Vector DS b)

    massiv Data.Massiv.Vector

    Same as simapM, but with arguments flipped.

    Examples

Page 633 of many | Previous | Next