package opam-format

  1. Overview
  2. Docs

Module OpamTypesBaseSource

Helper functions on the base types (from OpamTypes)

This module contains basic utility functions and stringifiers for the basic OPAM types present in OpamTypes.ml

Sourceval string_of_std_path : OpamTypes.std_path -> string
Sourceval std_path_of_string : string -> OpamTypes.std_path
Sourceval all_std_paths : OpamTypes.std_path list
Sourceval action_contents : [< 'a OpamTypes.action ] -> 'a list

Extract a package from a package action.

Sourceval map_atomic_action : ('a -> 'b) -> 'a OpamTypes.atomic_action -> 'b OpamTypes.atomic_action
Sourceval map_highlevel_action : ('a -> 'b) -> 'a OpamTypes.highlevel_action -> 'b OpamTypes.highlevel_action
Sourceval map_concrete_action : ('a -> 'b) -> 'a OpamTypes.concrete_action -> 'b OpamTypes.concrete_action
Sourceval map_action : ('a -> 'b) -> 'a OpamTypes.action -> 'b OpamTypes.action
Sourceval full_action_contents : 'a OpamTypes.action -> 'a list

Extract a packages from a package action. This returns all concerned packages, including the old version for an up/down-grade.

Sourceval string_of_cause : ('pkg -> string) -> 'pkg OpamTypes.cause -> string

Pretty-prints the cause of an action

Sourceval string_of_shell : OpamTypes.shell -> string

Pretty-print

The empty file position

Sourceval nullify_pos : 'a -> 'a OpamParserTypes.FullPos.with_pos

pos_best pos1 pos2 returns the most detailed position between pos1 and pos2 (defaulting to pos1)

Position in the given file, with unspecified line and column

Sourceval string_of_pos : OpamParserTypes.FullPos.pos -> string

Prints a file position

Sourceval string_of_user_action : OpamTypes.user_action -> string
Sourceval env_array : OpamTypes.env -> string array

Makes sure to keep only the last binding for a given variable; doesn't preserve order

Sourceexception Parse_variable of string * string
Sourceval filter_ident_of_string : string -> OpamTypes.name option list * OpamTypes.variable * (string * string) option

Parses the data suitable for a filter.FIdent from a string. May raise Failure msg on bad package names. A self-reference _ parses to None

Sourceval filter_ident_of_string_interp : ?accept:bool -> string -> OpamTypes.name option list * OpamTypes.variable * (string * string) option

Like Filter_ident_of_string but parses also '%?pkg+:var:% syntax for variables with package name that contains a '+'. if accept is false, Parse_variable (pkg,var) is raised when several '+' are encountered in package name, i.e. 'pkg++:var'.

Sourceval string_of_filter_ident : (OpamTypes.name option list * OpamTypes.variable * (string * string) option) -> string
Sourceval pkg_flag_of_string : string -> OpamTypes.package_flag
Sourceval string_of_pkg_flag : OpamTypes.package_flag -> string
Sourceval all_package_flags : OpamTypes.package_flag list
Sourceval map_success : ('a -> 'b) -> ('a, 'fail) OpamTypes.result -> ('b, 'fail) OpamTypes.result

Map on a solver result

Sourceval iter_success : ('a -> unit) -> ('a, 'b) OpamTypes.result -> unit
Sourceval env_update : ?comment:string -> rewrite:'a OpamTypes.separator_path_format option -> string -> 'b OpamTypes.env_update_op_kind -> string -> ('a, 'b) OpamTypes.env_update

Environment update helpers

Sourceval env_update_resolved : ?comment:string -> ?rewrite:OpamTypes.spf_resolved OpamTypes.separator_path_format option -> string -> 'a OpamTypes.env_update_op_kind -> string -> (OpamTypes.spf_resolved, 'a) OpamTypes.env_update
Sourceval env_update_unresolved : ?comment:string -> ?rewrite:OpamTypes.spf_unresolved OpamTypes.separator_path_format option -> string -> 'a OpamTypes.env_update_op_kind -> string -> (OpamTypes.spf_unresolved, 'a) OpamTypes.env_update
Sourceval string_of_path_format : OpamTypes.path_format -> string
Sourceval char_of_separator : OpamTypes.separator -> char
Sourceval switch_selections_compare : OpamTypes.switch_selections -> OpamTypes.switch_selections -> int

Comparators *

Sourceval switch_selections_equal : OpamTypes.switch_selections -> OpamTypes.switch_selections -> bool
OCaml

Innovation. Community. Security.