package swhid_core

  1. Overview
  2. Docs

Module to work with the core identifier of a swhid. The core identifier of a swhid is made of its scheme version, its kind and its hash. They're documented here.

type t

The type of core identifiers.

val compare : t -> t -> int

compare x y returns 0 if x is equal to y, a negative integer if x is less than y, and a positive integer if x is greater than y.

val equal : t -> t -> bool

equal x y returns true iff x is equal to y.

val of_string : string -> (t, string) Stdlib.result

of_string s is Ok v if s is a valid core identifier, otherwise it is Error e.

val mk : Scheme_version.t -> Kind.t -> Hash.t -> t

mk scheme kind hash is the core identifier made of the scheme version scheme, the kind kind and the hash hash.

val pp : Stdlib.Format.formatter -> t -> unit

pp fmt v prints v on formatter fmt.

val to_string : t -> string

to_string v is the representation of v as a string.

val get_scheme : t -> Scheme_version.t

get_scheme v is the scheme version of v.

val get_kind : t -> Kind.t

get_kind v is the kind of v

val get_hash : t -> Hash.t

get_hash v is the hash of v.