I want to code a game in Haskell where every iteration of the loop computes the state of the world. I thought I should create a function:
gameLoop :: World -> World
-- ...
and have main :: IO ()
call it:
main = do
gameLoop -- ...
But the problem is that I'm missing some fundamental understanding of how to wrap the gameLoop
function so that it returns main
's parameter value.
How would one go about creating a game loop in Haskell?
a >> recurse
where(>>)
is the last function, notrecurse
. – Clasping