Closed ada2k closed 6 months ago
I assume you are seeing a compile-time error related to the net
component of the environment containing additional `Unix
functionality. In general if you have an environment which is richer than needed, you can restrict it with (myenv :> Caqti_eio.stdenv)
before passing it, which should also work here.
Thank you! I'm not too familiar with classes, so sorry for wasting your time.
No problem; it's one of the lesser known parts of the language. Maybe the preferred way would have been to pass the three resources individually, though I think the current approach of bundling them provides a better chance of programs being compatible with new versions of Caqti which might require extra resources from the stdenv.
I know caqti-eio is prerelease, but would it's API be stable enough to receive some documentation? I would be happy to translate the bikereg example from Lwt. I think Eio can present unfamiliar elements to more people than me (especially with it's use of the class system), so a simple 1-1 demonstration of an lwt program would be useful.
Yes, I realized some documentation is needed here. I will add some basics to the API doc. The caqti-study is maybe a better place for examples. I have considered moving the bikereg there, as well. We should coordinate that with @benjamin-thomas who has done most of the current work there.
Sounds good to me :+1:
I've opened an issue to track this. We can discuss there if you feel like giving a hand @ada2k
Hi, The ~stdenv argument taken by caqti-eio does not appear to be compatible with Eio_unix.Stdenv. If I manually create an object with the net, clock and mono_clock methods copied from Eio_unix.Stdenv, it then throws a type error expecting [
Generic] instead of [
Generic |Unix]. Editing system.ml to accept [
Generic | `Unix ] allows me to connect to a postgres instance fine. I have caqti pinned to master with eio 0.14, not tested on release. Thank you