Control.Monad.Memo.Vector.Unsafe (original) (raw)

Contents

Description

VectorCache - mutable-vector-based [MonadCache](Control-Monad-Memo-Class.html#t:MonadCache) with unsafe operations.

This is a version of Control.Monad.Memo.Mutable.Vector but implemented using unsafe* vector operations. Faster than default implementation but you must be sure that your code doesn't try to read/write outside vector boundaries.

Synopsis

VectorCache for boxed types

unsafeEvalVectorMemoSource

Evaluate computation using mutable boxed vector and unsafe operations

Vector length must covers all possible keys used in computation otherwise the behaviour is undefined (i.e. segfault)

unsafeRunVectorMemoSource

Evaluate computation using mutable boxed vector and unsafe operations. It also returns the final content of the vector cache

Vector length must covers all possible keys used in computation otherwise the behaviour is undefined (i.e. segfault)

UVectorCache for unboxed types

unsafeEvalUVectorMemoSource

Evaluate computation using mutable unboxed vector and unsafe operations

Vector length must covers all possible keys used in computation otherwise the behaviour is undefined (i.e. segfault)

unsafeRunUVectorMemoSource

Evaluate computation using mutable boxed vector and unsafe operations. It also returns the final content of the vector cache

Vector length must covers all possible keys used in computation otherwise the behaviour is undefined (i.e. segfault)

Generic functions for VectorCache