package ciao_lwt

  1. Overview
  2. Docs
A tool for migrating from Lwt to direct-style concurrency libraries

Install

dune-project
 Dependency

Authors

Maintainers

Sources

ciao_lwt-0.2.tbz
sha256=1ee830a5a6fec1adf4dc3fe3caae7cca769b49c1671fb0fcb4884778feb211c6
sha512=6ff296f22bfc254e96acf83465876843bbeabbfa11239528fd9a3d4f6cc1a7d0973a517b9dc0f5c1d7fe467c945ae686a4aa294788cda3d37035b4ab7928c5bf

doc/ciao_lwt.ocamlformat_utils/Ocamlformat_utils/Ast_utils/index.html

Module Ocamlformat_utils.Ast_utilsSource

Utility functions for contructing AST nodes.

Sourceval mk_loc : ?loc:??? -> 'a -> 'a Ocamlformat_ocaml_common.Location.loc
Sourceval mk_function_param : ?loc:??? -> ?lbl:??? -> ?def:??? -> Ocamlformat_parser_extended.Parsetree.pattern -> Ocamlformat_parser_extended.Parsetree.function_param_desc Ocamlformat_parser_extended.Parsetree.function_param
Sourceval mk_let' : ?loc_in:??? -> ?rec_:??? -> Ocamlformat_parser_extended.Parsetree.value_binding list -> Ocamlformat_parser_extended.Parsetree.expression -> Ocamlformat_parser_extended.Parsetree.expression
Sourceval mk_let : ?loc_in:??? -> ?rec_:??? -> ?is_pun:??? -> ?value_constraint:??? -> Ocamlformat_parser_extended.Parsetree.pattern -> ?args:??? -> Ocamlformat_parser_extended.Parsetree.expression -> Ocamlformat_parser_extended.Parsetree.expression -> Ocamlformat_parser_extended.Parsetree.expression
Sourceval mk_function_cases : ?loc:??? -> ?attrs:??? -> Ocamlformat_parser_extended.Parsetree.case list -> Ocamlformat_parser_extended.Parsetree.expression
Sourceval mk_longident' : string list -> Ocamlformat_ocaml_common.Longident.t
Sourceval mk_longident : string list -> Ocamlformat_ocaml_common.Longident.t Ocamlformat_ocaml_common.Location.loc
Sourceval mk_constr_exp : ?arg:??? -> string list -> Ocamlformat_parser_extended.Parsetree.expression
Sourceval mk_constr_pat : ?arg:??? -> string list -> Ocamlformat_parser_extended.Parsetree.pattern
Sourceval mk_variant_exp : ?arg:??? -> string -> Ocamlformat_parser_extended.Parsetree.expression
Sourceval mk_variant_pat : ?arg:??? -> string -> Ocamlformat_parser_extended.Parsetree.pattern
Sourceval same_longident : Ocamlformat_ocaml_common.Longident.t -> string list -> bool
Sourceval mk_exp_ident : string list -> Ocamlformat_parser_extended.Parsetree.expression
Sourceval mk_exp_var : string -> Ocamlformat_parser_extended.Parsetree.expression
Sourceval mk_unit_ident : Ocamlformat_ocaml_common.Longident.t Ocamlformat_ocaml_common.Location.loc
Sourceval mk_unit_pat : Ocamlformat_parser_extended.Parsetree.pattern
Sourceval mk_unit_arg : Ocamlformat_parser_extended.Parsetree.function_param_desc Ocamlformat_parser_extended.Parsetree.function_param
Sourceval mk_unit_val : Ocamlformat_parser_extended.Parsetree.expression
Sourceval mk_thunk : Ocamlformat_parser_extended.Parsetree.expression -> Ocamlformat_parser_extended.Parsetree.expression
Sourceval mk_some_ident : Ocamlformat_ocaml_common.Longident.t Ocamlformat_ocaml_common.Location.loc
Sourceval mk_none_ident : Ocamlformat_ocaml_common.Longident.t Ocamlformat_ocaml_common.Location.loc
Sourceval mk_exp_some : Ocamlformat_parser_extended.Parsetree.expression -> Ocamlformat_parser_extended.Parsetree.expression
Sourceval mk_exp_none : Ocamlformat_parser_extended.Parsetree.expression
Sourceval mk_typ_constr : ?params:??? -> string list -> Ocamlformat_parser_extended.Parsetree.core_type
Sourceval mk_lbl : string -> Ocamlformat_parser_extended.Asttypes.arg_label
Sourceval mk_lblopt : string -> Ocamlformat_parser_extended.Asttypes.arg_label
Sourceval mk_pat_some : Ocamlformat_parser_extended.Parsetree.pattern -> Ocamlformat_parser_extended.Parsetree.pattern
Sourceval mk_pat_none : Ocamlformat_parser_extended.Parsetree.pattern
Sourceval mk_row_field : ?loc:??? -> ?attrs:??? -> Ocamlformat_parser_extended.Parsetree.row_field_desc -> Ocamlformat_parser_extended.Parsetree.row_field
Sourceval mk_poly_variant : ?open_:??? -> ?labels:??? -> ?inherit_:??? -> (string * Ocamlformat_parser_extended.Parsetree.core_type list) list -> Ocamlformat_parser_extended.Parsetree.core_type
Sourceval mk_constr_of_bool : bool -> Ocamlformat_parser_extended.Parsetree.expression
Sourceval mk_const_string : string -> Ocamlformat_parser_extended.Parsetree.expression
Sourceval mk_const_int : string -> Ocamlformat_parser_extended.Parsetree.expression
Sourceval mk_let_var : string -> Ocamlformat_parser_extended.Parsetree.expression -> (Ocamlformat_parser_extended.Parsetree.expression -> Ocamlformat_parser_extended.Parsetree.expression) -> Ocamlformat_parser_extended.Parsetree.expression
Sourcemodule Mk_function : sig ... end

