{-# OPTIONS_GHC -fno-warn-orphans #-}

module Network.Minio.Instances
  (
  ) where

import ClassyPrelude

import Network.Minio

import qualified UnliftIO.Exception as UnliftIO
import Control.Monad.Catch


instance MonadThrow Minio where
  throwM = UnliftIO.throwIO

instance MonadCatch Minio where
  catch = UnliftIO.catch

instance MonadMask Minio where
  mask = UnliftIO.mask
  uninterruptibleMask = UnliftIO.uninterruptibleMask
  generalBracket acq rel inner = withUnliftIO $ \UnliftIO{..} -> generalBracket (unliftIO acq) ((unliftIO .) . rel) $ unliftIO . inner
