postgresql-tx-0.1.0.0: A safe transaction monad for use with various PostgreSQL Haskell libraries.

Safe HaskellNone
LanguageHaskell2010

Database.PostgreSQL.Tx

Synopsis

Documentation

data TxM a Source #

Instances
Monad TxM Source # 
Instance details

Defined in Database.PostgreSQL.Tx

Methods

(>>=) :: TxM a -> (a -> TxM b) -> TxM b #

(>>) :: TxM a -> TxM b -> TxM b #

return :: a -> TxM a #

fail :: String -> TxM a #

Functor TxM Source # 
Instance details

Defined in Database.PostgreSQL.Tx

Methods

fmap :: (a -> b) -> TxM a -> TxM b #

(<$) :: a -> TxM b -> TxM a #

Applicative TxM Source # 
Instance details

Defined in Database.PostgreSQL.Tx

Methods

pure :: a -> TxM a #

(<*>) :: TxM (a -> b) -> TxM a -> TxM b #

liftA2 :: (a -> b -> c) -> TxM a -> TxM b -> TxM c #

(*>) :: TxM a -> TxM b -> TxM b #

(<*) :: TxM a -> TxM b -> TxM a #

(TypeError (Text "MonadIO is banned in TxM; use 'unsafeRunIOInTxM' if you are sure this is safe IO") :: Constraint) => MonadIO TxM Source # 
Instance details

Defined in Database.PostgreSQL.Tx

Methods

liftIO :: IO a -> TxM a #

UnsafeTx IO TxM Source # 
Instance details

Defined in Database.PostgreSQL.Tx

Methods

unsafeIOTx :: IO a -> TxM a Source #

Tx (ReaderT r TxM) Source # 
Instance details

Defined in Database.PostgreSQL.Tx

Associated Types

type TxEnv (ReaderT r TxM) :: Type Source #

Methods

tx :: TxEnv (ReaderT r TxM) -> ReaderT r TxM a -> TxM a Source #

type TxEnv (ReaderT r TxM) Source # 
Instance details

Defined in Database.PostgreSQL.Tx

type TxEnv (ReaderT r TxM) = r

class Tx (f :: * -> *) where Source #

Type class for converting an f to TxM given a TxEnv.

Associated Types

type TxEnv f :: * Source #

The runtime environment needed to convert f to TxM.

Methods

tx :: TxEnv f -> f a -> TxM a Source #

Converts an f to a TxM.

Instances
Tx (ReaderT r TxM) Source # 
Instance details

Defined in Database.PostgreSQL.Tx

Associated Types

type TxEnv (ReaderT r TxM) :: Type Source #

Methods

tx :: TxEnv (ReaderT r TxM) -> ReaderT r TxM a -> TxM a Source #

class UnsafeTx (io :: * -> *) (t :: * -> *) | t -> io where Source #

Promote an unsafe io action to a safe t transaction (will be some form of TxM).

Methods

unsafeIOTx :: io a -> t a Source #

Converts an io action to a t, which will be some form of TxM.

Instances
UnsafeTx IO TxM Source # 
Instance details

Defined in Database.PostgreSQL.Tx

Methods

unsafeIOTx :: IO a -> TxM a Source #

UnsafeTx io t => UnsafeTx (ReaderT r io) (ReaderT r t) Source # 
Instance details

Defined in Database.PostgreSQL.Tx

Methods

unsafeIOTx :: ReaderT r io a -> ReaderT r t a Source #

unsafeReaderIOTx :: UnsafeTx (ReaderT r io) (ReaderT r t) => (r -> io a) -> ReaderT r t a Source #

Promotes an unsafe io function to some ReaderT over TxM.