package py

  1. Overview
  2. Docs
module W : sig ... end
type 'a t
val returning : 'a W.t -> 'a t
val (@->) : 'a W.t -> 'b t -> ('a -> 'b) t
val none : unit W.t
val bool : bool W.t
val int : int W.t
val float : float W.t
val string : string W.t
val list : 'a W.t -> 'a list W.t
val dict : 'a W.t -> 'b W.t -> ('a * 'b) list W.t
val tuple2 : 'a1 W.t -> 'a2 W.t -> ('a1 * 'a2) W.t
val tuple3 : 'a1 W.t -> 'a2 W.t -> 'a3 W.t -> ('a1 * 'a2 * 'a3) W.t
val tuple4 : 'a1 W.t -> 'a2 W.t -> 'a3 W.t -> 'a4 W.t -> ('a1 * 'a2 * 'a3 * 'a4) W.t
val tuple5 : 'a1 W.t -> 'a2 W.t -> 'a3 W.t -> 'a4 W.t -> 'a5 W.t -> ('a1 * 'a2 * 'a3 * 'a4 * 'a5) W.t
val pyobject : Py__.Py_base.pyobject W.t
val python_fn : 'a t -> Py__.Py_base.pyobject -> 'a

python_fn t pyobject wraps a python function pyobject so that it can be used in a type-safe way.

val ocaml_fn : 'a t -> 'a -> Py__.Py_base.pyobject -> Py__.Py_base.pyobject

ocaml_fn t f wraps an ocaml function f so that it can be used from python. E.g. it could get registered via CamlModule.add_fn. Note that even if some argument conversion fails, f will have been partially applied up to this point.

val to_string : 'a t -> string
OCaml

Innovation. Community. Security.