Setting off a interval on application launch in a Haskell Servant app
问题 I'm trying to build the backend for a browser based game using Servant, I want to have some kind of game loop that lets me fire out requests every x seconds. I already have some game state contained in an IORef , and as an initial attempt to get something working I am trying to update my state value every 2 seconds. Here is what I have: {-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE