orville-postgresql-1.0.0.0: A Haskell library for PostgreSQL
CopyrightFlipstone Technology Partners 2023
LicenseMIT
StabilityStable
Safe HaskellSafe-Inferred
LanguageHaskell2010

Orville.PostgreSQL.UnliftIO

Description

This module provides functions that can be used to implement MonadOrvilleControl for monads that implement MonadUnliftIO. For example:

module MyMonad
  ( MyMonad
  ) where

import qualified Control.Monad.IO.Unlift as UnliftIO
import qualified Orville.PostgreSQL as O
import qualified Orville.PostgreSQL.UnliftIO as OrvilleUnliftIO

newtype MyMonad =
  ...
  deriving (UnliftIO.MonadUnliftIO)

instance O.MonadOrvilleControl MyMonad where
  liftWithConnection = OrvilleUnliftIO.liftWithConnectionViaUnliftIO
  liftCatch = OrvilleUnliftIO.liftCatchViaUnliftIO
  liftMask = OrvilleUnliftIO.liftMaskViaUnliftIO

Since: 1.0.0.0

Synopsis

Documentation

liftWithConnectionViaUnliftIO :: MonadUnliftIO m => (forall a. (conn -> IO a) -> IO a) -> (conn -> m b) -> m b Source #

liftWithConnectionViaUnliftIO can be used as the implementation of liftWithConnection for MonadOrvilleControl when the Monad implements MonadUnliftIO.

Since: 1.0.0.0

liftCatchViaUnliftIO :: MonadUnliftIO m => (forall a. IO a -> (e -> IO a) -> IO a) -> m b -> (e -> m b) -> m b Source #

liftCatchViaUnliftIO can be used as the implementation of liftCatch for MonadOrvilleControl when the Monad implements MonadUnliftIO.

Since: 1.0.0.0

liftMaskViaUnliftIO :: MonadUnliftIO m => (forall b. ((forall a. IO a -> IO a) -> IO b) -> IO b) -> ((forall a. m a -> m a) -> m c) -> m c Source #

liftMaskViaUnliftIO can be used as the implementation of liftMask for MonadOrvilleControl when the Monad implements MonadUnliftIO.

Since: 1.0.0.0