Maintaining complex state in Haskell
Suppose you're building a fairly large simulation in Haskell. There are many different types of entities whose attributes update as the simulation progresses. Let's say, for the sake of example, that your entities are called Monkeys, Elephants, Bears, etc.. What is your preferred method for maintaining these entities' states? The first and most obvious approach I thought of was this: mainLoop :: [Monkey] -> [Elephant] -> [Bear] -> String mainLoop monkeys elephants bears = let monkeys' = updateMonkeys monkeys elephants' = updateElephants elephants bears' = updateBears bears in if shouldExit