vector-extras-0.2.8: Utilities for the "vector" library
Safe HaskellSafe-Inferred
LanguageHaskell2010

VectorExtras.Immutable.FoldM.PrimMonad.Index

Synopsis

Documentation

type IndexPrimMonadFoldM result = forall m. PrimMonad m => FoldM m Int result Source #

Fold on indices in PrimMonad.

frequency :: (Vector vector count, Enum count) => Int -> IndexPrimMonadFoldM (vector count) Source #

Given the size of the vector, construct a fold, which produces a vector of frequencies of each index. I.e., the counts of how often it appeared.

It is your responsibility to ensure that the indices are within the size of the vector produced.