savonet / ocaml-posix

Bindings to the various POSIX APIs
https://www.liquidsoap.info/ocaml-posix/
MIT License
27 stars 2 forks source link

Provide module types? (Question) #6

Open jsoo1 opened 3 years ago

jsoo1 commented 3 years ago

This is more a question than anything else. Is it possible to create module types for these posix modules? I am working on a library and I am wondering how I can let the user bring their own c libraries. It would be nice to refer to some ocaml type or function in the library and defer to the library user to bring their own platform-specific ffi. Maybe this is an ill formed thought and I don’t know how to use your library. Thanks for your work! So far it works nicely!

toots commented 3 years ago

Hi! I'm not sure if I follow your question. There is an online API documentation here: https://www.liquidsoap.info/ocaml-posix/

jsoo1 commented 3 years ago

Hm. I think what I was thinking of was something closer to abstract module types. Suppose I wrote a Rust or Ocaml version of the posix api that I want to use instead of the C version. It would be very cool to have an abstract interface to implement (or use).