} … loop window initialState … loop window state = do threadDelay 20000 pollEvents (left, right, up, down) <- getInputKeys window let newState = movePlayer (left,right,up,down) state 10 renderFrame newState window if k then return () else loop window newState