# Module OpamTypesBase

    module OpamTypesBase: sig .. end

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

    include OpamCompat

    exception Lexer_error of string

## Exceptions

    val download_dir : OpamTypes.dirname OpamTypes.download ->
           OpamTypes.generic_file OpamTypes.download

Upcast a downloaded directory.

    val download_file : OpamTypes.filename OpamTypes.download ->
           OpamTypes.generic_file OpamTypes.download

Upcast a downloaded file.

    val string_of_download : 'a 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

    val parse_url : OpamTypes.address -> OpamTypes.address * OpamTypes.repository_kind

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 -> [ `darcs | `git | `hg ] 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 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

    val pin_of_url : OpamTypes.address * OpamTypes.repository_kind -> OpamTypes.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

    val logop_of_string : string -> OpamTypes.logop

Raises Invalid_argument

    val string_of_pfxop : OpamTypes.pfxop -> string

    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 -> OpamTypes.ext_formula -> OpamTypes.formula

    val map_success : ('a -> 'b) -> ('a, 'fail) OpamTypes.result -> ('b, 'fail) OpamTypes.result

Map on a solver result