From 746b934bbeb8c3836b45d8bf3b80119e78d14f2c Mon Sep 17 00:00:00 2001 From: Nikita Volkov Date: Sat, 29 Nov 2014 22:23:29 +0300 Subject: [PATCH] Fix the "list-t" dep --- hasql.cabal | 4 ++-- library/Hasql.hs | 9 +++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/hasql.cabal b/hasql.cabal index 7f8d851..6093ed0 100644 --- a/hasql.cabal +++ b/hasql.cabal @@ -1,7 +1,7 @@ name: hasql version: - 0.3.0 + 0.4.0 synopsis: A minimalistic general high level API for relational databases description: @@ -105,7 +105,7 @@ library bytestring == 0.10.*, text >= 1.0 && < 1.3, -- control: - list-t >= 0.2.4 && < 0.4, + list-t >= 0.3 && < 0.4, monad-control == 0.3.*, transformers-base == 0.4.*, -- errors: diff --git a/library/Hasql.hs b/library/Hasql.hs index 448db27..e98f936 100644 --- a/library/Hasql.hs +++ b/library/Hasql.hs @@ -279,12 +279,13 @@ tx m t = newtype TxListT s m r = TxListT (ListT.ListT m r) deriving (Functor, Applicative, Alternative, Monad, MonadTrans, MonadPlus, - Monoid, ListT.ListMonad) + Monoid, ListT.MonadCons) -instance ListT.ListTrans (TxListT s) where +instance ListT.MonadTransUncons (TxListT s) where uncons = - unsafeCoerce - (ListT.uncons :: ListT.ListT m r -> m (Maybe (r, ListT.ListT m r))) + (liftM . fmap . fmap) (unsafeCoerce :: ListT.ListT m r -> TxListT s m r) . + ListT.uncons . + (unsafeCoerce :: TxListT s m r -> ListT.ListT m r) -- * Statements execution