mutable-containers-0.3.4: Abstactions and concrete implementations of mutable containers

Safe HaskellNone
LanguageHaskell2010

Data.Mutable

Contents

Description

Classes and concrete implementations for mutable data structures.

For more information on the design of this library, see the README file, also available at http://www.stackage.org/package/mutable-containers.

Synopsis

Data types

Single-cell mutable references

data PRef s a Source #

A primitive ByteArray reference, supporting any monad.

Since 0.2.0

Instances

Prim a => MutableRef (PRef s a) Source # 

Associated Types

type RefElement (PRef s a) :: * Source #

Methods

newRef :: (PrimMonad m, (* ~ PrimState m) (MCState (PRef s a))) => RefElement (PRef s a) -> m (PRef s a) Source #

readRef :: (PrimMonad m, (* ~ PrimState m) (MCState (PRef s a))) => PRef s a -> m (RefElement (PRef s a)) Source #

writeRef :: (PrimMonad m, (* ~ PrimState m) (MCState (PRef s a))) => PRef s a -> RefElement (PRef s a) -> m () Source #

modifyRef :: (PrimMonad m, (* ~ PrimState m) (MCState (PRef s a))) => PRef s a -> (RefElement (PRef s a) -> RefElement (PRef s a)) -> m () Source #

modifyRef' :: (PrimMonad m, (* ~ PrimState m) (MCState (PRef s a))) => PRef s a -> (RefElement (PRef s a) -> RefElement (PRef s a)) -> m () Source #

MutableContainer (PRef s a) Source # 

Associated Types

type MCState (PRef s a) :: * Source #

type RefElement (PRef s a) Source # 
type RefElement (PRef s a) = a
type MCState (PRef s a) Source # 
type MCState (PRef s a) = s

type IOPRef = PRef (PrimState IO) Source #

A primitive ByteArray IO reference.

asPRef :: PRef s a -> PRef s a Source #

Since 0.2.0

data URef s a Source #

An unboxed vector reference, supporting any monad.

Since 0.2.0

Instances

Unbox a => MutableRef (URef s a) Source # 

Associated Types

type RefElement (URef s a) :: * Source #

Methods

newRef :: (PrimMonad m, (* ~ PrimState m) (MCState (URef s a))) => RefElement (URef s a) -> m (URef s a) Source #

readRef :: (PrimMonad m, (* ~ PrimState m) (MCState (URef s a))) => URef s a -> m (RefElement (URef s a)) Source #

writeRef :: (PrimMonad m, (* ~ PrimState m) (MCState (URef s a))) => URef s a -> RefElement (URef s a) -> m () Source #

modifyRef :: (PrimMonad m, (* ~ PrimState m) (MCState (URef s a))) => URef s a -> (RefElement (URef s a) -> RefElement (URef s a)) -> m () Source #

modifyRef' :: (PrimMonad m, (* ~ PrimState m) (MCState (URef s a))) => URef s a -> (RefElement (URef s a) -> RefElement (URef s a)) -> m () Source #

MutableContainer (URef s a) Source # 

Associated Types

type MCState (URef s a) :: * Source #

type RefElement (URef s a) Source # 
type RefElement (URef s a) = a
type MCState (URef s a) Source # 
type MCState (URef s a) = s

type IOURef = URef (PrimState IO) Source #

An unboxed IO vector reference.

asURef :: URef s a -> URef s a Source #

Since 0.2.0

data SRef s a Source #

A storable vector reference, supporting any monad.

Since 0.2.0

Instances

Storable a => MutableRef (SRef s a) Source # 

Associated Types

type RefElement (SRef s a) :: * Source #

Methods

newRef :: (PrimMonad m, (* ~ PrimState m) (MCState (SRef s a))) => RefElement (SRef s a) -> m (SRef s a) Source #

readRef :: (PrimMonad m, (* ~ PrimState m) (MCState (SRef s a))) => SRef s a -> m (RefElement (SRef s a)) Source #

writeRef :: (PrimMonad m, (* ~ PrimState m) (MCState (SRef s a))) => SRef s a -> RefElement (SRef s a) -> m () Source #

modifyRef :: (PrimMonad m, (* ~ PrimState m) (MCState (SRef s a))) => SRef s a -> (RefElement (SRef s a) -> RefElement (SRef s a)) -> m () Source #

modifyRef' :: (PrimMonad m, (* ~ PrimState m) (MCState (SRef s a))) => SRef s a -> (RefElement (SRef s a) -> RefElement (SRef s a)) -> m () Source #

MutableContainer (SRef s a) Source # 

Associated Types

type MCState (SRef s a) :: * Source #

type RefElement (SRef s a) Source # 
type RefElement (SRef s a) = a
type MCState (SRef s a) Source # 
type MCState (SRef s a) = s

type IOSRef = SRef (PrimState IO) Source #

A storable IO vector reference.

asSRef :: SRef s a -> SRef s a Source #

Since 0.2.0

data BRef s a Source #

A boxed vector reference, supporting any monad.

Since 0.2.0

Instances

IsSequence seq => MutablePushBack (BRef s seq) Source # 

Methods

pushBack :: (PrimMonad m, (* ~ PrimState m) (MCState (BRef s seq))) => BRef s seq -> CollElement (BRef s seq) -> m () Source #

IsSequence seq => MutablePopBack (BRef s seq) Source # 

Methods

popBack :: (PrimMonad m, (* ~ PrimState m) (MCState (BRef s seq))) => BRef s seq -> m (Maybe (CollElement (BRef s seq))) Source #

IsSequence seq => MutablePushFront (BRef s seq) Source # 

Methods

pushFront :: (PrimMonad m, (* ~ PrimState m) (MCState (BRef s seq))) => BRef s seq -> CollElement (BRef s seq) -> m () Source #

IsSequence seq => MutablePopFront (BRef s seq) Source # 

Methods

popFront :: (PrimMonad m, (* ~ PrimState m) (MCState (BRef s seq))) => BRef s seq -> m (Maybe (CollElement (BRef s seq))) Source #

Monoid w => MutableCollection (BRef s w) Source # 

Associated Types

type CollElement (BRef s w) :: * Source #

Methods

newColl :: (PrimMonad m, (* ~ PrimState m) (MCState (BRef s w))) => m (BRef s w) Source #

MutableRef (BRef s a) Source # 

Associated Types

type RefElement (BRef s a) :: * Source #

Methods

newRef :: (PrimMonad m, (* ~ PrimState m) (MCState (BRef s a))) => RefElement (BRef s a) -> m (BRef s a) Source #

readRef :: (PrimMonad m, (* ~ PrimState m) (MCState (BRef s a))) => BRef s a -> m (RefElement (BRef s a)) Source #

writeRef :: (PrimMonad m, (* ~ PrimState m) (MCState (BRef s a))) => BRef s a -> RefElement (BRef s a) -> m () Source #

modifyRef :: (PrimMonad m, (* ~ PrimState m) (MCState (BRef s a))) => BRef s a -> (RefElement (BRef s a) -> RefElement (BRef s a)) -> m () Source #

modifyRef' :: (PrimMonad m, (* ~ PrimState m) (MCState (BRef s a))) => BRef s a -> (RefElement (BRef s a) -> RefElement (BRef s a)) -> m () Source #

MutableContainer (BRef s a) Source # 

Associated Types

type MCState (BRef s a) :: * Source #

type CollElement (BRef s w) Source # 
type CollElement (BRef s w) = Element w
type RefElement (BRef s a) Source # 
type RefElement (BRef s a) = a
type MCState (BRef s a) Source # 
type MCState (BRef s a) = s

