[Haskell-beginners] State, StateT, or ST for game settings?
Francesco Ariis
fa-ml at ariis.it
Sun Mar 19 00:59:05 UTC 2017
On Sat, Mar 18, 2017 at 08:42:38PM -0400, Dave Martin wrote:
> I would like to create a game with a "main menu" offering the user a choice of "playing the game" or accessing a "settings menu," in which he can change defaults that would affect the game play (e.g. board size, etc.).
>
> I know (barely) enough about the "IO monad" to write the menus and the basic gameplay, but what device do I need in order to manage the settings? A State monad? A StateT monad transformer? An ST monad? None of the above? I have some basic familiarity with the first two, but not enough to really grasp how they are actually used.
Hello Dave,
State will do! Of course if you need to mix the two monads (State +
IO) you need a State transformer (StateT)
-F
More information about the Beginners
mailing list