package opam-lib

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

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

include module type of OpamCompat
module Bytes = Bytes
module Buffer = Buffer
module Filename = Filename
exception Lexer_error of string

Exceptions

Upcast a downloaded directory.

Upcast a downloaded file.

val string_of_download : _ OpamTypes.download -> string

Corresponding user message

val string_of_generic_file : OpamTypes.generic_file -> string
val string_of_address : OpamTypes.address -> string

Print an address

val address_of_string : string -> OpamTypes.address

Parse an address

Guess an address kind using url suffixes (.git, etc.) and prefixes (http://, etc.). Defaults to `local. The returned address is a correct path in case of file://

val guess_version_control : OpamTypes.dirname -> [ `git | `hg | `darcs ] option

Scan the given directory for version control

val string_of_repository_kind : OpamTypes.repository_kind -> string

Pretty-print repository kinds.

val repository_kind_of_string : string -> OpamTypes.repository_kind

Parser of repository kinds. Raise an error if the kind is not valid.

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_upload : OpamTypes.upload -> string

Pretty-print

val repository_kind_of_pin_kind : OpamTypes.pin_kind -> OpamTypes.repository_kind option

Convert a pin kind to a repository kind

val pin_kind_of_string : string -> OpamTypes.pin_kind

Pretty-printing of pin kinds.

val string_of_pin_kind : OpamTypes.pin_kind -> string

Parsing of pin kinds

val pin_option_of_string : ?kind:OpamTypes.pin_kind -> ?guess:bool -> string -> OpamTypes.pin_option

Read pin options args. If kind isn't specified, guess is set to true and the name isn't explicit, look for VC on the filesystem to get the pinning kind

val string_of_pin_option : OpamTypes.pin_option -> string

Convert a pin option to a string

val kind_of_pin_option : OpamTypes.pin_option -> OpamTypes.pin_kind

Get the pin kind from a pin option

Get a pin_option from address and kind

val string_of_shell : OpamTypes.shell -> string

Pretty-print

val pos_null : OpamTypes.pos

The empty file position

val string_of_pos : OpamTypes.pos -> string

Prints a file position

val string_of_relop : OpamTypes.relop -> string
val relop_of_string : string -> OpamTypes.relop

Raises Invalid_argument

val string_of_logop : OpamTypes.logop -> string

Raises Invalid_argument

val logop_of_string : string -> OpamTypes.logop

Raises Invalid_argument

val string_of_pfxop : OpamTypes.pfxop -> string

Raises Invalid_argument

val pfxop_of_string : string -> OpamTypes.pfxop

Raises Invalid_argument

val filter_ident_of_string : string -> OpamTypes.name 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

val filter_deps : build:bool -> test:bool -> doc:bool -> dev:bool -> OpamTypes.ext_formula -> OpamTypes.formula
val map_success : ('a -> 'b) -> ('a, 'fail) OpamTypes.result -> ('b, 'fail) OpamTypes.result

Map on a solver result

OCaml

Innovation. Community. Security.