Legend:
Library
Module
Module type
Parameter
Class
Class type
Library
Module
Module type
Parameter
Class
Class type
A runtime describes the set of "low-level" primitives to operate in a specific context. This separation allows to have a pure and platform agnostic kernel (the Yocaml
module) and to define specific runtimes as needed. Here is the runtime for UNIXish (OSX/Linux).
val serve : filepath:string -> port:int -> unit Yocaml.t -> unit Lwt.t
serve ~filepath ~port engine
will serve, a bit like the sad python server, a static directory ... in addition, the function takes an OCaml program and re-executes it on every HTTP request that does not point to a 404. Very handy for continuous content development!
Inclusion of the runtime to be able to use Yocaml_unix
as runtime directly.
include Yocaml.Runtime.RUNTIME with type 'a t = 'a
val return : 'a -> 'a t
val get_time : unit -> float t
val file_exists : Yocaml__.Filepath.t -> bool t
val target_exists : Yocaml__.Filepath.t -> bool t
val is_directory : Yocaml__.Filepath.t -> bool t
val get_modification_time : Yocaml__.Filepath.t -> int Yocaml__.Try.t t
val target_modification_time : Yocaml__.Filepath.t -> int Yocaml__.Try.t t
val read_file : Yocaml__.Filepath.t -> string Yocaml__.Try.t t
val content_changes : Yocaml__.Filepath.t -> string -> bool Yocaml__.Try.t t
val write_file : Yocaml__.Filepath.t -> string -> unit Yocaml__.Try.t t
val read_dir : Yocaml__.Filepath.t -> Yocaml__.Filepath.t list t
val create_dir : ?file_perm:int -> Yocaml__.Filepath.t -> unit t
val log : Yocaml__.Log.level -> string -> unit t
val command : string -> int t