package ocsigenserver-compat

  1. Overview
  2. Docs

Module Ocsigen_libSource

include module type of struct include Ocsigen_base.Lib end
include module type of Ocsigen_lib_base with type poly = Ocsigen_lib_base.poly and type yesnomaybe = Ocsigen_lib_base.yesnomaybe and type 'a Clist.t = 'a Ocsigen_lib_base.Clist.t and type 'a Clist.node = 'a Ocsigen_lib_base.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 = Ocsigen_base.Lib.Let_syntax

This module provides support for ppx_let.

val (!!) : 'a Lazy.t -> '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 = Ocsigen_base.Lib.Tuple3
val to_poly : 'a -> poly
val from_poly : poly -> 'a
type yesnomaybe = Ocsigen_lib_base.yesnomaybe =
  1. | Yes
  2. | No
  3. | Maybe
val advert : string
module List = Ocsigen_base.Lib.List

Improvement of module List

module Clist = Ocsigen_base.Lib.Clist

Circular lists

module String_base = Ocsigen_base.Lib.String_base

Improvement of module String

module Url_base = Ocsigen_base.Lib.Url_base
val debug : string -> unit
val make_cryptographic_safe_string : unit -> string

Generate an unique and cryptographically safe random string. It is impossible to guess for other people and will never return twice the same value (with very good probabilities).

module String = Ocsigen_base.Lib.String
module Ip_address = Ocsigen_base.Lib.Ip_address
module Filename = Ocsigen_base.Lib.Filename