This is more a POC to have something tangible to discuss. So I've made some changes to make development easier. See the notes section.
The goal is to isolate petrol's lwt api to a separate package so users of petrol can use it with async, lwt, or eio, or maybe even with ocaml 5's threads/domains.
I'm not enough of a wizard to figure out how to create a module or functor such that we can only write petrol's apis once and merely pass along a generic Caqti connection. So I extracted all of petrol's lwt stuff into its own petrol_lwt package.
I renamed lib/ to petrol/.
Notes
I temporarily deleted petrol.mli to expose all of petrol's interface to allow petrol_lwt access to the necessary modules like Types and parts of Request. I'd like help here to expose the correct Request interface for petrol_lwt so we can keep your well-documented interface file.
I used .ocamlformat as a quick means of formatting during development. I can remove later and revert petrol.ml to whatever style you've had.
Changes
Resolves #2
This is more a POC to have something tangible to discuss. So I've made some changes to make development easier. See the notes section.
The goal is to isolate petrol's lwt api to a separate package so users of petrol can use it with async, lwt, or eio, or maybe even with ocaml 5's threads/domains.
I'm not enough of a wizard to figure out how to create a module or functor such that we can only write petrol's apis once and merely pass along a generic Caqti connection. So I extracted all of petrol's lwt stuff into its own
petrol_lwt
package.I renamed
lib/
topetrol/
.Notes
I temporarily deleted
petrol.mli
to expose all of petrol's interface to allowpetrol_lwt
access to the necessary modules likeTypes
and parts ofRequest
. I'd like help here to expose the correctRequest
interface forpetrol_lwt
so we can keep your well-documented interface file.I used
.ocamlformat
as a quick means of formatting during development. I can remove later and revertpetrol.ml
to whatever style you've had.