type IOBRef = BRef (PrimState IO) Source #

A boxed IO vector reference.

asBRef :: BRef s a -> BRef s a Source #

Since 0.2.0

Standard re-exports

data IORef a :: * -> * #

A mutable variable in the IO monad

Instances

Eq (IORef a)

Since: 4.1.0.0

Methods

(==) :: IORef a -> IORef a -> Bool #

(/=) :: IORef a -> IORef a -> Bool #

IsSequence a => MutablePushBack (IORef a) Source # 

Methods

pushBack :: (PrimMonad m, (* ~ PrimState m) (MCState (IORef a))) => IORef a -> CollElement (IORef a) -> m () Source #

IsSequence a => MutablePopBack (IORef a) Source # 

Methods

popBack :: (PrimMonad m, (* ~ PrimState m) (MCState (IORef a))) => IORef a -> m (Maybe (CollElement (IORef a))) Source #

IsSequence a => MutablePushFront (IORef a) Source # 

Methods

pushFront :: (PrimMonad m, (* ~ PrimState m) (MCState (IORef a))) => IORef a -> CollElement (IORef a) -> m () Source #

IsSequence a => MutablePopFront (IORef a) Source # 

Methods

popFront :: (PrimMonad m, (* ~ PrimState m) (MCState (IORef a))) => IORef a -> m (Maybe (CollElement (IORef a))) Source #

Monoid w => MutableCollection (IORef w) Source # 

Associated Types

type CollElement (IORef w) :: * Source #

Methods

newColl :: (PrimMonad m, (* ~ PrimState m) (MCState (IORef w))) => m (IORef w) Source #

MutableAtomicRef (IORef a) Source # 

Methods

atomicModifyRef :: (PrimMonad m, (* ~ PrimState m) (MCState (IORef a))) => IORef a -> (RefElement (IORef a) -> (RefElement (IORef a), a)) -> m a Source #

atomicModifyRef' :: (PrimMonad m, (* ~ PrimState m) (MCState (IORef a))) => IORef a -> (RefElement (IORef a) -> (RefElement (IORef a), a)) -> m a Source #

MutableRef (IORef a) Source # 

Associated Types

type RefElement (IORef a) :: * Source #

Methods

newRef :: (PrimMonad m, (* ~ PrimState m) (MCState (IORef a))) => RefElement (IORef a) -> m (IORef a) Source #

readRef :: (PrimMonad m, (* ~ PrimState m) (MCState (IORef a))) => IORef a -> m (RefElement (IORef a)) Source #

writeRef :: (PrimMonad m, (* ~ PrimState m) (MCState (IORef a))) => IORef a -> RefElement (IORef a) -> m () Source #

modifyRef :: (PrimMonad m, (* ~ PrimState m) (MCState (IORef a))) => IORef a -> (RefElement (IORef a) -> RefElement (IORef a)) -> m () Source #

modifyRef' :: (PrimMonad m, (* ~ PrimState m) (MCState (IORef a))) => IORef a -> (RefElement (IORef a) -> RefElement (IORef a)) -> m () Source #

MutableContainer (IORef a) Source # 

Associated Types

type MCState (IORef a) :: * Source #

type CollElement (IORef w) Source # 
type RefElement (IORef a) Source # 
type RefElement (IORef a) = a
type MCState (IORef a) Source # 

asIORef :: IORef a -> IORef a Source #

Since 0.2.0

data STRef s a :: * -> * -> * #

a value of type STRef s a is a mutable variable in state thread s, containing a value of type a

Instances

Eq (STRef s a)

Since: 2.1

Methods

(==) :: STRef s a -> STRef s a -> Bool #

(/=) :: STRef s a -> STRef s a -> Bool #

IsSequence a => MutablePushBack (STRef s a) Source # 

Methods

pushBack :: (PrimMonad m, (* ~ PrimState m) (MCState (STRef s a))) => STRef s a -> CollElement (STRef s a) -> m () Source #

IsSequence a => MutablePopBack (STRef s a) Source # 

Methods

popBack :: (PrimMonad m, (* ~ PrimState m) (MCState (STRef s a))) => STRef s a -> m (Maybe (CollElement (STRef s a))) Source #

IsSequence a => MutablePushFront (STRef s a) Source # 

Methods

pushFront :: (PrimMonad m, (* ~ PrimState m) (MCState (STRef s a))) => STRef s a -> CollElement (STRef s a) -> m () Source #

IsSequence a => MutablePopFront (STRef s a) Source # 

Methods

popFront :: (PrimMonad m, (* ~ PrimState m) (MCState (STRef s a))) => STRef s a -> m (Maybe (CollElement (STRef s a))) Source #

Monoid w => MutableCollection (STRef s w) Source # 

Associated Types

type CollElement (STRef s w) :: * Source #

Methods

newColl :: (PrimMonad m, (* ~ PrimState m) (MCState (STRef s w))) => m (STRef s w) Source #

MutableRef (STRef s a) Source # 

Associated Types

type RefElement (STRef s a) :: * Source #

Methods

newRef :: (PrimMonad m, (* ~ PrimState m) (MCState (STRef s a))) => RefElement (STRef s a) -> m (STRef s a) Source #

readRef :: (PrimMonad m, (* ~ PrimState m) (MCState (STRef s a))) => STRef s a -> m (RefElement (STRef s a)) Source #

writeRef :: (PrimMonad m, (* ~ PrimState m) (MCState (STRef s a))) => STRef s a -> RefElement (STRef s a) -> m () Source #

modifyRef :: (PrimMonad m, (* ~ PrimState m) (MCState (STRef s a))) => STRef s a -> (RefElement (STRef s a) -> RefElement (STRef s a)) -> m () Source #

modifyRef' :: (PrimMonad m, (* ~ PrimState m) (MCState (STRef s a))) => STRef s a -> (RefElement (STRef s a) -> RefElement (STRef s a)) -> m () Source #

MutableContainer (STRef s a) Source # 

Associated Types

type MCState (STRef s a) :: * Source #

type CollElement (STRef s w) Source # 
type CollElement (STRef s w) = Element w
type RefElement (STRef s a) Source # 
type RefElement (STRef s a) = a
type MCState (STRef s a) Source # 
type MCState (STRef s a) = s

asSTRef :: STRef s a -> STRef s a Source #

Since 0.2.0

data MutVar s a :: * -> * -> * #

A MutVar behaves like a single-element mutable array associated with a primitive state token.

Instances

Eq (MutVar s a) 

Methods

(==) :: MutVar s a -> MutVar s a -> Bool #

(/=) :: MutVar s a -> MutVar s a -> Bool #

IsSequence a => MutablePushBack (MutVar s a) Source # 

Methods

pushBack :: (PrimMonad m, (* ~ PrimState m) (MCState (MutVar s a))) => MutVar s a -> CollElement (MutVar s a) -> m () Source #

IsSequence a => MutablePopBack (MutVar s a) Source # 

Methods

popBack :: (PrimMonad m, (* ~ PrimState m) (MCState (MutVar s a))) => MutVar s a -> m (Maybe (CollElement (MutVar s a))) Source #

IsSequence a => MutablePushFront (MutVar s a) Source # 

Methods

pushFront :: (PrimMonad m, (* ~ PrimState m) (MCState (MutVar s a))) => MutVar s a -> CollElement (MutVar s a) -> m () Source #

IsSequence a => MutablePopFront (MutVar s a) Source # 

