Implemented module as proposed by me in #6.
I'm not sure about module name though.
Switch to lens
Added Action module
Could query, execute, etc be exported doing the withPostgres already, like the original API does? Is there any downside to that?
The original api is still there, so if you don't use transactions, you can still use it.
@sopvop This looks pretty nice. It makes me think maybe we should just switch wholesale and not worry about backwards compatibility. What do you think?
@mightybyte It may be too big change for many users, but I wont mind it myself. And transaction functions should be removed from old api anyway.
I think we should wait a few days for other opinions on this. Maybe someone will come up with even better solution.
So, no new ideas, lets break things!
Since @amontague, and possibly others, want old functionality, we should keep it.
Should I make prefixed/suffixed functions with embedded 'withPostgres'? What would be good suffix/prefix for it?
Or put "old" interface into other module, for compatibility? I can't make up a good name for such module, 'Simple' would be good name, but PostgresqlSimple.Simple does not sound nice.
Of course all transaction functions should be removed.
I found some time to work on this yesterday. My current thought is to see if I can merge this idea with what I did here mightybyte/postgresql-simple@ac280e7. I sent that as a pull request to postgresql-simple, but it hasn't been merged yet.
@lpsmith complained about lack of time few months ago, there are a lot of stuff in 0.3 branch of postgresql-simple waiting for cleanup and release.
Well, at this point I mostly want to get what I want done in terms of overhauling the typeinfo stuff and push it out the door. But yes, if somebody wants to play around with the 0.3 branch, I'm definitely interested in hearing feedback.
You never sent me a proper pull request, mightybyte; at this point I'm inclined to adopt your suggestion as soon as we can find an acceptable MonadCatchIO alternative and generalize things a bit more appropriately. I've found that, for example, the (... -> IO ...) -> m ... shortcut on e.g. fold just really isn't so terribly useful.
(... -> IO ...) -> m ...
Though what if you removed those functions from your wrapper?
@lpsmith how about monad-control? snap is switching to it from MonadCatchIO
Should have been closed long ago