package opam-format

  1. Overview
  2. Docs

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

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

Extract a package from a package action.

val map_atomic_action : ('a -> 'b) -> 'a OpamTypes.atomic_action -> 'b OpamTypes.atomic_action
val map_highlevel_action : ('a -> 'b) -> 'a OpamTypes.highlevel_action -> 'b OpamTypes.highlevel_action
val map_concrete_action : ('a -> 'b) -> 'a OpamTypes.concrete_action -> 'b OpamTypes.concrete_action
val map_action : ('a -> 'b) -> 'a OpamTypes.action -> 'b OpamTypes.action
val 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.

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

Pretty-prints the cause of an action

val string_of_shell : OpamTypes.shell -> string

Pretty-print

The empty file position

val 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

val string_of_pos : OpamParserTypes.FullPos.pos -> string

Prints a file position

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

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

val 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

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

Map on a solver result

val iter_success : ('a -> unit) -> ('a, 'b) OpamTypes.result -> unit
OCaml

Innovation. Community. Security.