RPC-0.3: Mechanism for (de)serializing closures for remote execution.

Safe HaskellSafe-Infered



A simple type to represent a closure, that is, a function and its environment. The current implementation represents functions as strings, but this could be theoretically swapped out for the "static" mechanism described in the paper.



data Closure a

A data type representing a closure, that is, a function with its environment. In spirit, this is actually:

   data Closure a where
     Closure :: Serializable v => Static (v -> a) -> v -> Closure a     

where the Static type wraps a function with no non-static free variables. We simulate this behavior by identifying top-level functions as strings. See the paper for clarification.


Closure String Payload 


Typeable1 Closure 
Show (Closure a) 
Serialize (Closure a) 

type BiClosure a = (a, Closure a)

This type represents a serialized AND native (local) version of a value. The consumer can use whichever is appropriate.