Is there any thought as to a better way to deal with

https://github.com/haskell-opengl/OpenGL/blob/master/Graphics/Rendering/OpenGL/GL/Shaders.hs ?

If you have code that dynamically constructs and deletes single shaders frequently, the API exposed there just introduces O(n) overhead for every such construction.

setAttachedShaders
:: Program -> ([VertexShader],[FragmentShader]) -> IO ()
setAttachedShaders p@(Program program) (vs, fs) = do
   currentIDs <- getAttachedShaderIDs p
   let newIDs = map shaderID vs ++ map shaderID fs
   mapM_ (glAttachShader program) (newIDs \\ currentIDs)
   mapM_ (glDetachShader program) (currentIDs \\ newIDs)

-Edward Kmett