Module Eliom_lib
A few common functions used by Eliom. Extension of OCaml stdlib. See also Ocsigen_lib
See Ocsigen_lib.
include module type of Ocsigen_lib
with type poly = Ocsigen_lib.poly
and type yesnomaybe = Ocsigen_lib.yesnomaybe
and type ('a, 'b) leftright = ('a, 'b) Ocsigen_lib.leftright
and type 'a Clist.t = 'a Ocsigen_lib.Clist.t
and type 'a Clist.node = 'a Ocsigen_lib.Clist.node
include module type of Ocsigen_lib_base
with type poly = Ocsigen_lib_base.poly
and type yesnomaybe = Ocsigen_lib_base.yesnomaybe
and type ('a, 'b) leftright = ('a, 'b) Ocsigen_lib_base.leftright
and type 'a Clist.t = 'a Ocsigen_lib_base.Clist.t
and type 'a Clist.node = 'a Ocsigen_lib_base.Clist.node
with type poly = Ocsigen_lib.poly
with type yesnomaybe = Ocsigen_lib.yesnomaybe
with type ('a, 'b) leftright = ('a, 'b) Ocsigen_lib.leftright
with type 'a Clist.t = 'a Ocsigen_lib.Clist.t
with type 'a Clist.node = 'a Ocsigen_lib.Clist.node
exception Ocsigen_Internal_Error of stringexception Input_is_too_largeexception Ocsigen_Bad_Requestexception Ocsigen_Request_too_longinclude module type of Lwt.Infix
p >>= f is the same as Lwt.bind p f. It requires Lwt.Infix to be opened in scope:
open Lwt.Infix
let () =
Lwt_main.run
(Lwt_io.(read_line stdin) >>= Lwt_io.printl)
(* ocamlfind opt -linkpkg -thread -package lwt.unix code.ml && ./a.out *)It is recommended to use the PPX let%lwt syntax instead. This operator is the next-best choice. It is frequently found while reading existing Lwt code.
p >|= f is the same as Lwt.map f p. It requires Lwt.Infix to be opened in scope.
open Lwt.Infix
let () =
Lwt_main.run
(Lwt_io.(read_line stdin) >|= ignore)
(* ocamlfind opt -linkpkg -thread -package lwt.unix code.ml && ./a.out *)p1 <?> p2 is the same as Lwt.choose [p1; p2]. It requires Lwt.Infix to be opened in scope.
Unlike with Lwt.bind and Lwt.map, there are no problems with explicit Lwt.choose syntax, so using this operator is not recommended.
Furthermore, most users actually need Lwt.pick instead of Lwt.choose.
f =<< p is the same as Lwt.bind p f. It requires Lwt.Infix to be opened in scope.
This operator is obscure and its use is discouraged. It is the same as p >>= f.
f =|< p is the same as Lwt.map f p. It requires Lwt.Infix to be opened in scope.
This operator is obscure and its use is discouraged. It is the same as p >|= f.
module Let_syntax : sig ... endThis module provides support for ppx_let.
val (!!) : 'a Lazy.t -> 'aval (|>) : 'a -> ('a -> 'b) -> 'bval (@@) : ('a -> 'b) -> 'a -> 'bval id : 'a -> 'aval comp : ('a -> 'b) -> ('c -> 'a) -> 'c -> 'bval curry : (('a * 'b) -> 'c) -> 'a -> 'b -> 'cval uncurry : ('a -> 'b -> 'c) -> ('a * 'b) -> 'cmodule Tuple3 : sig ... endtype poly = Ocsigen_lib.polyval to_poly : 'a -> polyval from_poly : poly -> 'atype yesnomaybe = Ocsigen_lib.yesnomaybe = | Yes| No| Maybe
type ('a, 'b) leftright = ('a, 'b) Ocsigen_lib.leftright = | Left of 'a| Right of 'b
val advert : stringmodule Option : sig ... endModule Option to compute type 'a option
module List : sig ... endImprovement of module List
module Clist : sig ... endCircular lists
module Int : sig ... endmodule String_base : sig ... endImprovement of module String
module Url_base : sig ... endmodule String : module type of String_baseImprovement of module String
module Ip_address : sig ... endmodule Filename : sig ... endmodule Url : sig ... endinclude module type of Eliom_lib_base
with type 'a Int64_map.t = 'a Eliom_lib_base.Int64_map.t
with type 'a String_map.t = 'a Eliom_lib_base.String_map.t
with type 'a Int_map.t = 'a Eliom_lib_base.Int_map.t
exception Eliom_Internal_Error of stringmodule type Map_S = sig ... endmodule Int64_map :
Map_S with type key = int64 with type 'a t = 'a Eliom_lib_base.Int64_map.tmodule Int_map :
Map_S with type key = int with type 'a t = 'a Eliom_lib_base.Int_map.tmodule String_map :
Map_S with type key = string with type 'a t = 'a Eliom_lib_base.String_map.ttype file_info = Ocsigen_extensions.file_infoval string_escape : string -> stringval to_json : ?typ:'a Deriving_Json.t -> 'a -> stringval of_json : ?typ:'a Deriving_Json.t -> string -> 'aval debug : ('a, unit, string, unit) format4 -> 'aDeprecated. Use Lwt_log.ign_info_f instead
val jsmarshal : 'a -> stringMarshal an OCaml value into a string. All characters are escaped
val eliom_logs_src : Logs.srcLog section for logs generated by Eliom.
val make_cryptographic_safe_string : ?len:int -> unit -> stringReturn a base-64 encoded cryptographic safe string of the given length. Not implemented client-side.