Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Membranes are common in object-capability design. Think of it like a proxy on steroids: a membrane inserts itself in front of another capability, and can intercept and modify method calls. Unlike a simple proxy though, the membrane will also be applied to any objects returned by method calls, or passed in arguments, transitively, so it can sit in front of entire object graphs.
Documentation
enclose :: (IsClient c, MonadSTM m) => Supervisor -> c -> Policy -> m c Source #
wraps enclose
sup cap policycap
in a membrane whose behavior is
goverend by policy
.
type Policy = Call -> STM Action Source #
A Policy
decides what to do when a call crosses the membrane.
An action indicates what to do with an incoming method call.
Handle UntypedMethodHandler | Handle the method using the provided method handler, instead of letting it through the membrane. Arguments and return values will not be wrapped/unwraped, so be careful when delegating to objects inside the membrane. |
Forward | Forward the method call on to its original destination, wrapping and unwrapping arguments & return values as normal. |
A Direction indicates which direction a method call is traveling: into or out of the membrane.