rightfold / purescript-postgresql-client

https://pursuit.purescript.org/packages/purescript-postgresql-client
BSD 3-Clause "New" or "Revised" License
35 stars 20 forks source link

Move `PG` to separate module or contrib #34

Closed paluh closed 5 years ago

paluh commented 5 years ago

@akheron I've done some simple code separation on simple-core branch.

I'm thinking about two possible approaches to PG monad developement which we should clarify before the next release:

To be honest I prefer the first option a bit but I'm not sure if this approach is acceptable for our core library ;-)

What do you think?

akheron commented 5 years ago

Going for Aff (Either PGError a) seems like the best option for interoperability with monad stacks. I think this question concerns those users who don't have a custom stack already. It boils down to whether we should give our own stack (the Database.PostgreSQL.PG module) or mere helper functions and examples on how to create your own stack.

paluh commented 5 years ago

Going for Aff (Either PGError a) seems like the best option for interoperability with monad stacks. I think this question concerns those users who don't have a custom stack already.

I've added PG.hoist and PG.hoistWith helpers so even if a user have a custom moand stack it is quite usual to put ExceptT as the last layer of such a stack and it can reuse some parts of existing PG functionality just by hoisting to app stack.

It boils down to whether we should give our own stack (the Database.PostgreSQL.PG module) or mere helper functions and examples on how to create your own stack.

So, I think we are going to provide our stack as a starter.

Do you agree with code organization which you can find on the branch?

akheron commented 5 years ago

Yes, this sounds good!