tryAcquire :: Lock -> IO (Maybe (Acquisition Lock))
tryAcquire l = do
  mVal <- tryTakeMVar $ lock l
  return $ case mVal of
    Nothing -> Nothing
    Just val -> Just $ Acquisition (putMVar (lock l) val)
tryAcquire :: Lock -> IO (Maybe (Acquisition Lock))
tryAcquire l = do
  mVal <- tryTakeMVar $ lock l
  return $ case mVal of
    Nothing -> Nothing
    Just val -> Just $ Acquisition (putMVar (lock l) val)
tryAcquire l = do
  mVal <- tryTakeMVar $ lock l
  return $ case mVal of
    Nothing -> Nothing
    Just val -> Just $ Acquisition (putMVar (lock l) val)