package opam-format

  1. Overview
  2. Docs

Helper functions on the base types (from OpamTypes)

include module type of OpamCompat
module Bytes = Stdlib.Bytes
module Buffer = Stdlib.Buffer
module Filename = Stdlib.Filename
module String = Stdlib.String
module Char = Stdlib.Char
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

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

val pos_null : OpamTypes.pos

The empty file position

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 : OpamTypes.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

OCaml

Innovation. Community. Security.