Methods

popFront :: (PrimMonad m, (* ~ PrimState m) (MCState (MutVar s a))) => MutVar s a -> m (Maybe (CollElement (MutVar s a))) Source #

Monoid w => MutableCollection (MutVar s w) Source # 

Associated Types

type CollElement (MutVar s w) :: * Source #

Methods

newColl :: (PrimMonad m, (* ~ PrimState m) (MCState (MutVar s w))) => m (MutVar s w) Source #

MutableAtomicRef (MutVar s a) Source # 

Methods

atomicModifyRef :: (PrimMonad m, (* ~ PrimState m) (MCState (MutVar s a))) => MutVar s a -> (RefElement (MutVar s a) -> (RefElement (MutVar s a), a)) -> m a Source #

atomicModifyRef' :: (PrimMonad m, (* ~ PrimState m) (MCState (MutVar s a))) => MutVar s a -> (RefElement (MutVar s a) -> (RefElement (MutVar s a), a)) -> m a Source #

MutableRef (MutVar s a) Source # 

Associated Types

type RefElement (MutVar s a) :: * Source #

Methods

newRef :: (PrimMonad m, (* ~ PrimState m) (MCState (MutVar s a))) => RefElement (MutVar s a) -> m (MutVar s a) Source #

readRef :: (PrimMonad m, (* ~ PrimState m) (MCState (MutVar s a))) => MutVar s a -> m (RefElement (MutVar s a)) Source #

writeRef :: (PrimMonad m, (* ~ PrimState m) (MCState (MutVar s a))) => MutVar s a -> RefElement (MutVar s a) -> m () Source #

modifyRef :: (PrimMonad m, (* ~ PrimState m) (MCState (MutVar s a))) => MutVar s a -> (RefElement (MutVar s a) -> RefElement (MutVar s a)) -> m () Source #

modifyRef' :: (PrimMonad m, (* ~ PrimState m) (MCState (MutVar s a))) => MutVar s a -> (RefElement (MutVar s a) -> RefElement (MutVar s a)) -> m () Source #

MutableContainer (MutVar s a) Source # 

Associated Types

type MCState (MutVar s a) :: * Source #

type CollElement (MutVar s w) Source # 
type CollElement (MutVar s w) = Element w
type RefElement (MutVar s a) Source # 
type RefElement (MutVar s a) = a
type MCState (MutVar s a) Source # 
type MCState (MutVar s a) = s

asMutVar :: MutVar s a -> MutVar s a Source #

Since 0.2.0

Collections/queues

data Deque v s a Source #

A double-ended queue supporting any underlying vector type and any monad.

This implements a circular double-ended queue with exponential growth.

Since 0.2.0

Instances

MVector v a => MutablePushBack (Deque v s a) Source # 

Methods

pushBack :: (PrimMonad m, (* ~ PrimState m) (MCState (Deque v s a))) => Deque v s a -> CollElement (Deque v s a) -> m () Source #

MVector v a => MutablePopBack (Deque v s a) Source # 

Methods

popBack :: (PrimMonad m, (* ~ PrimState m) (MCState (Deque v s a))) => Deque v s a -> m (Maybe (CollElement (Deque v s a))) Source #

MVector v a => MutablePushFront (Deque v s a) Source # 

Methods

pushFront :: (PrimMonad m, (* ~ PrimState m) (MCState (Deque v s a))) => Deque v s a -> CollElement (Deque v s a) -> m () Source #

MVector v a => MutablePopFront (Deque v s a) Source # 

Methods

popFront :: (PrimMonad m, (* ~ PrimState m) (MCState (Deque v s a))) => Deque v s a -> m (Maybe (CollElement (Deque v s a))) Source #

MVector v a => MutableCollection (Deque v s a) Source # 

Associated Types

type CollElement (Deque v s a) :: * Source #

Methods

newColl :: (PrimMonad m, (* ~ PrimState m) (MCState (Deque v s a))) => m (Deque v s a) Source #

MutableContainer (Deque v s a) Source # 

Associated Types

type MCState (Deque v s a) :: * Source #

type CollElement (Deque v s a) Source # 
type CollElement (Deque v s a) = a
type MCState (Deque v s a) Source # 
type MCState (Deque v s a) = s

type UDeque = Deque MVector Source #

A Deque specialized to unboxed vectors.

Since 0.2.0

asUDeque :: UDeque s a -> UDeque s a Source #

Since 0.2.0

type SDeque = Deque MVector Source #

A Deque specialized to storable vectors.

Since 0.2.0

asSDeque :: SDeque s a -> SDeque s a Source #

Since 0.2.0

type BDeque = Deque MVector Source #

A Deque specialized to boxed vectors.

Since 0.2.0

asBDeque :: BDeque s a -> BDeque s a Source #

Since 0.2.0

data DLList s a Source #

A doubly-linked list.

Since 0.3.0

Instances

MutablePushBack (DLList s a) Source # 

Methods

pushBack :: (PrimMonad m, (* ~ PrimState m) (MCState (DLList s a))) => DLList s a -> CollElement (DLList s a) -> m () Source #

MutablePopBack (DLList s a) Source # 

Methods

popBack :: (PrimMonad m, (* ~ PrimState m) (MCState (DLList s a))) => DLList s a -> m (Maybe (CollElement (DLList s a))) Source #

MutablePushFront (DLList s a) Source # 

Methods

pushFront :: (PrimMonad m, (* ~ PrimState m) (MCState (DLList s a))) => DLList s a -> CollElement (DLList s a) -> m () Source #

MutablePopFront (DLList s a) Source # 

Methods

popFront :: (PrimMonad m, (* ~ PrimState m) (MCState (DLList s a))) => DLList s a -> m (Maybe (CollElement (DLList s a))) Source #

MutableCollection (DLList s a) Source # 

Associated Types

type CollElement (DLList s a) :: * Source #

Methods

newColl :: (PrimMonad m, (* ~ PrimState m) (MCState (DLList s a))) => m (DLList s a) Source #

MutableContainer (DLList s a) Source # 

Associated Types

type MCState (DLList s a) :: * Source #

type CollElement (DLList s a) Source # 
type CollElement (DLList s a) = a
type MCState (DLList s a) Source # 
type MCState (DLList s a) = s

asDLList :: DLList s a -> DLList s a Source #

Since 0.2.0

Type classes

class MutableContainer c Source #

The parent typeclass for all mutable containers.

Since 0.2.0

Associated Types

type MCState c Source #

Associated type giving the primitive state token for the given container, much like PrimState from primitive.

Since 0.2.0

Instances

MutableContainer (IORef a) Source # 

Associated Types

type MCState (IORef a) :: * Source #

MutableContainer (STRef s a) Source # 

Associated Types

type MCState (STRef s a) :: * Source #

MutableContainer (MutVar s a) Source # 

Associated Types

type MCState (MutVar s a) :: * Source #

MutableContainer (BRef s a) Source # 

Associated Types

type MCState (BRef s a) :: * Source #

MutableContainer (DLList s a) Source # 

Associated Types

type MCState (DLList s a) :: * Source #

MutableContainer (PRef s a) Source # 

Associated Types

type MCState (PRef s a) :: * Source #

MutableContainer (SRef s a) Source # 

Associated Types

type MCState (SRef s a) :: * Source #

MutableContainer (URef s a) Source # 

Associated Types

type MCState (URef s a) :: * Source #

MutableContainer (Deque v s a) Source # 

Associated Types

type MCState (Deque v s a) :: * Source #

