Mon Jun 29 18:42:39 CEST 2009 Daniel Schoepe
* Add an extensible state field to XState
This patch adds functionality for other modules to store
arbitrary data in XState. The patch also ensures that the
data persists between restarts.
This can be used to simplify modules that use IORefs to
maintain some form of mutable state(e.g. X.A.SpawnOn), since
passing around the IORef is now no longer necessary.
The functionality is implemented by storing a Map String StateExtension
in XState that associates string representations of data types with
their values. These values have to implement Typeable, Show and Read.
Proper instances for the latter two are only needed when one wants the
data to be persistent between restarts.