Last active
June 3, 2017 06:31
-
-
Save evanrinehart/688cdbb2dc8f4f86281d34de5d899e37 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
withShader :: ShType -> Src -> (GLuint -> IO (Either String a)) -> IO (Either String a) | |
withShader ty src action = mask $ \restore -> do | |
eithv <- loadShader ty src | |
case eithv of | |
Left err -> return (Left err) | |
Right v -> restore (action v) `finally` deleteShader v |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment