I’ve uploaded 2 new packages candidates: effectful-postgresql and effectful-opaleye. These integrate postgresql-simple and opaleye with effectful. I’d appreciate any feedback, especially on the effectful unlifting stuff which I’m not 100% confident about.
effectful-postgresql defines a simple dynamic effect WithConnection which abstracts the idea of “give me a postgresql-simple Connection, so I can do something with it”. I can think of 2 ways of interpreting this effect, both of which are implemented in the library: providing one Connection for the entire duration of the interpreted program (see runWithConnection or runWithConnectInfo); or using a Pool of connections and only opening one when needed (see runWithConnectionPool).
effectful-opaleye builds on the above by using the provided Connection to run type-safe PostgreSQL operations using opaleye.
If possible, I’d like to request feedback from people who understand effectful/postgresql-simple/oplaye internals well (maybe @tomjaguarpaw or @Kleidukos?). At the moment in my interpreters I’m using localSeqUnlift(IO) : here, here, here and here. Does this make sense, or should I be using a different UnliftStrategy?