lifted-base-0.2.3.0: lifted IO operations from the base library

Portabilitynon-portable (extended exceptions)
Stabilityexperimental
MaintainerBas van Dijk <v.dijk.bas@gmail.com>
Safe HaskellTrustworthy

Foreign.Marshal.Utils.Lifted

Description

This is a wrapped version of Foreign.Marshal.Utils with types generalized from IO to all monads in either MonadBase or MonadBaseControl.

Synopsis

Documentation

withSource

Arguments

:: (MonadBaseControl IO m, Storable a) 
=> a

value to be poked

-> (Ptr a -> m b)

computation to run

-> m b 

Generalized version of with.

Note, when the given function throws an exception any monadic side effects in m will be discarded.