foundation-0.0.13: Alternative prelude with batteries and no dependencies

LicenseBSD-style
MaintainerVincent Hanquez <vincent@snarc.org>
Stabilityexperimental
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

Foundation.Array

Description

Simple Array and Almost-Array-like data structure

Generally accessible in o(1)

Synopsis

Documentation

data Array a

Array of a

Instances

Functor Array 
Mappable Array 
IsList (Array ty) 
Eq a => Eq (Array a) 
Data ty => Data (Array ty) 
Ord a => Ord (Array a) 
Show a => Show (Array a) 
Monoid (Array a) 
NormalForm a => NormalForm (Array a) 
Buildable (Array ty) 
Fold1able (Array ty) 
Foldable (Array ty) 
IndexedCollection (Array ty) 
InnerFunctor (Array ty) 
Collection (Array ty) 
Sequential (Array ty) 
BoxedZippable (Array ty) 
Zippable (Array ty) 
Copy (Array ty) 
type Item (Array ty) = ty 
type Element (Array ty) = ty 
type Mutable (Array ty) = MArray ty 
type Step (Array ty) = ty 

data MArray a st

Mutable Array of a

Instances

MutableCollection (MArray ty) 
type MutableFreezed (MArray ty) = Array ty 
type MutableKey (MArray ty) = Offset ty 
type MutableValue (MArray ty) = ty 

data UArray ty

An array of type built on top of GHC primitive.

The elements need to have fixed sized and the representation is a packed contiguous array in memory that can easily be passed to foreign interface

Instances

PrimType ty => IsList (UArray ty) 
(PrimType ty, Eq ty) => Eq (UArray ty) 
Data ty => Data (UArray ty) 
(PrimType ty, Ord ty) => Ord (UArray ty) 
(PrimType ty, Show ty) => Show (UArray ty) 
PrimType ty => Monoid (UArray ty) 
NormalForm (UArray ty) 
PrimType ty => Buildable (UArray ty) 
PrimType ty => Fold1able (UArray ty) 
PrimType ty => Foldable (UArray ty) 
PrimType ty => IndexedCollection (UArray ty) 
PrimType ty => InnerFunctor (UArray ty) 
PrimType ty => Collection (UArray ty) 
PrimType ty => Sequential (UArray ty) 
PrimType ty => Zippable (UArray ty) 
PrimType ty => Copy (UArray ty) 
PrimType a => Hashable (UArray a) 
type Item (UArray ty) = ty 
type Element (UArray ty) = ty 
type Mutable (UArray ty) = MUArray ty 
type Step (UArray ty) = ty 

data MUArray ty st

A Mutable array of types built on top of GHC primitive.

Element in this array can be modified in place.

Instances

PrimType ty => MutableCollection (MUArray ty) 
type MutableFreezed (MUArray ty) = UArray ty 
type MutableKey (MUArray ty) = Offset ty 
type MutableValue (MUArray ty) = ty 

class Eq ty => PrimType ty

Represent the accessor for types that can be stored in the UArray and MUArray.

Types need to be a instance of storable and have fixed sized.

data OutOfBound

Exception during an operation accessing the vector out of bound

Represent the type of operation, the index accessed, and the total length of the vector.