Safe Haskell | None |
---|---|
Language | Haskell2010 |
Control.Static.Closure
Description
This module contains a "closure" type, originally inspired by
Closure
, but modified significantly,
and also generalised in a number of ways.
There was some also unsafe casts in Control.Distributed.Closure.Internal that scared me, which this package does not have.
- data Closure t a where
- decodeWithDict :: Dict (Binary a) -> ByteString -> a
- newtype Tag = Tag Word8
- pattern PureTag :: Tag
- pattern StaticPtrTag :: Tag
- pattern ApTag :: Tag
- putClosure :: Binary t => Closure t a -> Put
- getClosure :: Binary t => Get (Closure t a)
Documentation
data Closure t a where Source #
Somewhat inspired by Closure
but modified. Whereas Closure
requires
the serialised type to be a lazy ByteString
, this closure
type allows the serialised type to be given as a parameter.
decodeWithDict :: Dict (Binary a) -> ByteString -> a Source #
pattern StaticPtrTag :: Tag Source #
putClosure :: Binary t => Closure t a -> Put Source #
Inspired by putClosure
.
getClosure :: Binary t => Get (Closure t a) Source #
Inspired by getDynClosure
,
but I think simplified.