Safe Haskell | Safe |
---|
Once
Description
This trusted module defines functions for creating and running once-only computations -- computations that may only be run once.
Documentation
runOnce :: Once a b -> a -> DC (Maybe b)
returns a runOnce
once xDC
action that tries to run the
once-only computation once
with argument x
. First, the DC
action tries to raise the current label to dcPublic
, raising an
exception if this isn't possible.
Assuming once
was created by running
:
makeOnce
f