Skip to content

Instantly share code, notes, and snippets.

@tcrayford
Created December 13, 2012 22:34
Show Gist options
  • Save tcrayford/4280703 to your computer and use it in GitHub Desktop.
Save tcrayford/4280703 to your computer and use it in GitHub Desktop.
withResourceSnap :: Pool a -> (a -> Handler b v c) -> Handler b v c
withResourceSnap pool act = bracketHandler (takeResource pool) putResource' runAction
where runAction (a,b) = act a
putResource' (a,b) = putResource b a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment