Hello! I love using elpi. Thanks for maintaining and continuing to evolve it!
I am working on a personal toy project and have occasion to considerably expand the builtins with bindings to ocaml functions form Filename, Sys, and Unix to expand its capabilities for OS interactions and file manipulations. The FFI extension mechanism is easy and works very well, so thanks for that!
To illustrate, at this point, I've just about a dozen declarations of this sort
MLData (result (BuiltInData.poly "A") (BuiltInData.poly "B"));
MLCode (Pred ("readdir",
In (BuiltInData.string, "DirPath",
Out (result BuiltInData.(list string) BuiltInData.string, "Contents",
Easy "get the contents of the directory at DirPath")),
(fun path _ ~depth:_ ->
try !: (Ok (Sys.readdir path |> Array.to_list))
with Sys_error e -> !: (Error e))),
DocAbove);
As I am accumulating this growing list of MLCode entries, it occurs to me it would be easy to contribute these back to the core elpi builtin.ml. Would you be interested in these contributions? (I can understand that you may well prefer not to bloat elpi with such features :) ).
Hello! I love using elpi. Thanks for maintaining and continuing to evolve it!
I am working on a personal toy project and have occasion to considerably expand the builtins with bindings to ocaml functions form
Filename,Sys, andUnixto expand its capabilities for OS interactions and file manipulations. The FFI extension mechanism is easy and works very well, so thanks for that!To illustrate, at this point, I've just about a dozen declarations of this sort
As I am accumulating this growing list of
MLCodeentries, it occurs to me it would be easy to contribute these back to the core elpibuiltin.ml. Would you be interested in these contributions? (I can understand that you may well prefer not to bloat elpi with such features :) ).