class MutableContainer c => MutableRef c where Source #

Typeclass for single-cell mutable references.

Since 0.2.0

Minimal complete definition

newRef, readRef, writeRef, modifyRef, modifyRef'

Associated Types

type RefElement c Source #

Associated type giving the type of the value inside the mutable reference.

Since 0.2.0

Methods

newRef :: (PrimMonad m, PrimState m ~ MCState c) => RefElement c -> m c Source #

Create a new mutable reference with the given value.

Since 0.2.0

readRef :: (PrimMonad m, PrimState m ~ MCState c) => c -> m (RefElement c) Source #

Read the current value in the mutable reference.

Since 0.2.0

writeRef :: (PrimMonad m, PrimState m ~ MCState c) => c -> RefElement c -> m () Source #

Write a new value to the mutable reference.

Since 0.2.0

modifyRef :: (PrimMonad m, PrimState m ~ MCState c) => c -> (RefElement c -> RefElement c) -> m () Source #

Modify the value in the mutable reference, without necessarily forcing the result.

Note: some implementations will force the result, in particular PRef, SRef, and URef.

Since 0.2.0

modifyRef' :: (PrimMonad m, PrimState m ~ MCState c) => c -> (RefElement c -> RefElement c) -> m () Source #

Modify the value in the mutable reference, forcing the result.

Since 0.2.0

Instances

MutableRef (IORef a) Source # 

Associated Types

type RefElement (IORef a) :: * Source #

Methods

newRef :: (PrimMonad m, (* ~ PrimState m) (MCState (IORef a))) => RefElement (IORef a) -> m (IORef a) Source #

readRef :: (PrimMonad m, (* ~ PrimState m) (MCState (IORef a))) => IORef a -> m (RefElement (IORef a)) Source #

writeRef :: (PrimMonad m, (* ~ PrimState m) (MCState (IORef a))) => IORef a -> RefElement (IORef a) -> m () Source #

modifyRef :: (PrimMonad m, (* ~ PrimState m) (MCState (IORef a))) => IORef a -> (RefElement (IORef a) -> RefElement (IORef a)) -> m () Source #

modifyRef' :: (PrimMonad m, (* ~ PrimState m) (MCState (IORef a))) => IORef a -> (RefElement (IORef a) -> RefElement (IORef a)) -> m () Source #

MutableRef (STRef s a) Source # 

Associated Types

type RefElement (STRef s a) :: * Source #

Methods

newRef :: (PrimMonad m, (* ~ PrimState m) (MCState (STRef s a))) => RefElement (STRef s a) -> m (STRef s a) Source #

readRef :: (PrimMonad m, (* ~ PrimState m) (MCState (STRef s a))) => STRef s a -> m (RefElement (STRef s a)) Source #

writeRef :: (PrimMonad m, (* ~ PrimState m) (MCState (STRef s a))) => STRef s a -> RefElement (STRef s a) -> m () Source #

modifyRef :: (PrimMonad m, (* ~ PrimState m) (MCState (STRef s a))) => STRef s a -> (RefElement (STRef s a) -> RefElement (STRef s a)) -> m () Source #

modifyRef' :: (PrimMonad m, (* ~ PrimState m) (MCState (STRef s a))) => STRef s a -> (RefElement (STRef s a) -> RefElement (STRef s a)) -> m () Source #

MutableRef (MutVar s a) Source # 

Associated Types

type RefElement (MutVar s a) :: * Source #

Methods

newRef :: (PrimMonad m, (* ~ PrimState m) (MCState (MutVar s a))) => RefElement (MutVar s a) -> m (MutVar s a) Source #

readRef :: (PrimMonad m, (* ~ PrimState m) (MCState (MutVar s a))) => MutVar s a -> m (RefElement (MutVar s a)) Source #

writeRef :: (PrimMonad m, (* ~ PrimState m) (MCState (MutVar s a))) => MutVar s a -> RefElement (MutVar s a) -> m () Source #

modifyRef :: (PrimMonad m, (* ~ PrimState m) (MCState (MutVar s a))) => MutVar s a -> (RefElement (MutVar s a) -> RefElement (MutVar s a)) -> m () Source #

modifyRef' :: (PrimMonad m, (* ~ PrimState m) (MCState (MutVar s a))) => MutVar s a -> (RefElement (MutVar s a) -> RefElement (MutVar s a)) -> m () Source #

MutableRef (BRef s a) Source # 

Associated Types

type RefElement (BRef s a) :: * Source #

Methods

newRef :: (PrimMonad m, (* ~ PrimState m) (MCState (BRef s a))) => RefElement (BRef s a) -> m (BRef s a) Source #

readRef :: (PrimMonad m, (* ~ PrimState m) (MCState (BRef s a))) => BRef s a -> m (RefElement (BRef s a)) Source #

writeRef :: (PrimMonad m, (* ~ PrimState m) (MCState (BRef s a))) => BRef s a -> RefElement (BRef s a) -> m () Source #

modifyRef :: (PrimMonad m, (* ~ PrimState m) (MCState (BRef s a))) => BRef s a -> (RefElement (BRef s a) -> RefElement (BRef s a)) -> m () Source #

modifyRef' :: (PrimMonad m, (* ~ PrimState m) (MCState (BRef s a))) => BRef s a -> (RefElement (BRef s a) -> RefElement (BRef s a)) -> m () Source #

Prim a => MutableRef (PRef s a) Source # 

Associated Types

type RefElement (PRef s a) :: * Source #

Methods

newRef :: (PrimMonad m, (* ~ PrimState m) (MCState (PRef s a))) => RefElement (PRef s a) -> m (PRef s a) Source #

readRef :: (PrimMonad m, (* ~ PrimState m) (MCState (PRef s a))) => PRef s a -> m (RefElement (PRef s a)) Source #

writeRef :: (PrimMonad m, (* ~ PrimState m) (MCState (PRef s a))) => PRef s a -> RefElement (PRef s a) -> m () Source #

modifyRef :: (PrimMonad m, (* ~ PrimState m) (MCState (PRef s a))) => PRef s a -> (RefElement (PRef s a) -> RefElement (PRef s a)) -> m () Source #

modifyRef' :: (PrimMonad m, (* ~ PrimState m) (MCState (PRef s a))) => PRef s a -> (RefElement (PRef s a) -> RefElement (PRef s a)) -> m () Source #

Storable a => MutableRef (SRef s a) Source # 

Associated Types

type RefElement (SRef s a) :: * Source #

Methods

newRef :: (PrimMonad m, (* ~ PrimState m) (MCState (SRef s a))) => RefElement (SRef s a) -> m (SRef s a) Source #

readRef :: (PrimMonad m, (* ~ PrimState m) (MCState (SRef s a))) => SRef s a -> m (RefElement (SRef s a)) Source #

writeRef :: (PrimMonad m, (* ~ PrimState m) (MCState (SRef s a))) => SRef s a -> RefElement (SRef s a) -> m () Source #

modifyRef :: (PrimMonad m, (* ~ PrimState m) (MCState (SRef s a))) => SRef s a -> (RefElement (SRef s a) -> RefElement (SRef s a)) -> m () Source #

modifyRef' :: (PrimMonad m, (* ~ PrimState m) (MCState (SRef s a))) => SRef s a -> (RefElement (SRef s a) -> RefElement (SRef s a)) -> m () Source #

Unbox a => MutableRef (URef s a) Source # 

Associated Types

type RefElement (URef s a) :: * Source #

Methods

