package yocaml_syndication

  1. Overview
  2. Docs

An attribute is an association between a key and a value (quoted). Please note that this library does not guarantee that the key or value is correctly formatted, and it is the user's responsibility to produce only correct values.

Types

type t

Describes a key * value pair.

type set

Describes a list of attributes. The set of attributes must be unique, and the type is backed up by a Map to ensure that an attribute (described by its key) is present only once.

API

val make : ('a -> string) -> ?ns:string -> key:string -> 'a -> t

make ?ns ~key f value Builds an arbitrary attribute value. The ns optional parameter allows to scope an attribute to a given namespace.

val string : ?ns:string -> key:string -> string -> t

string ?ns ~key value Builds a string attribute.

val int : ?ns:string -> key:string -> int -> t

int ?ns ~key value Builds an integer attribute.

val float : ?ns:string -> key:string -> float -> t

float ?ns ~key value Builds a float attribute.

val bool : ?ns:string -> key:string -> bool -> t

bool ?ns ~key value Builds a boolean attribute.

val char : ?ns:string -> key:string -> char -> t

char ?ns ~key value Builds a char attribute.

val escaped : ?ns:string -> key:string -> string -> t

escaped ?ns ~key value Build an attribute with special character replaced.

OCaml

Innovation. Community. Security.