primitive-maybe-0.1.0: Arrays of Maybes

Safe HaskellNone
LanguageHaskell2010

Data.Primitive.Array.Maybe

Description

This provides an interface to working with boxed arrays with elements of type Maybe a. That is:

MaybeArray a ≅ Array (Maybe a)

However, this type provided by this module is more efficient than its naive Array counterpart. It consumes less memory and has fewer heap indirections.

Synopsis

Documentation

sequenceMaybeArray :: MaybeArray a -> Maybe (Array a) Source #

This is like calling sequence on an Array. However, in the event that all the values are Just, it does not need to allocate a new array since the array backing the MaybeArray can be reused.