ϊΞΙωΒ‡H      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFG#Bas van Dijk <v.dijk.bas@gmail.com>IA regional handle to memory. This should provide a safer replacement for   Foreign.Ptr.H I3Construct a regional pointer from a native pointer  and an IO. computation that finalizes the pointer (like free ptr) * which is executed when the region exits. ;This function is considered unsafe because this library can't guarantee that B the finalizer will actually finalize the pointer (suppose having  return () J as the finalizer). You have to verify the correct finalisation yourself. 3Construct a regional pointer from a native pointer & without registering a finalizer like free ptr. ;This function is considered unsafe because this library can't guarantee the < finalisation of the pointer, you have to do that yourself.  I II #Bas van Dijk <v.dijk.bas@gmail.com>  #Bas van Dijk <v.dijk.bas@gmail.com>  The constant nullPtr# contains a distinguished value of  6 that is not associated with a valid memory location.  Note that nullPtr5 is a pure value. This means it does not perform the - side-effect of registering a finalizer like  free nullPtr  in the J monad. Apply a pure6 function to the inner pointer of a regional pointer. The castPtr4 function casts a pointer from one type to another. Wraps:  Foreign.Ptr.K 9Advances the given address by the given offset in bytes. Wraps:  Foreign.Ptr.L 8Given an arbitrary address and an alignment constraint, alignPtr yields N the next higher address that fulfills the alignment constraint. An alignment  constraint x* is fulfilled by any address divisible by x. This operation  is idempotent. Wraps:  Foreign.Ptr.M AComputes the offset required to get from the second to the first  argument. We have  ' p2 == p1 `plusPtr` (p2 `minusPtr` p1) Wraps:  Foreign.Ptr.N OPQRSTUVWJXYZ   #Bas van Dijk <v.dijk.bas@gmail.com>IConvenience function which allocates sufficient memory to hold values of type ±D, applies the given continuation function to the resulting regional 'pointer and runs the resulting region. -This should provide a safer replacement for: Foreign.Marshal.Alloc.[.  Note that:  alloca =  $ \ (undefined :: ±) LConvenience function which allocates the given number of bytes, applies the Kgiven continuation function to the resulting regional pointer and runs the resulting region. -This should provide a safer replacement for: Foreign.Marshal.Alloc.].  Note that: allocaBytes size f = W $  size >>= f IConvenience function which allocates sufficient memory to hold values of type ±) and returns a regional pointer to them. -This should provide a safer replacement for: Foreign.Marshal.Alloc.^.  Note that:  malloc =  $ \ (undefined :: ±) LAllocates the given number of bytes and returns a regional pointer to them. -This should provide a safer replacement for: Foreign.Marshal.Alloc._. #Bas van Dijk <v.dijk.bas@gmail.com>KRead a value from a memory area regarded as an array of values of the same K kind. The first argument specifies the start address of the array and the K second the index into the array (the first element of the array has index  0!). The following equality holds,  2 peekElemOff addr idx = IOExts.fixIO $ \result -> / peek (addr `plusPtr` (idx * sizeOf result)) ENote that this is only a specification, not necessarily the concrete ! implementation of the function. Wraps: Foreign.Storable.`. JWrite a value to a memory area regarded as an array of values of the same & kind. The following equality holds:   pokeElemOff addr idx x = , poke (addr `plusPtr` (idx * sizeOf x)) x Wraps: Foreign.Storable.a. HRead a value from a memory location given by a base address and offset.  The following equality holds:  2 peekByteOff addr off = peek (addr `plusPtr` off) Wraps: Foreign.Storable.b. LWrite a value to a memory location given by a base address and offset. The  following equality holds:  6 pokeByteOff addr off x = poke (addr `plusPtr` off) x Wraps: Foreign.Storable.c. -Read a value from the given memory location. ENote that the peek and poke functions might require properly aligned I addresses to function correctly. This is architecture dependent; thus, M portable code should ensure that when peeking or poking values of some type  a, the alignment constraint for a, as given by the function  alignment  is fulfilled. Wraps: Foreign.Storable.d. LWrite the given value to the given memory location. Alignment restrictions  might apply; see . Wraps: Foreign.Storable.e. #Bas van Dijk <v.dijk.bas@gmail.com> val f executes the computation f!, passing as argument a regional ? pointer to a temporarily allocated block of memory into which val has been  marshalled (the combination of  and ). The memory is freed when f' terminates (either normally or via an  exception). &This provides a safer replacement for Foreign.Marshal.Utils.f. KAllocate a block of memory and marshal a value into it (the combination of   and 8). The size of the area allocated is determined by the  \ method from the instance of g for the appropriate type. &This provides a safer replacement for Foreign.Marshal.Utils.h. HCopies the given number of bytes from the second area (source) into the + first (destination); the copied areas may not overlap Wraps: Foreign.Marshal.Utils.i.  Destination Source Number of bytes to copy HCopies the given number of bytes from the second area (source) into the ' first (destination); the copied areas may overlap Wraps: Foreign.Marshal.Utils.j.  Destination Source Number of bytes to move #Bas van Dijk <v.dijk.bas@gmail.com>FAllocate storage for the given number of elements of a storable type. Like , but for multiple elements. Like :, but add an extra position to hold a special termination  element. !BTemporarily allocate space for the given number of elements (like ,  but for multiple elements). "Like !:, but add an extra position to hold a special termination  element. k#6Convert an array of given length into a Haskell list. M(This version traverses the array backwards using an accumulating parameter, = which uses constant stack space. The previous version using mapM needed  linear stack space.) Wraps: Foreign.Marshal.Array.l. $IConvert an array terminated by the given end marker into a Haskell list. Wraps: Foreign.Marshal.Array.m. %1Write the list elements consecutive into memory. Wraps: Foreign.Marshal.Array.n. &LWrite the list elements consecutive into memory and terminate them with the  given marker element. Wraps: Foreign.Marshal.Array.o. 'FWrite a list of storable elements into a newly allocated, consecutive  sequence of storable values. Like , but for multiple elements. (FWrite a list of storable elements into a newly allocated, consecutive N sequence of storable values, where the end is fixed by the given end marker. )7Temporarily store a list of storable values in memory. Like , but for multiple elements. *Like )3, but a terminator indicates where the array ends. +Like )<, but the action gets the number of values as an additional  parameter. ,Like +3, but a terminator indicates where the array ends. -JCopy the given number of elements from the second array (source) into the 1 first array (destination); the copied areas may not overlap. Wraps: Foreign.Marshal.Array.p.  Destination Source  Number of elements to copy. .JCopy the given number of elements from the second array (source) into the - first array (destination); the copied areas may overlap. Wraps: Foreign.Marshal.Array.q.  Destination Source  Number of elements to move. /EReturn the number of elements in an array, excluding the terminator. Wraps: Foreign.Marshal.Array.r. 0AAdvance a pointer into an array by the given number of elements. Wraps: Foreign.Marshal.Array.s.  !"#$%&'()*+,-./0 !"#$%&'()*+,-./0 !"#$%&'()*+,-./0#Bas van Dijk <v.dijk.bas@gmail.com>1KHandy type synonym for a regional pointer to an array of C wide characters N which is paired with the length of the array instead of terminated by a NUL. < (Thus allowing NUL characters in the middle of the string) ,This should provide a safer replacement for Foreign.C.String.t. 2KHandy type synonym for a regional pointer to an array of C wide characters  terminated by a NUL. ,This should provide a safer replacement for Foreign.C.String.u. 3LHandy type synonym for a regional pointer to an array of C characters which H is paired with the length of the array instead of terminated by a NUL. < (Thus allowing NUL characters in the middle of the string) ,This should provide a safer replacement for Foreign.C.String.v. 4FHandy type synonym for a regional pointer to an array of C characters  terminated by a NUL. ,This should provide a safer replacement for Foreign.C.String.w. 59Marshal a NUL terminated C string into a Haskell string. Wraps: Foreign.C.String.x 6?Marshal a C string with explicit length into a Haskell string. Wraps: Foreign.C.String.y. 79Marshal a Haskell string into a NUL terminated C string. The Haskell string may not contain any NUL characters Wraps: Foreign.C.String.z. 8DMarshal a Haskell string into a C string (ie, character array) with  explicit length information. Wraps: Foreign.C.String.{. 9HMarshal a Haskell string into a NUL terminated C string using temporary  storage.  the Haskell string may not contain any NUL characters L the memory is freed when the subcomputation terminates (either normally or  via an exception). Wraps: Foreign.C.String.|. :LMarshal a Haskell string into a C string (ie, character array) in temporary , storage, with explicit length information. L the memory is freed when the subcomputation terminates (either normally or  via an exception). Wraps: Foreign.C.String.}. ; Generalizes Foreign.C.String.~ to any  . <9Marshal a NUL terminated C string into a Haskell string. Wraps: Foreign.C.String.€. =?Marshal a C string with explicit length into a Haskell string. Wraps: Foreign.C.String.. >9Marshal a Haskell string into a NUL terminated C string. The Haskell string may not contain any NUL characters Wraps: Foreign.C.String.‚. ?DMarshal a Haskell string into a C string (ie, character array) with  explicit length information. Wraps: Foreign.C.String.ƒ. @HMarshal a Haskell string into a NUL terminated C string using temporary  storage.  the Haskell string may not contain any NUL characters L the memory is freed when the subcomputation terminates (either normally or  via an exception). Wraps: Foreign.C.String.„. ALMarshal a Haskell string into a C string (ie, character array) in temporary , storage, with explicit length information. L the memory is freed when the subcomputation terminates (either normally or  via an exception). Wraps: Foreign.C.String.…. B>Marshal a NUL terminated C wide string into a Haskell string. Wraps: Foreign.C.String.†. CDMarshal a C wide string with explicit length into a Haskell string. Wraps: Foreign.C.String.‡. D>Marshal a Haskell string into a NUL terminated C wide string. The Haskell string may not contain any NUL characters. Wraps: Foreign.C.String.ˆ. EIMarshal a Haskell string into a C wide string (ie, wide character array) # with explicit length information. Wraps: Foreign.C.String.‰. FCMarshal a Haskell string into a NUL terminated C wide string using  temporary storage.  the Haskell string may not contain any NUL characters @ the memory is freed when the subcomputation terminates (either " normally or via an exception). Wraps: Foreign.C.String.Š. GCMarshal a Haskell string into a NUL terminated C wide string using  temporary storage.  the Haskell string may not contain any NUL characters. @ the memory is freed when the subcomputation terminates (either " normally or via an exception). Wraps: Foreign.C.String.‹. ŒŽLallocate an array to hold the list and pair it with the number of elements. ‘123456789:;<=>?@ABCDEFG4356789:;<=>?@A21BCDEFG123456789:;<=>?@ABCDEFG’   !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRS TUVWX T T T TVYZVW[VW\VW]VW^VW_VW`VWaVWbVWcVWdVWe f gh f f f g! g" g# g$ g% g& ' gi ( ) *j k/ k0 k1 k2 k9 k: k; k< l m n o A B C D E F Gpqr H I J K L M N O P Q R Sstuvwxyregional-pointers-0.4Foreign.C.String.RegionForeign.Marshal.Utils.RegionForeign.Ptr.RegionForeign.Ptr.Region.UnsafeForeign.Marshal.Alloc.RegionForeign.Storable.RegionForeign.Marshal.Array.RegionForeign.Ptr.Region.InternalbaseForeign.C.StringcastCharToCCharcastCCharToCharForeign.Marshal.UtilstoBoolfromBool RegionalPtrunsafeRegionalPtrunsafePureRegionalPtr unsafePtr unsafeWrap unsafeWrap2 unsafeWrap3nullPtrmapRegionalPtrcastPtrplusPtralignPtrminusPtralloca allocaBytesmalloc mallocBytes peekElemOff pokeElemOff peekByteOff pokeByteOffpeekpokewithnew copyBytes moveBytes mallocArray mallocArray0 allocaArray allocaArray0 peekArray peekArray0 pokeArray pokeArray0newArray newArray0 withArray withArray0 withArrayLen withArrayLen0 copyArray moveArray lengthArray0 advancePtrRegionalCWStringLenRegionalCWStringRegionalCStringLenRegionalCString peekCStringpeekCStringLen newCString newCStringLen withCStringwithCStringLencharIsRepresentable peekCAStringpeekCAStringLen newCAStringnewCAStringLen withCAStringwithCAStringLen peekCWStringpeekCWStringLen newCWStringnewCWStringLen withCWStringwithCWStringLenGHC.PtrPtrregions-0.7.0.1#Control.Monad.Trans.Region.InternalRegionT#Control.Monad.Trans.Region.ParentOfParentOf liftCatch mapRegionT liftCallCCforkOnIOTopRegionforkOSTopRegionforkIOTopRegion runTopRegion runRegionT TopRegiondupDupForeign.Marshal.AllocForeign.StorablesizeOfStorableunsafeWrap2flpForeign.Marshal.Array CWStringLenCWString CStringLenCStringtransformers-0.2.2.0Control.Monad.IO.ClassMonadIOnULwNUL newArrayLen charsToCCharscharsToCWcharscastCharToCWchar