Copyright | (c) Jost Berthold, 2010-2015, |
---|---|
License | BSD3 |
Maintainer | jost.berthold@gmail.com |
Stability | experimental |
Portability | no (depends on GHC internals) |
Safe Haskell | None |
Language | Haskell2010 |
Wrapper module for the foreign primitive operations
- trySerialize :: a -> IO (Serialized a)
- trySerializeWith :: a -> Int -> IO (Serialized a)
- deserialize :: Serialized a -> IO a
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 PackException
s 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