withConnection :: (Lcb -> IO ()) -> IO ()
withConnection f = do
  (err, lcb) <- lcbCreate defaultParams
  assertLcbSuccess "lcbCreate() failed" err
  lcbConnect lcb >>= assertLcbSuccess "lcbConnect() failed"
  lcbWait lcb >>= assertLcbSuccess "lcbWait() failed"
  lcbGetBootstrapStatus lcb >>= assertLcbSuccess "lcbGetBootstrapStatus() failed"
  f lcb
withConnection :: (Lcb -> IO ()) -> IO ()
withConnection f = do
  (err, lcb) <- lcbCreate defaultParams
  assertLcbSuccess "lcbCreate() failed" err
  lcbConnect lcb >>= assertLcbSuccess "lcbConnect() failed"
  lcbWait lcb >>= assertLcbSuccess "lcbWait() failed"
  lcbGetBootstrapStatus lcb >>= assertLcbSuccess "lcbGetBootstrapStatus() failed"
  f lcb
withConnection f = do
  (err, lcb) <- lcbCreate defaultParams
  assertLcbSuccess "lcbCreate() failed" err
  lcbConnect lcb >>= assertLcbSuccess "lcbConnect() failed"
  lcbWait lcb >>= assertLcbSuccess "lcbWait() failed"
  lcbGetBootstrapStatus lcb >>= assertLcbSuccess "lcbGetBootstrapStatus() failed"
  f lcb