Legend:
Library
Module
Module type
Parameter
Class
Class type
Library
Module
Module type
Parameter
Class
Class type
module Typerep = Typerep_lib.Std.Typerep
module Named_types : sig ... end
val to_ocaml : _ Typerep.t -> string
to_ocaml typerep
returns an ocaml string representing the type.
val ocaml_to_python : 'a Typerep.t -> 'a -> Pytypes.pyobject
ocaml_to_python typerep v
converts an arbitrary ocaml object with its typerep representation to a python value. See the implementation for supported constructions.
val python_to_ocaml : 'a Typerep.t -> Pytypes.pyobject -> 'a
python_to_ocaml typerep pybobject
converts a python object pyobject
to an ocaml value according to some type description typerep
.
val parse : string -> Typerep.packed
parse str
parses an ocaml like string into a type representation. str
cannot include any function.
val parse_maybe_fn :
string ->
[ `fn of Typerep.packed * Typerep.packed | `value of Typerep.packed ]
parse_maybe_fn str
parses an ocaml like string into a type representation. str
can include at most one arrow (in which case `fn
is returned).
register_named_type ~name ~ocaml_type
registers a named type that can be used in parse
with name name
. Values for this type will be type checked to match ocaml_type
which should be a proper type annotation for the current toplevel, e.g. "t" if a type t
is currently defined in the toplevel. A capsule is used to send and receive values to/from python.