Module Eliom_lib

A few common functions used by Eliom. Extension of OCaml stdlib. See also 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 string
exception Input_is_too_large
exception Ocsigen_Bad_Request
exception Ocsigen_Request_too_long
include module type of Lwt.Infix
val (>>=) : 'a Lwt.t -> ('a -> 'b Lwt.t) -> 'b Lwt.t

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.

val (>|=) : 'a Lwt.t -> ('a -> 'b) -> 'b Lwt.t

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 *)
val (<&>) : unit Lwt.t -> unit Lwt.t -> unit Lwt.t

p1 <&> p2 is the same as Lwt.join [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.join syntax, so using this operator is not recommended.

val (<?>) : 'a Lwt.t -> 'a Lwt.t -> 'a Lwt.t

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.

val (=<<) : ('a -> 'b Lwt.t) -> 'a Lwt.t -> 'b Lwt.t

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.

val (=|<) : ('a -> 'b) -> 'a Lwt.t -> 'b Lwt.t

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

This module provides support for ppx_let.

val (!!) : 'a Lazy.t -> 'a
val (|>) : 'a -> ('a -> 'b) -> 'b
val (@@) : ('a -> 'b) -> 'a -> 'b
val id : 'a -> 'a
val comp : ('a -> 'b) -> ('c -> 'a) -> 'c -> 'b
val curry : (('a * 'b) -> 'c) -> 'a -> 'b -> 'c
val uncurry : ('a -> 'b -> 'c) -> ('a * 'b) -> 'c
module Tuple3 : sig ... end
type poly = Ocsigen_lib.poly
val to_poly : 'a -> poly
val from_poly : poly -> 'a
type yesnomaybe = Ocsigen_lib.yesnomaybe =
  1. | Yes
  2. | No
  3. | Maybe
type ('a, 'b) leftright = ('a, 'b) Ocsigen_lib.leftright =
  1. | Left of 'a
  2. | Right of 'b
val advert : string
module Option : sig ... end

Module Option to compute type 'a option

module List : sig ... end

Improvement of module List

module Clist : sig ... end

Circular lists

module Int : sig ... end
module String_base : sig ... end

Improvement of module String

module Url_base : sig ... end
module String : module type of String_base

Improvement of module String

module Ip_address : sig ... end
module Filename : sig ... end
module Url : sig ... end
include 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 string
module type Map_S = sig ... end
module Int64_map : Map_S with type key = int64 with type 'a t = 'a Eliom_lib_base.Int64_map.t
module Int_map : Map_S with type key = int with type 'a t = 'a Eliom_lib_base.Int_map.t
module String_map : Map_S with type key = string with type 'a t = 'a Eliom_lib_base.String_map.t
val string_escape : string -> string
val to_json : ?typ:'a Deriving_Json.t -> 'a -> string
val of_json : ?typ:'a Deriving_Json.t -> string -> 'a
val debug : ('a, unit, string, unit) format4 -> 'a

Deprecated. Use Lwt_log.ign_info_f instead

val jsmarshal : 'a -> string

Marshal an OCaml value into a string. All characters are escaped

val eliom_logs_src : Logs.src

Log section for logs generated by Eliom.

val make_cryptographic_safe_string : ?len:int -> unit -> string

Return a base-64 encoded cryptographic safe string of the given length. Not implemented client-side.