fix: more relaxation

This commit is contained in:
orion 2024-06-25 16:02:15 -05:00
parent d5cc8ad95e
commit 901e931af4
Signed by: orion
GPG Key ID: 6D4165AE4C928719
3 changed files with 4 additions and 4 deletions

View File

@ -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

View File

@ -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

View File

@ -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