title: Warp web service with a long lived resource (a file handle)
body: <p>I'm trying to understand how to write a web service using warp that has a long lived resource that I want access to from all my requests (i.e. I want the resource to exist for the life time of server, not per request). I'm assuming this is a use for ResourceT, but I'm unsure how I actually do this.</p>
  
  <p>My particular use is that I want to expose a file handle, that I currently have wrapped up in the state monad. I'm happy to change this approach, if this doesn't make sense when using warp and ResourceT. An early version of this code can be seen on code review: <a href="https://codereview.stackexchange.com/questions/9177/my-simple-haskell-key-value-file-store">https://codereview.stackexchange.com/questions/9177/my-simple-haskell-key-value-file-store</a></p>
  
  <p>Thanks in advance,</p>
  
  <p>Matt</p>