package cudf
Install
Dune Dependency
Authors
Maintainers
Sources
md5=ed8fea314d0c6dc0d8811ccf860c53dd
sha512=ed74ce3e9d91449fd295caa7c6b166593578aaa6b8d79834141ba7fdf49d30796aba03a86d766c0c23e875a8318dbb797e7eae6e14fb63a0b94130c590af107e
doc/cudf/Cudf_types/index.html
Module Cudf_types
Source
CUDF type library
Implement core CUDF types (see CUDF spec. §2.2.2).
For parsing and pretty printing of CUDF types see Cudf_types_pp
.
CUDF types
CUDF spec. types
CNF formula. Inner lists are OR-ed, outer AND-ed. E.g.:
- "Depends: foo, baz | baz" -->
[ foo ] ; [ bar ; baz ]
- "Depends: true!" -->
- "Depends: false!" -->
[]
type typ = [
| `Int
| `Posint
| `Nat
| `Bool
| `String
| `Enum of string list
| `Pkgname
| `Ident
| `Vpkg
| `Vpkgformula
| `Vpkglist
| `Veqpkg
| `Veqpkglist
| `Typedecl
]
CUDF types
type typedecl1 = [
| `Int of int option
| `Posint of int option
| `Nat of int option
| `Bool of bool option
| `String of string option
| `Pkgname of string option
| `Ident of string option
| `Enum of string list * string option
(*enums, default enum
*)| `Vpkg of vpkg option
| `Vpkgformula of vpkgformula option
| `Vpkglist of vpkglist option
| `Veqpkg of veqpkg option
| `Veqpkglist of veqpkglist option
| `Typedecl of typedecl option
]
(Single) type declaration: each variant denotes a type, its argument the default value, None if missing
type typed_value = [
| `Int of int
| `Posint of int
| `Nat of int
| `Bool of bool
| `String of string
| `Pkgname of string
| `Ident of string
| `Enum of string list * string
| `Vpkg of vpkg
| `Vpkgformula of vpkgformula
| `Vpkglist of vpkglist
| `Veqpkg of veqpkg
| `Veqpkglist of veqpkglist
| `Typedecl of typedecl
]
Typed value in the value space of all CUDF types
Manipulation of typed values
Create a (single) type declaration having as default value the given typed value (i.e. apply the "Some" monad to typed values)
Extract the default value from a type declaration (or return None
)
Create a (single) type declaration with no default value
cast ty v
attempt a runtime cast of a given (typed) value to a different type.
CUDF syntactic types
Types used in parsing, before values are injected into the CUDF type system.
RFC-822-like stanza, i.e. an associative list mapping property names to property values.
Values are typed according to the type variable 'ty
. Usually, libCUDF uses either string stanza
(for untyped stanzas) or Cudf_types.typed_value stanza
(for typed stanzas).
Various errors
Error while parsing RFC822-like syntax of CUDF documents.
arguments: error message and file range, respectively.
Syntax error while parsing some literal value
arguments: error message and file range, respectively
Type error: mismatch between typed value and expected type
arguments: expected type, found value
Accessors, predicates, etc.
Check whether a formula uses only equality tests over package versions.