[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MirageOS-devel] How to use Functoria_app.Cmd.read, Functoria and utop

> 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.

#require “functoria.app”;;
open Functoria_app;;
match Cmd.read "echo %d" 4 with Ok s -> s | Error e -> failwith e;;
- : string = "4\n”

The type of `Cmd.read` just means that you can use the usual `printf`-style 
arguments and instead of printing it will return an `Ok of ‘a | Error of 
string` error.


MirageOS-devel mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.