How can i use MVars to move paddles on my pingpong haskell game?
问题 I already have a function that moves 2 paddles in a ping pong game in haskell. I want to change so it uses MVars now. I know that i need to change wHeld, sHeld, downHeld and upHeld to MVars but any ideas on how to change movePaddle to deal with MVars? Also when i declare wHeld an MVars it shows a error on deriving show (Non instance for (Show MVar Bool)) data PongGame = Game { ballLoc :: (Float, Float) -- ^ Pong ball (x, y) location. , ballVel :: (Float, Float) -- ^ Pong ball (x, y) velocity.