informatikr / hedis

A Redis client library for Haskell.
http://hackage.haskell.org/package/hedis
BSD 3-Clause "New" or "Revised" License
330 stars 125 forks source link

Make withConnect friendly to transformer stack #149

Closed TomMD closed 4 years ago

TomMD commented 4 years ago

withConnect has an embedded IO (i.e. -> (a -> IO b) ->) which is famously annoying for monad stacks. We can generalize this really easily though using MonadMask from the exceptions package and lifting the connect/disconnect calls.

k-bx commented 4 years ago

@TomMD thanks! I wonder, what was the reason to add the doctest constraint? The code is building fine on GHC 8.4 for me via stack build --stack-yaml ./stack-8.4.yaml without that constraint, but fails for 8.4 and older as can be seen in Travis , so I wonder what's the reason there. Thanks!

p.s.: I don't really use the run-tests script, neither our Travis configuration, I wonder if we should just remove it.

TomMD commented 4 years ago

I could remove that constraint if you desire. It was rather unmotivated.

k-bx commented 4 years ago

Please do, it'd fix older GHC versions.

k-bx commented 4 years ago

Thanks, uploaded as 0.12.12