packman-0.3.0: Serialization library for GHC

Copyright(c) Jost Berthold, 2010-2015,
LicenseBSD3
Maintainerjost.berthold@gmail.com
Stabilityexperimental
Portabilityno (depends on GHC internals)
Safe HaskellNone
LanguageHaskell2010

GHC.Packing.Core

Description

Wrapper module for the foreign primitive operations

Synopsis

Documentation

trySerialize :: a -> IO (Serialized a) Source

Serialises its argument (in current evaluation state, as a thunk). May block if the argument captures (blackhole'd) data under evaluation, may throw PackExceptions to signal errors. This version uses a default buffer of 10MB (see trySerializeWith for a version with flexible buffer size).

trySerializeWith :: a -> Int -> IO (Serialized a) Source

Extended serialisation interface: Allocates a buffer of given size (in bytes), serialises data into it, then truncates the buffer to the required size before returning it (as Serialized a)

deserialize :: Serialized a -> IO a Source

Deserialisation function. May throw PackException P_GARBLED