newRef :: (PrimMonad m, (* ~ PrimState m) (MCState (URef s a))) => RefElement (URef s a) -> m (URef s a) Source #

readRef :: (PrimMonad m, (* ~ PrimState m) (MCState (URef s a))) => URef s a -> m (RefElement (URef s a)) Source #

writeRef :: (PrimMonad m, (* ~ PrimState m) (MCState (URef s a))) => URef s a -> RefElement (URef s a) -> m () Source #

modifyRef :: (PrimMonad m, (* ~ PrimState m) (MCState (URef s a))) => URef s a -> (RefElement (URef s a) -> RefElement (URef s a)) -> m () Source #

modifyRef' :: (PrimMonad m, (* ~ PrimState m) (MCState (URef s a))) => URef s a -> (RefElement (URef s a) -> RefElement (URef s a)) -> m () Source #

class MutableRef c => MutableAtomicRef c where Source #

MutableRefs that provide for atomic modifications of their contents.

Since 0.2.0

Minimal complete definition

atomicModifyRef, atomicModifyRef'

Methods

atomicModifyRef :: (PrimMonad m, PrimState m ~ MCState c) => c -> (RefElement c -> (RefElement c, a)) -> m a Source #

Modify the value without necessarily forcing the result.

Since 0.2.0

atomicModifyRef' :: (PrimMonad m, PrimState m ~ MCState c) => c -> (RefElement c -> (RefElement c, a)) -> m a Source #

Modify the value, forcing the result.

Since 0.2.0

Instances

MutableAtomicRef (IORef a) Source # 

Methods

atomicModifyRef :: (PrimMonad m, (* ~ PrimState m) (MCState (IORef a))) => IORef a -> (RefElement (IORef a) -> (RefElement (IORef a), a)) -> m a Source #

atomicModifyRef' :: (PrimMonad m, (* ~ PrimState m) (MCState (IORef a))) => IORef a -> (RefElement (IORef a) -> (RefElement (IORef a), a)) -> m a Source #

MutableAtomicRef (MutVar s a) Source # 

Methods

atomicModifyRef :: (PrimMonad m, (* ~ PrimState m) (MCState (MutVar s a))) => MutVar s a -> (RefElement (MutVar s a) -> (RefElement (MutVar s a), a)) -> m a Source #

atomicModifyRef' :: (PrimMonad m, (* ~ PrimState m) (MCState (MutVar s a))) => MutVar s a -> (RefElement (MutVar s a) -> (RefElement (MutVar s a), a)) -> m a Source #

class MutableContainer c => MutableCollection c where Source #

Containers which contain 0 or more values.

Since 0.2.0

Minimal complete definition

newColl

Associated Types

type CollElement c Source #

The type of each value in the collection.

Since 0.2.0

Methods

newColl :: (PrimMonad m, PrimState m ~ MCState c) => m c Source #

Create a new, empty collection.

Since 0.2.0

Instances

Monoid w => MutableCollection (IORef w) Source # 

Associated Types

type CollElement (IORef w) :: * Source #

Methods

newColl :: (PrimMonad m, (* ~ PrimState m) (MCState (IORef w))) => m (IORef w) Source #

Monoid w => MutableCollection (STRef s w) Source # 

Associated Types

type CollElement (STRef s w) :: * Source #

Methods

newColl :: (PrimMonad m, (* ~ PrimState m) (MCState (STRef s w))) => m (STRef s w) Source #

Monoid w => MutableCollection (MutVar s w) Source # 

Associated Types

type CollElement (MutVar s w) :: * Source #

Methods

newColl :: (PrimMonad m, (* ~ PrimState m) (MCState (MutVar s w))) => m (MutVar s w) Source #

Monoid w => MutableCollection (BRef s w) Source # 

Associated Types

type CollElement (BRef s w) :: * Source #

Methods

newColl :: (PrimMonad m, (* ~ PrimState m) (MCState (BRef s w))) => m (BRef s w) Source #

MutableCollection (DLList s a) Source # 

Associated Types

type CollElement (DLList s a) :: * Source #

Methods

newColl :: (PrimMonad m, (* ~ PrimState m) (MCState (DLList s a))) => m (DLList s a) Source #

MVector v a => MutableCollection (Deque v s a) Source # 

Associated Types

type CollElement (Deque v s a) :: * Source #

Methods

newColl :: (PrimMonad m, (* ~ PrimState m) (MCState (Deque v s a))) => m (Deque v s a) Source #

class MutableCollection c => MutablePushFront c where Source #

Place a value at the front of the collection.

Since 0.2.0

Minimal complete definition

pushFront

Methods

pushFront :: (PrimMonad m, PrimState m ~ MCState c) => c -> CollElement c -> m () Source #

Place a value at the front of the collection.

Since 0.2.0

Instances

IsSequence a => MutablePushFront (IORef a) Source # 

Methods

pushFront :: (PrimMonad m, (* ~ PrimState m) (MCState (IORef a))) => IORef a -> CollElement (IORef a) -> m () Source #

IsSequence a => MutablePushFront (STRef s a) Source # 

Methods

pushFront :: (PrimMonad m, (* ~ PrimState m) (MCState (STRef s a))) => STRef s a -> CollElement (STRef s a) -> m () Source #

IsSequence a => MutablePushFront (MutVar s a) Source # 

Methods

pushFront :: (PrimMonad m, (* ~ PrimState m) (MCState (MutVar s a))) => MutVar s a -> CollElement (MutVar s a) -> m () Source #

IsSequence seq => MutablePushFront (BRef s seq) Source # 

Methods

pushFront :: (PrimMonad m, (* ~ PrimState m) (MCState (BRef s seq))) => BRef s seq -> CollElement (BRef s seq) -> m () Source #

MutablePushFront (DLList s a) Source # 

Methods

pushFront :: (PrimMonad m, (* ~ PrimState m) (MCState (DLList s a))) => DLList s a -> CollElement (DLList s a) -> m () Source #

MVector v a => MutablePushFront (Deque v s a) Source # 

Methods

pushFront :: (PrimMonad m, (* ~ PrimState m) (MCState (Deque v s a))) => Deque v s a -> CollElement (Deque v s a) -> m () Source #

class MutableCollection c => MutablePushBack c where Source #

Place a value at the back of the collection.

Since 0.2.0

Minimal complete definition

pushBack

Methods

pushBack :: (PrimMonad m, PrimState m ~ MCState c) => c -> CollElement c -> m () Source #

Place a value at the back of the collection.

Since 0.2.0

Instances

IsSequence a => MutablePushBack (IORef a) Source # 

Methods

pushBack :: (PrimMonad m, (* ~ PrimState m) (MCState (IORef a))) => IORef a -> CollElement (IORef a) -> m () Source #

IsSequence a => MutablePushBack (STRef s a) Source # 

Methods

pushBack :: (PrimMonad m, (* ~ PrimState m) (MCState (STRef s a))) => STRef s a -> CollElement (STRef s a) -> m () Source #

IsSequence a => MutablePushBack (MutVar s a) Source # 

Methods

pushBack :: (PrimMonad m, (* ~ PrimState m) (MCState (MutVar s a))) => MutVar s a -> CollElement (MutVar s a) -> m () Source #

IsSequence seq => MutablePushBack (BRef s seq) Source # 

Methods

pushBack :: (PrimMonad m, (* ~ PrimState m) (MCState (BRef s seq))) => BRef s seq -> CollElement (BRef s seq) -> m () Source #

MutablePushBack (DLList s a) Source # 

