[Haskell-cafe] Storing functional values

Dylan Thurston dpt at lotus.bostoncoop.net
Sun Feb 1 16:12:32 EST 2004

On Fri, Jan 30, 2004 at 09:21:58AM -0700, nickgrey at softhome.net wrote:
> Hi, 
> I'm writing a game in Haskell.  The game state includes a lot of closures.  
> For example, if a game object wants to trigger an event at a particular 
> time, it adds a function (WorldState -> WorldState) to a queue.  Similarly 
> there are queues which contain lists of functions which respond to events.  
> (CreatureAttackEvent -> WorldState -> WorldState) 
> I'd like to be able to save the game state to disk so that it can be 
> reloaded.  Obviously, these closures are now a problem, as they can't be 
> stored. 

It seems like there are two things you want to do with these
functional closures: save them to disk, and run them as functions.
Why not combine these two into a type class?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://haskell.org/pipermail/haskell-cafe/attachments/20040201/9035e0ed/attachment.bin

More information about the Haskell-Cafe mailing list