generated from tpl/purs
fix: more relaxation
This commit is contained in:
parent
d5cc8ad95e
commit
901e931af4
@ -71,8 +71,7 @@ class (Monad m, MonadSession session, MonadCursor cursor ct) <= MonadPostgres m
|
||||
cursorWith :: forall q. AsQuery q => (Array Raw -> RepT ct) -> String -> q -> cursor ~> m
|
||||
|
||||
instance
|
||||
( MonadBracket Effect.Error f m
|
||||
, MonadAff m
|
||||
( MonadAff m
|
||||
, MonadSession (SessionT m)
|
||||
, MonadCursor (CursorT t (SessionT m)) t
|
||||
) => MonadPostgres
|
||||
|
@ -17,6 +17,7 @@ import Effect.Aff.Postgres.Client (Client)
|
||||
import Effect.Aff.Postgres.Client as Client
|
||||
import Effect.Aff.Postgres.Pool (Pool)
|
||||
import Effect.Aff.Postgres.Pool as Pool
|
||||
import Effect.Aff.Unlift (class MonadUnliftAff)
|
||||
import Effect.Class (class MonadEffect, liftEffect)
|
||||
import Effect.Exception as Effect
|
||||
import Effect.Postgres.Error (RE)
|
||||
@ -70,7 +71,7 @@ class MonadAff m <= MonadSession m where
|
||||
-- | ```
|
||||
streamOut :: String -> m (Readable ())
|
||||
|
||||
instance (MonadStartSession s, MonadBracket Effect.Error f m, MonadAff m) => MonadSession (RE s m) where
|
||||
instance (MonadStartSession s, MonadAff m) => MonadSession (RE s m) where
|
||||
query q = do
|
||||
pool <- ask
|
||||
client <- hoist liftAff $ RE.liftExcept $ startSession pool
|
||||
|
@ -34,7 +34,7 @@ newtype RE r m a = RE (ReaderT r (ExceptT E m) a)
|
||||
|
||||
newtype ParRE r f a = ParRE (ReaderT r (Compose f (Either E)) a)
|
||||
|
||||
finally :: forall r f m a. MonadBracket Effect.Error f m => RE r m Unit -> RE r m a -> RE r m a
|
||||
finally :: forall r m a. Monad m => RE r m Unit -> RE r m a -> RE r m a
|
||||
finally after m = (m <* after) `catchError` \e -> after *> throwError e
|
||||
|
||||
run :: forall m r a. MonadThrow Effect.Error m => RE r m a -> r -> m a
|
||||
|
Loading…
Reference in New Issue
Block a user