Methods

pushBack :: (PrimMonad m, (* ~ PrimState m) (MCState (DLList s a))) => DLList s a -> CollElement (DLList s a) -> m () Source #

MVector v a => MutablePushBack (Deque v s a) Source # 

Methods

pushBack :: (PrimMonad m, (* ~ PrimState m) (MCState (Deque v s a))) => Deque v s a -> CollElement (Deque v s a) -> m () Source #

class MutableCollection c => MutablePopFront c where Source #

Take a value from the front of the collection, if available.

Since 0.2.0

Minimal complete definition

popFront

Methods

popFront :: (PrimMonad m, PrimState m ~ MCState c) => c -> m (Maybe (CollElement c)) Source #

Take a value from the front of the collection, if available.

Since 0.2.0

Instances

IsSequence a => MutablePopFront (IORef a) Source # 

Methods

popFront :: (PrimMonad m, (* ~ PrimState m) (MCState (IORef a))) => IORef a -> m (Maybe (CollElement (IORef a))) Source #

IsSequence a => MutablePopFront (STRef s a) Source # 

Methods

popFront :: (PrimMonad m, (* ~ PrimState m) (MCState (STRef s a))) => STRef s a -> m (Maybe (CollElement (STRef s a))) Source #

IsSequence a => MutablePopFront (MutVar s a) Source # 

Methods

popFront :: (PrimMonad m, (* ~ PrimState m) (MCState (MutVar s a))) => MutVar s a -> m (Maybe (CollElement (MutVar s a))) Source #

IsSequence seq => MutablePopFront (BRef s seq) Source # 

Methods

popFront :: (PrimMonad m, (* ~ PrimState m) (MCState (BRef s seq))) => BRef s seq -> m (Maybe (CollElement (BRef s seq))) Source #

MutablePopFront (DLList s a) Source # 

Methods

popFront :: (PrimMonad m, (* ~ PrimState m) (MCState (DLList s a))) => DLList s a -> m (Maybe (CollElement (DLList s a))) Source #

MVector v a => MutablePopFront (Deque v s a) Source # 

Methods

popFront :: (PrimMonad m, (* ~ PrimState m) (MCState (Deque v s a))) => Deque v s a -> m (Maybe (CollElement (Deque v s a))) Source #

class MutableCollection c => MutablePopBack c where Source #

Take a value from the back of the collection, if available.

Since 0.2.0

Minimal complete definition

popBack

Methods

popBack :: (PrimMonad m, PrimState m ~ MCState c) => c -> m (Maybe (CollElement c)) Source #

Take a value from the back of the collection, if available.

Since 0.2.0

Instances

IsSequence a => MutablePopBack (IORef a) Source # 

Methods

popBack :: (PrimMonad m, (* ~ PrimState m) (MCState (IORef a))) => IORef a -> m (Maybe (CollElement (IORef a))) Source #

IsSequence a => MutablePopBack (STRef s a) Source # 

Methods

popBack :: (PrimMonad m, (* ~ PrimState m) (MCState (STRef s a))) => STRef s a -> m (Maybe (CollElement (STRef s a))) Source #

IsSequence a => MutablePopBack (MutVar s a) Source # 

Methods

popBack :: (PrimMonad m, (* ~ PrimState m) (MCState (MutVar s a))) => MutVar s a -> m (Maybe (CollElement (MutVar s a))) Source #

IsSequence seq => MutablePopBack (BRef s seq) Source # 

Methods

popBack :: (PrimMonad m, (* ~ PrimState m) (MCState (BRef s seq))) => BRef s seq -> m (Maybe (CollElement (BRef s seq))) Source #

MutablePopBack (DLList s a) Source # 

Methods

popBack :: (PrimMonad m, (* ~ PrimState m) (MCState (DLList s a))) => DLList s a -> m (Maybe (CollElement (DLList s a))) Source #

MVector v a => MutablePopBack (Deque v s a) Source # 

Methods

popBack :: (PrimMonad m, (* ~ PrimState m) (MCState (Deque v s a))) => Deque v s a -> m (Maybe (CollElement (Deque v s a))) Source #

Constraint kinds

type MutableQueue c = (MutablePopFront c, MutablePushBack c) Source #

Collections which allow pushing and popping at the front (aka FIFOs).

Since 0.2.0

type MutableStack c = (MutablePopFront c, MutablePushFront c) Source #

Collections which allow pushing at the back and popping at the front (aka FILOs).

Since 0.2.0

type MutableDeque c = (MutableQueue c, MutablePushFront c, MutablePopBack c) Source #

Collections which allow pushing and popping at the front and back.

Since 0.2.0

Convenience re-exports

class Monad m => PrimMonad (m :: * -> *) #

Class of monads which can perform primitive state-transformer actions

Minimal complete definition

primitive

Associated Types

type PrimState (m :: * -> *) :: * #

State token type

Instances

PrimMonad IO 

Associated Types

type PrimState (IO :: * -> *) :: * #

PrimMonad (ST s) 

Associated Types

type PrimState (ST s :: * -> *) :: * #

Methods

