title: Monadic buffers in OCaml
body: <p>When using <code>Buffers.t</code> in a function <code>f</code>, I often use the following pattern:</p>
  
  <ol>
  <li>Create a fresh buffer or empty a previously existing buffer.</li>
  <li>Pass that buffer to a function which fills it.</li>
  <li>Extract the result, empty the buffer and return the result.</li>
  </ol>
  
  <p>How can I encode this pattern in a monad?</p>