Documentation for unix-base and vi line-editing in Ocaml shell

Hi all, I have two-ish questions,

I’d like to know how to view the documentation of unix system API for the package unix-base. I generated documentation with odig odoc, but somehow unix-base docs did not appear?

My hope is to add vi-style line-editing support to Utop by linking in GNUreadline, and for this I need access to a number of Unix syscalls, e.g. select. However, there seem to be few resources for Unix programming in Ocaml. Is this a reasonable endeavour?

Is there maybe already a REPL that simultaneously has vi line-editing and syntax-aware completion like Utop? I need something more powerful than rlwrap ocaml.

Thanks, and sorry for asking a few questions as one.

1 Like

The unix library is installed by the ocaml compiler in the lib/ocaml directory so as per odig conventions that’s where you’ll find the documentation see e.g. here.

I don’t think there is anything else of similar scope to utop. I would also love to have vi editing in utop; there is a feature request since a long while. AFAIK utop depends on lambda-term, which may be where the vi editing needs to go. There was also a floating idea of rewriting utop to use notty instead but this has not materialized AFAIK.

With utop, you also have Ctrl-X Ctrl-E (same as in bash) to edit the current input in $EDITOR:

https://github.com/diml/lambda-term/issues/1

2 Likes