primitive :: (State# (PrimState (ST s)) -> (#TupleRep [RuntimeRep], LiftedRep, State# (PrimState (ST s)), a#)) -> ST s a #

PrimMonad m => PrimMonad (MaybeT m) 

Associated Types

type PrimState (MaybeT m :: * -> *) :: * #

PrimMonad m => PrimMonad (ListT m) 

Associated Types

type PrimState (ListT m :: * -> *) :: * #

Methods

primitive :: (State# (PrimState (ListT m)) -> (#TupleRep [RuntimeRep], LiftedRep, State# (PrimState (ListT m)), a#)) -> ListT m a #

(Monoid w, PrimMonad m) => PrimMonad (WriterT w m) 

Associated Types

type PrimState (WriterT w m :: * -> *) :: * #

Methods

primitive :: (State# (PrimState (WriterT w m)) -> (#TupleRep [RuntimeRep], LiftedRep, State# (PrimState (WriterT w m)), a#)) -> WriterT w m a #

(Monoid w, PrimMonad m) => PrimMonad (WriterT w m) 

Associated Types

type PrimState (WriterT w m :: * -> *) :: * #

Methods

primitive :: (State# (PrimState (WriterT w m)) -> (#TupleRep [RuntimeRep], LiftedRep, State# (PrimState (WriterT w m)), a#)) -> WriterT w m a #

PrimMonad m => PrimMonad (StateT s m) 

Associated Types

type PrimState (StateT s m :: * -> *) :: * #

Methods

primitive :: (State# (PrimState (StateT s m)) -> (#TupleRep [RuntimeRep], LiftedRep, State# (PrimState (StateT s m)), a#)) -> StateT s m a #

PrimMonad m => PrimMonad (StateT s m) 

Associated Types

type PrimState (StateT s m :: * -> *) :: * #

Methods

primitive :: (State# (PrimState (StateT s m)) -> (#TupleRep [RuntimeRep], LiftedRep, State# (PrimState (StateT s m)), a#)) -> StateT s m a #

PrimMonad m => PrimMonad (IdentityT * m) 

Associated Types

type PrimState (IdentityT * m :: * -> *) :: * #

PrimMonad m => PrimMonad (ExceptT e m) 

Associated Types

type PrimState (ExceptT e m :: * -> *) :: * #

Methods

primitive :: (State# (PrimState (ExceptT e m)) -> (#TupleRep [RuntimeRep], LiftedRep, State# (PrimState (ExceptT e m)), a#)) -> ExceptT e m a #

(Error e, PrimMonad m) => PrimMonad (ErrorT e m) 

Associated Types

type PrimState (ErrorT e m :: * -> *) :: * #

Methods

primitive :: (State# (PrimState (ErrorT e m)) -> (#TupleRep [RuntimeRep], LiftedRep, State# (PrimState (ErrorT e m)), a#)) -> ErrorT e m a #

PrimMonad m => PrimMonad (ReaderT * r m) 

Associated Types

type PrimState (ReaderT * r m :: * -> *) :: * #

Methods

primitive :: (State# (PrimState (ReaderT * r m)) -> (#TupleRep [RuntimeRep], LiftedRep, State# (PrimState (ReaderT * r m)), a#)) -> ReaderT * r m a #

(Monoid w, PrimMonad m) => PrimMonad (RWST r w s m) 

Associated Types

type PrimState (RWST r w s m :: * -> *) :: * #

Methods

primitive :: (State# (PrimState (RWST r w s m)) -> (#TupleRep [RuntimeRep], LiftedRep, State# (PrimState (RWST r w s m)), a#)) -> RWST r w s m a #

(Monoid w, PrimMonad m) => PrimMonad (RWST r w s m) 

Associated Types

type PrimState (RWST r w s m :: * -> *) :: * #

Methods

primitive :: (State# (PrimState (RWST r w s m)) -> (#TupleRep [RuntimeRep], LiftedRep, State# (PrimState (RWST r w s m)), a#)) -> RWST r w s m a #

type family PrimState (m :: * -> *) :: * #

State token type

Instances

type PrimState IO 
type PrimState (ST s) 
type PrimState (ST s) = s
type PrimState (MaybeT m) 
type PrimState (ListT m) 
type PrimState (WriterT w m) 
type PrimState (WriterT w m) = PrimState m
type PrimState (WriterT w m) 
type PrimState (WriterT w m) = PrimState m
type PrimState (StateT s m) 
type PrimState (StateT s m) = PrimState m
type PrimState (StateT s m) 
type PrimState (StateT s m) = PrimState m
type PrimState (IdentityT * m) 
type PrimState (ExceptT e m) 
type PrimState (ExceptT e m) = PrimState m
type PrimState (ErrorT e m) 
type PrimState (ErrorT e m) = PrimState m
type PrimState (ReaderT * r m) 
type PrimState (ReaderT * r m) = PrimState m
type PrimState (RWST r w s m) 
type PrimState (RWST r w s m) = PrimState m
type PrimState (RWST r w s m) 
type PrimState (RWST r w s m) = PrimState m

data RealWorld :: * #

RealWorld is deeply magical. It is primitive, but it is not unlifted (hence ptrArg). We never manipulate values of type RealWorld; it's only used in the type system, to parameterise State#.

class Prim a #

Class of types supporting primitive array operations

Instances

Prim Char 
Prim Double 
Prim Float 
Prim Int 
Prim Int8 
Prim Int16 
Prim Int32 
Prim Int64 
Prim Word 
Prim Word8 
Prim Word16 
Prim Word32 
Prim Word64 
Prim Addr 
Prim (Ptr a) 
Prim (FunPtr a) 

class (Vector Vector a, MVector MVector a) => Unbox a #

Instances

Unbox Bool 
Unbox Char 
Unbox Double 
Unbox Float 
Unbox Int 
Unbox Int8 
Unbox Int16 
Unbox Int32 
Unbox Int64 
Unbox Word 
Unbox Word8 
Unbox Word16 
Unbox Word32 
Unbox Word64 
Unbox () 
Unbox a => Unbox (Complex a) 
(Unbox a, Unbox b) => Unbox (a, b) 
(Unbox a, Unbox b, Unbox c) => Unbox (a, b, c) 
(Unbox a, Unbox b, Unbox c, Unbox d) => Unbox (a, b, c, d) 
(Unbox a, Unbox b, Unbox c, Unbox d, Unbox e) => Unbox (a, b, c, d, e) 
(Unbox a, Unbox b, Unbox c, Unbox d, Unbox e, Unbox f) => Unbox (a, b, c, d, e, f) 

class Storable a #

The member functions of this class facilitate writing values of primitive types to raw memory (which may have been allocated with the above mentioned routines) and reading values from blocks of raw memory. The class, furthermore, includes support for computing the storage requirements and alignment restrictions of storable types.

Memory addresses are represented as values of type Ptr a, for some a which is an instance of class Storable. The type argument to Ptr helps provide some valuable type safety in FFI code (you can't mix pointers of different types without an explicit cast), while helping the Haskell type system figure out which marshalling method is needed for a given pointer.

All marshalling between Haskell and a foreign language ultimately boils down to translating Haskell data structures into the binary representation of a corresponding data structure of the foreign language and vice versa. To code this marshalling in Haskell, it is necessary to manipulate primitive data types stored in unstructured memory blocks. The class Storable facilitates this manipulation on all types for which it is instantiated, which are the standard basic types of Haskell, the fixed size Int types (Int8, Int16, Int32, Int64), the fixed size Word types (Word8, Word16, Word32, Word64), StablePtr, all types from Foreign.C.Types, as well as Ptr.

Minimal complete definition

sizeOf, alignment, (peek | peekElemOff | peekByteOff), (poke | pokeElemOff | pokeByteOff)

Instances

Storable Bool

Since: 2.1

Methods

sizeOf :: Bool -> Int #

alignment :: Bool -> Int #

peekElemOff :: Ptr Bool -> Int -> IO Bool #

pokeElemOff :: Ptr Bool -> Int -> Bool -> IO () #

peekByteOff :: Ptr b -> Int -> IO Bool #

pokeByteOff :: Ptr b -> Int -> Bool -> IO () #

peek :: Ptr Bool -> IO Bool #

poke :: Ptr Bool -> Bool -> IO () #

Storable Char

Since: 2.1

Methods

sizeOf :: Char -> Int #

alignment :: Char -> Int #

peekElemOff :: Ptr Char -> Int -> IO Char #

pokeElemOff :: Ptr Char -> Int -> Char -> IO () #

peekByteOff :: Ptr b -> Int -> IO Char #

pokeByteOff :: Ptr b -> Int -> Char -> IO () #

peek :: Ptr Char -> IO Char #

poke :: Ptr Char -> Char -> IO () #

Storable Double

Since: 2.1

Storable Float

Since: 2.1

Methods

sizeOf :: Float -> Int #

alignment :: Float -> Int #

peekElemOff :: Ptr Float -> Int -> IO Float #

pokeElemOff :: Ptr Float -> Int -> Float -> IO () #

peekByteOff :: Ptr b -> Int -> IO Float #

pokeByteOff :: Ptr b -> Int -> Float -> IO () #

peek :: Ptr Float -> IO Float #

poke :: Ptr Float -> Float -> IO () #

Storable Int

Since: 2.1

Methods

sizeOf :: Int -> Int #

alignment :: Int -> Int #

peekElemOff :: Ptr Int -> Int -> IO Int #

pokeElemOff :: Ptr Int -> Int -> Int -> IO () #

peekByteOff :: Ptr b -> Int -> IO Int #

pokeByteOff :: Ptr b -> Int -> Int -> IO () #

peek :: Ptr Int -> IO Int #

poke :: Ptr Int -> Int -> IO () #

Storable Int8

Since: 2.1

Methods

sizeOf :: Int8 -> Int #

alignment :: Int8 -> Int #

peekElemOff :: Ptr Int8 -> Int -> IO Int8 #

pokeElemOff :: Ptr Int8 -> Int -> Int8 -> IO () #

peekByteOff :: Ptr b -> Int -> IO Int8 #

pokeByteOff :: Ptr b -> Int -> Int8 -> IO () #

peek :: Ptr Int8 -> IO Int8 #

poke :: Ptr Int8 -> Int8 -> IO () #

Storable Int16

Since: 2.1

Methods

sizeOf :: Int16 -> Int #

alignment :: Int16 -> Int #

peekElemOff :: Ptr Int16 -> Int -> IO Int16 #

pokeElemOff :: Ptr Int16 -> Int -> Int16 -> IO () #

peekByteOff :: Ptr b -> Int -> IO Int16 #

pokeByteOff :: Ptr b -> Int -> Int16 -> IO () #

peek :: Ptr Int16 -> IO Int16 #

poke :: Ptr Int16 -> Int16 -> IO () #

Storable Int32

Since: 2.1

Methods

sizeOf :: Int32 -> Int #

alignment :: Int32 -> Int #

peekElemOff :: Ptr Int32 -> Int -> IO Int32 #

pokeElemOff :: Ptr Int32 -> Int -> Int32 -> IO () #

peekByteOff :: Ptr b -> Int -> IO Int32 #

pokeByteOff :: Ptr b -> Int -> Int32 -> IO () #

peek :: Ptr Int32 -> IO Int32 #

poke :: Ptr Int32 -> Int32 -> IO () #

Storable Int64

Since: 2.1

Methods

sizeOf :: Int64 -> Int #

alignment :: Int64 -> Int #

peekElemOff :: Ptr Int64 -> Int -> IO Int64 #

pokeElemOff :: Ptr Int64 -> Int -> Int64 -> IO () #

peekByteOff :: Ptr b -> Int -> IO Int64 #

pokeByteOff :: Ptr b -> Int -> Int64 -> IO () #

peek :: Ptr Int64 -> IO Int64 #

poke :: Ptr Int64 -> Int64 -> IO () #

Storable Word

Since: 2.1

Methods

sizeOf :: Word -> Int #

alignment :: Word -> Int #

peekElemOff :: Ptr Word -> Int -> IO Word #

pokeElemOff :: Ptr Word -> Int -> Word -> IO () #

peekByteOff :: Ptr b -> Int -> IO Word #

pokeByteOff :: Ptr b -> Int -> Word -> IO () #

peek :: Ptr Word -> IO Word #

poke :: Ptr Word -> Word -> IO () #

Storable Word8

Since: 2.1

Methods

sizeOf :: Word8 -> Int #

alignment :: Word8 -> Int #

peekElemOff :: Ptr Word8 -> Int -> IO Word8 #

pokeElemOff :: Ptr Word8 -> Int -> Word8 -> IO () #

peekByteOff :: Ptr b -> Int -> IO Word8 #

pokeByteOff :: Ptr b -> Int -> Word8 -> IO () #

peek :: Ptr Word8 -> IO Word8 #

poke :: Ptr Word8 -> Word8 -> IO () #

Storable Word16

Since: 2.1

Storable Word32

Since: 2.1

Storable Word64

Since: 2.1

Storable ()

Since: 4.9.0.0

Methods

sizeOf :: () -> Int #

alignment :: () -> Int #

peekElemOff :: Ptr () -> Int -> IO () #

pokeElemOff :: Ptr () -> Int -> () -> IO () #

peekByteOff :: Ptr b -> Int -> IO () #

pokeByteOff :: Ptr b -> Int -> () -> IO () #

peek :: Ptr () -> IO () #

poke :: Ptr () -> () -> IO () #

Storable Fingerprint

Since: 4.4.0.0

(Storable a, Integral a) => Storable (Ratio a)

Since: 4.8.0.0

Methods

sizeOf :: Ratio a -> Int #

alignment :: Ratio a -> Int #

peekElemOff :: Ptr (Ratio a) -> Int -> IO (Ratio a) #

pokeElemOff :: Ptr (Ratio a) -> Int -> Ratio a -> IO () #

peekByteOff :: Ptr b -> Int -> IO (Ratio a) #

pokeByteOff :: Ptr b -> Int -> Ratio a -> IO () #

peek :: Ptr (Ratio a) -> IO (Ratio a) #

poke :: Ptr (Ratio a) -> Ratio a -> IO () #

Storable (StablePtr a)

Since: 2.1

Methods

sizeOf :: StablePtr a -> Int #

alignment :: StablePtr a -> Int #

peekElemOff :: Ptr (StablePtr a) -> Int -> IO (StablePtr a) #

pokeElemOff :: Ptr (StablePtr a) -> Int -> StablePtr a -> IO () #

peekByteOff :: Ptr b -> Int -> IO (StablePtr a) #

pokeByteOff :: Ptr b -> Int -> StablePtr a -> IO () #

peek :: Ptr (StablePtr a) -> IO (StablePtr a) #

poke :: Ptr (StablePtr a) -> StablePtr a -> IO () #

Storable (Ptr a)

Since: 2.1

Methods

sizeOf :: Ptr a -> Int #

alignment :: Ptr a -> Int #

peekElemOff :: Ptr (Ptr a) -> Int -> IO (Ptr a) #

pokeElemOff :: Ptr (Ptr a) -> Int -> Ptr a -> IO () #

peekByteOff :: Ptr b -> Int -> IO (Ptr a) #

pokeByteOff :: Ptr b -> Int -> Ptr a -> IO () #

peek :: Ptr (Ptr a) -> IO (Ptr a) #

poke :: Ptr (Ptr a) -> Ptr a -> IO () #

Storable (FunPtr a)

Since: 2.1

Methods

sizeOf :: FunPtr a -> Int #

alignment :: FunPtr a -> Int #

peekElemOff :: Ptr (FunPtr a) -> Int -> IO (FunPtr a) #

pokeElemOff :: Ptr (FunPtr a) -> Int -> FunPtr a -> IO () #

peekByteOff :: Ptr b -> Int -> IO (FunPtr a) #

pokeByteOff :: Ptr b -> Int -> FunPtr a -> IO () #

peek :: Ptr (FunPtr a) -> IO (FunPtr a) #

poke :: Ptr (FunPtr a) -> FunPtr a -> IO () #

Storable a => Storable (Identity a) 

Methods

sizeOf :: Identity a -> Int #

alignment :: Identity a -> Int #

peekElemOff :: Ptr (Identity a) -> Int -> IO (Identity a) #

pokeElemOff :: Ptr (Identity a) -> Int -> Identity a -> IO () #

peekByteOff :: Ptr b -> Int -> IO (Identity a) #

pokeByteOff :: Ptr b -> Int -> Identity a -> IO () #

peek :: Ptr (Identity a) -> IO (Identity a) #

poke :: Ptr (Identity a) -> Identity a -> IO () #

Storable a => Storable (Const k a b) 

Methods

sizeOf :: Const k a b -> Int #

alignment :: Const k a b -> Int #

peekElemOff :: Ptr (Const k a b) -> Int -> IO (Const k a b) #

pokeElemOff :: Ptr (Const k a b) -> Int -> Const k a b -> IO () #

peekByteOff :: Ptr b -> Int -> IO (Const k a b) #

pokeByteOff :: Ptr b -> Int -> Const k a b -> IO () #

peek :: Ptr (Const k a b) -> IO (Const k a b) #

poke :: Ptr (Const k a b) -> Const k a b -> IO () #