Construct a fun .. -> .. node. Usage:

Sourceval mk_fun : ?arg_name:??? -> (Ocamlformat_parser_extended.Parsetree.expression -> Ocamlformat_parser_extended.Parsetree.expression) -> Ocamlformat_parser_extended.Parsetree.expression
Sourceval is_unit_val : Ocamlformat_parser_extended.Parsetree.expression -> bool
Sourceval mk_if : Ocamlformat_parser_extended.Parsetree.expression -> Ocamlformat_parser_extended.Parsetree.expression -> Ocamlformat_parser_extended.Parsetree.expression -> Ocamlformat_parser_extended.Parsetree.expression
Sourceval mk_binding_op : ?loc:??? -> ?is_pun:??? -> string Ocamlformat_parser_extended.Asttypes.loc -> Ocamlformat_parser_extended.Parsetree.pattern -> ?args:??? -> ?typ:??? -> Ocamlformat_parser_extended.Parsetree.expression -> Ocamlformat_parser_extended.Parsetree.binding_op
Sourceval mk_apply_ident : string list -> (Ocamlformat_parser_extended.Asttypes.arg_label * Ocamlformat_parser_extended.Parsetree.expression) list -> Ocamlformat_parser_extended.Parsetree.expression
Sourceval mk_apply_simple : string list -> Ocamlformat_parser_extended.Parsetree.expression list -> Ocamlformat_parser_extended.Parsetree.expression
Sourceval value_of_lblopt : default:Ocamlformat_parser_extended.Parsetree.expression -> (Ocamlformat_parser_extended.Parsetree.expression * [< `Lbl | `Opt ]) option -> Ocamlformat_parser_extended.Parsetree.expression

Generate an expression that read the value of a optional argument obtained with Unpack_apply.take_lblopt.

Sourceval flatten_apply : Ocamlformat_parser_extended.Parsetree.expression -> Ocamlformat_parser_extended.Parsetree.expression

Flatten a pipelines composed of |> and @@ into a Pexp_apply node.

Sourceval rewrite_apply : Ocamlformat_parser_extended.Parsetree.expression -> (Ocamlformat_ocaml_common.Longident.t Ocamlformat_parser_extended.Asttypes.loc -> (Ocamlformat_parser_extended.Asttypes.arg_label * Ocamlformat_parser_extended.Parsetree.expression) list -> 'a option) -> 'a option

Rewrite expressions that look like an apply by calling f ~loc longident args. Returns None for other expressions. Expressions that are treated as an apply:

  • Pexp_apply, obviously.
  • Pipelines composed of |> and @@.
  • Pexp_ident, interpreted as an apply with no arguments.
  • Pexp_infix, warning, Longident node doesn't appear in the parsetree.
  • Pexp_construct, as they cannot be confused with regular identifiers thanks to their capital letter.
Sourcemodule Unpack_apply : sig ... end