package alba

  1. Overview
  2. Docs
type in_file
type out_file
val stdin : in_file
val stdout : out_file
val stderr : out_file
include Module_types.MONAD
type 'a t

The type of the monad containing values of type 'a

val return : 'a -> 'a t

return a makes a monadic container containing the value a.

val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

m >>= f extracts the value a from the monadic container m and returns f a.

val (>=>) : ('a -> 'b t) -> ('b -> 'c t) -> 'a -> 'c t

f >=> g composition of the two monadic functions f and g.

f >=> g is equivalent to fun a -> f a >>= g.

val map : ('a -> 'b) -> 'a t -> 'b t

map f m maps the values in the monadic container m with the function f.

val join : 'a t t -> 'a t

Remove one level of container. join m is equivalent to mm >>= fun m -> m.

val (<*>) : ('a -> 'b) t -> 'a t -> 'b t

f <*> m applies the function contained in f to the content of the monadic container m and injects the result into a new monadic container.

val exit : int -> 'a t
val execute : unit t -> unit
val command_line : string array t
val current_working_directory : string t
val cli_loop : 'a -> ('a -> string option) -> ('a -> string -> 'a t) -> ('a -> 'a t) -> 'a t
val path_separator : char
val path_delimiter : char
val read_directory : string -> string array option t
val open_for_read : string -> (in_file, Io.Error.t) result t
val open_for_write : string -> (out_file, Io.Error.t) result t
val create : string -> (out_file, Io.Error.t) result t
val close_in : in_file -> unit t
val close_out : out_file -> unit t
module Read (W : Module_types.WRITABLE) : sig ... end
module Write (R : Module_types.READABLE) : sig ... end
OCaml

Innovation. Community. Security.