Maintaining complex state in Haskell

前端 未结 2 512
抹茶落季
抹茶落季 2020-12-22 18:47

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, f

2条回答
  •  忘掉有多难
    2020-12-22 19:27

    I know this is old topic. But I am facing the same problem right now while trying to implement Rail Fence cipher exercise from exercism.io. It is quite disappointing to see such a common problem having such poor attention in Haskell. I don't take it that to do some as simple as maintaining state I need to learn FRP. So, I continued googling and found solution looking more straightforward - State monad: https://en.wikibooks.org/wiki/Haskell/Understanding_monads/State

提交回复
热议问题