|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [MirageOS-devel] How to use Functoria_app.Cmd.read, Functoria and utop
Hi,
I'm trying to do something like this in mirage/mirage.ml:
let get_ld target =
Cmd.read
"PKG_CONFIG_PATH=$(opam config var lib)/lib/pkgconfig solo5-kernel-%s
--variable=ld" target >>| fun output ->
output
i.e. execute the shell command and return the output.
How should I use the "RResult" type to check that the command
completed successfully, and have the return type of this expression be the
output string?
The Functoria docs for Cmd.read are all of:
"val read : ('a, unit, string, (string, string) Rresult.result)
Pervasives.format4 -> 'a"
...which doesn't really tell me much :-(
Also, how can I test code using Functoria interactively using eg. 'utop'?
It'd make things much easier if I could try out the various subexpressions
interactively to see what the actual types are.
Martin
_______________________________________________
MirageOS-devel mailing list
MirageOS-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/cgi-bin/mailman/listinfo/mirageos-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |