How to hold common data

Hello all, I'm new to haskell and was just wondering if there was any efficient or standard way to store and modify some sort of state data. The functional nature of haskell has me confused in this respect! Basically what I want to achieve is an interactive program that allows you to edit some tables, and thus hold some data. I dont' need to be spoonfed an answer, but a general guideline would be very helpful :) Thanks for any help you could provide! Regards, Scott

At 4:09 PM +0000 5/12/04, scott west wrote:
Hello all, I'm new to haskell and was just wondering if there was any efficient or standard way to store and modify some sort of state data. The functional nature of haskell has me confused in this respect! Basically what I want to achieve is an interactive program that allows you to edit some tables, and thus hold some data. I dont' need to be spoonfed an answer, but a general guideline would be very helpful :) Thanks for any help you could provide!
One very simple approach is to provide your interactive program --which will be an IO action that calls itself-- with a parameter representing the state. --Ham -- ------------------------------------------------------------------ Hamilton Richards, PhD Department of Computer Sciences Senior Lecturer The University of Texas at Austin 512-471-9525 1 University Station C0500 Taylor Hall 5.138 Austin, Texas 78712-0233 ham@cs.utexas.edu hrichrds@swbell.net ------------------------------------------------------------------

At 16:09 12/05/04 +0000, scott west wrote:
Hello all, I'm new to haskell and was just wondering if there was any efficient or standard way to store and modify some sort of state data. The functional nature of haskell has me confused in this respect! Basically what I want to achieve is an interactive program that allows you to edit some tables, and thus hold some data. I dont' need to be spoonfed an answer, but a general guideline would be very helpful :) Thanks for any help you could provide!
Have you looked at using a state monad? I recommend the following paper. I found it a very useful and motivating introduction to monads: Simon Peyton-Jones and John Launchbury, State in Haskell, linked from: http://research.microsoft.com/Users/simonpj/Papers/papers.html#monads, document at: http://research.microsoft.com/Users/simonpj/Papers/state-lasc.ps.gz, also at: http://www.cse.ogi.edu/~jl/Papers/stateThreads.ps. (I have some other Haskell references that I found useful when learning Haskell over the past year, at http://www.ninebynine.org/Links.html#Programming-Haskell .) #g ------------ Graham Klyne For email: http://www.ninebynine.org/#Contact
participants (3)
-
Graham Klyne
-
Hamilton Richards
-
scott west