whenWindow :: IORef GLFWState -> (GLFW.Window -> IO a) -> IO (Maybe a)
whenWindow ref f = do
  maybeWindow <- ref ^@ glfwWindow
  forM maybeWindow f
whenWindow :: IORef GLFWState -> (GLFW.Window -> IO a) -> IO (Maybe a)
whenWindow ref f = do
  maybeWindow <- ref ^@ glfwWindow
  forM maybeWindow f
whenWindow ref f = do
  maybeWindow <- ref ^@ glfwWindow
  forM maybeWindow f