makeState :: String -> IO State
makeState source' = do
    environment' <- newIORef Nothing
    lastEnvironment' <- newIORef Nothing
    rotation' <- newIORef (Vector3 0 0 (0 :: GLfloat))
    blurFactor' <- newIORef 0
    currentResolution' <- newIORef (Size 0 0)
    forceResolution' <- newIORef $ Nothing
    renderTexture' <- newIORef Nothing
    lastRenderTexture' <- newIORef Nothing
    renderFramebuffer' <- newIORef Nothing
    lastRenderFramebuffer' <- newIORef Nothing
    lastRenderDepthBuffer' <- newIORef Nothing
    blurProgram' <- newIORef Nothing
    depthBuffer' <- newIORef Nothing
    lastPosition' <- newIORef (Position (-1) (-1 :: GLint))
    lastReloadCheck' <- getCurrentTime >>= newIORef
    lastSourceModification' <- getCurrentTime >>= newIORef
    frameCounter' <- newIORef 0
    framesPerSecond' <- newIORef 0
    showFramesPerSecond' <- newIORef False
    lastFrameCounterTime' <- getCurrentTime >>= newIORef
    initFunc' <- newIORef Nothing
    showHelp' <- newIORef False
    showREPL' <- newIORef False
    replInputLine' <- newIORef newInputLine
    replLines' <- newIORef []
    return State {
        environment = environment',
        lastEnvironment = lastEnvironment',
        rotation = rotation',
        forceResolution = forceResolution',
        currentResolution = currentResolution',
        blurFactor = blurFactor',
        renderTexture = renderTexture',
        lastRenderTexture = lastRenderTexture',
        renderFramebuffer = renderFramebuffer',
        lastRenderFramebuffer = lastRenderFramebuffer',
        lastPosition = lastPosition',
        blurProgram = blurProgram',
        lastRenderDepthBuffer = lastRenderDepthBuffer',
        depthBuffer = depthBuffer',
        lastReloadCheck = lastReloadCheck',
        lastSourceModification = lastSourceModification',
        frameCounter = frameCounter',
        framesPerSecond = framesPerSecond',
        lastFrameCounterTime = lastFrameCounterTime',
        showFramesPerSecond = showFramesPerSecond',
        source = source',
        initFunc = initFunc',
        showHelp = showHelp',
        showREPL = showREPL',
        replInputLine = replInputLine',
        replLines = replLines'
        }
makeState :: String -> IO State
makeState source' = do
    environment' <- newIORef Nothing
    lastEnvironment' <- newIORef Nothing
    rotation' <- newIORef (Vector3 0 0 (0 :: GLfloat))
    blurFactor' <- newIORef 0
    currentResolution' <- newIORef (Size 0 0)
    forceResolution' <- newIORef $ Nothing
    renderTexture' <- newIORef Nothing
    lastRenderTexture' <- newIORef Nothing
    renderFramebuffer' <- newIORef Nothing
    lastRenderFramebuffer' <- newIORef Nothing
    lastRenderDepthBuffer' <- newIORef Nothing
    blurProgram' <- newIORef Nothing
    depthBuffer' <- newIORef Nothing
    lastPosition' <- newIORef (Position (-1) (-1 :: GLint))
    lastReloadCheck' <- getCurrentTime >>= newIORef
    lastSourceModification' <- getCurrentTime >>= newIORef
    frameCounter' <- newIORef 0
    framesPerSecond' <- newIORef 0
    showFramesPerSecond' <- newIORef False
    lastFrameCounterTime' <- getCurrentTime >>= newIORef
    initFunc' <- newIORef Nothing
    showHelp' <- newIORef False
    showREPL' <- newIORef False
    replInputLine' <- newIORef newInputLine
    replLines' <- newIORef []
    return State {
        environment = environment',
        lastEnvironment = lastEnvironment',
        rotation = rotation',
        forceResolution = forceResolution',
        currentResolution = currentResolution',
        blurFactor = blurFactor',
        renderTexture = renderTexture',
        lastRenderTexture = lastRenderTexture',
        renderFramebuffer = renderFramebuffer',
        lastRenderFramebuffer = lastRenderFramebuffer',
        lastPosition = lastPosition',
        blurProgram = blurProgram',
        lastRenderDepthBuffer = lastRenderDepthBuffer',
        depthBuffer = depthBuffer',
        lastReloadCheck = lastReloadCheck',
        lastSourceModification = lastSourceModification',
        frameCounter = frameCounter',
        framesPerSecond = framesPerSecond',
        lastFrameCounterTime = lastFrameCounterTime',
        showFramesPerSecond = showFramesPerSecond',
        source = source',
        initFunc = initFunc',
        showHelp = showHelp',
        showREPL = showREPL',
        replInputLine = replInputLine',
        replLines = replLines'
        }
makeState source' = do
    environment' <- newIORef Nothing
    lastEnvironment' <- newIORef Nothing
    rotation' <- newIORef (Vector3 0 0 (0 :: GLfloat))
    blurFactor' <- newIORef 0
    currentResolution' <- newIORef (Size 0 0)
    forceResolution' <- newIORef $ Nothing
    renderTexture' <- newIORef Nothing
    lastRenderTexture' <- newIORef Nothing
    renderFramebuffer' <- newIORef Nothing
    lastRenderFramebuffer' <- newIORef Nothing
    lastRenderDepthBuffer' <- newIORef Nothing
    blurProgram' <- newIORef Nothing
    depthBuffer' <- newIORef Nothing
    lastPosition' <- newIORef (Position (-1) (-1 :: GLint))
    lastReloadCheck' <- getCurrentTime >>= newIORef
    lastSourceModification' <- getCurrentTime >>= newIORef
    frameCounter' <- newIORef 0
    framesPerSecond' <- newIORef 0
    showFramesPerSecond' <- newIORef False
    lastFrameCounterTime' <- getCurrentTime >>= newIORef
    initFunc' <- newIORef Nothing
    showHelp' <- newIORef False
    showREPL' <- newIORef False
    replInputLine' <- newIORef newInputLine
    replLines' <- newIORef []
    return State {
        environment = environment',
        lastEnvironment = lastEnvironment',
        rotation = rotation',
        forceResolution = forceResolution',
        currentResolution = currentResolution',
        blurFactor = blurFactor',
        renderTexture = renderTexture',
        lastRenderTexture = lastRenderTexture',
        renderFramebuffer = renderFramebuffer',
        lastRenderFramebuffer = lastRenderFramebuffer',
        lastPosition = lastPosition',
        blurProgram = blurProgram',
        lastRenderDepthBuffer = lastRenderDepthBuffer',
        depthBuffer = depthBuffer',
        lastReloadCheck = lastReloadCheck',
        lastSourceModification = lastSourceModification',
        frameCounter = frameCounter',
        framesPerSecond = framesPerSecond',
        lastFrameCounterTime = lastFrameCounterTime',
        showFramesPerSecond = showFramesPerSecond',
        source = source',
        initFunc = initFunc',
        showHelp = showHelp',
        showREPL = showREPL',
        replInputLine = replInputLine',
        replLines = replLines'
        }