shaders :: IO GL.Program
shaders = do
  v <- GL.createShader GL.VertexShader
  GL.shaderSourceBS v GL.$= vector
  GL.compileShader v
  vs <- GL.get (GL.compileStatus v)
  unless vs $ do
    print =<< GL.get (GL.shaderInfoLog v)
    exitFailure

  f <- GL.createShader GL.FragmentShader
  GL.shaderSourceBS f GL.$= fragment
  GL.compileShader f
  fs <- GL.get (GL.compileStatus f)
  unless fs $ do
    putStrLn =<< GL.get (GL.shaderInfoLog f)
    exitFailure

  p <- GL.createProgram
  GL.attachShader p v
  GL.attachShader p f
  GL.linkProgram p
  return p
shaders :: IO GL.Program
shaders = do
  v <- GL.createShader GL.VertexShader
  GL.shaderSourceBS v GL.$= vector
  GL.compileShader v
  vs <- GL.get (GL.compileStatus v)
  unless vs $ do
    print =<< GL.get (GL.shaderInfoLog v)
    exitFailure

  f <- GL.createShader GL.FragmentShader
  GL.shaderSourceBS f GL.$= fragment
  GL.compileShader f
  fs <- GL.get (GL.compileStatus f)
  unless fs $ do
    putStrLn =<< GL.get (GL.shaderInfoLog f)
    exitFailure

  p <- GL.createProgram
  GL.attachShader p v
  GL.attachShader p f
  GL.linkProgram p
  return p
shaders = do
  v <- GL.createShader GL.VertexShader
  GL.shaderSourceBS v GL.$= vector
  GL.compileShader v
  vs <- GL.get (GL.compileStatus v)
  unless vs $ do
    print =<< GL.get (GL.shaderInfoLog v)
    exitFailure

  f <- GL.createShader GL.FragmentShader
  GL.shaderSourceBS f GL.$= fragment
  GL.compileShader f
  fs <- GL.get (GL.compileStatus f)
  unless fs $ do
    putStrLn =<< GL.get (GL.shaderInfoLog f)
    exitFailure

  p <- GL.createProgram
  GL.attachShader p v
  GL.attachShader p f
  GL.linkProgram p
  return p