package apero-core

  1. Overview
  2. Docs
include module type of Property.Map
type key = Property.Key.t
type 'a t
val empty : 'a t
val is_empty : 'a t -> bool
val mem : key -> 'a t -> bool
val add : key -> 'a -> 'a t -> 'a t
val update : key -> ('a option -> 'a option) -> 'a t -> 'a t
val singleton : key -> 'a -> 'a t
val remove : key -> 'a t -> 'a t
val merge : (key -> 'a option -> 'b option -> 'c option) -> 'a t -> 'b t -> 'c t
val union : (key -> 'a -> 'a -> 'a option) -> 'a t -> 'a t -> 'a t
val compare : ('a -> 'a -> int) -> 'a t -> 'a t -> int
val equal : ('a -> 'a -> bool) -> 'a t -> 'a t -> bool
val iter : (key -> 'a -> unit) -> 'a t -> unit
val fold : (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b
val for_all : (key -> 'a -> bool) -> 'a t -> bool
val exists : (key -> 'a -> bool) -> 'a t -> bool
val filter : (key -> 'a -> bool) -> 'a t -> 'a t
val partition : (key -> 'a -> bool) -> 'a t -> 'a t * 'a t
val cardinal : 'a t -> int
val bindings : 'a t -> (key * 'a) list
val min_binding : 'a t -> key * 'a
val min_binding_opt : 'a t -> (key * 'a) option
val max_binding : 'a t -> key * 'a
val max_binding_opt : 'a t -> (key * 'a) option
val choose : 'a t -> key * 'a
val choose_opt : 'a t -> (key * 'a) option
val split : key -> 'a t -> 'a t * 'a option * 'a t
val find : key -> 'a t -> 'a
val find_opt : key -> 'a t -> 'a option
val find_first : (key -> bool) -> 'a t -> key * 'a
val find_first_opt : (key -> bool) -> 'a t -> (key * 'a) option
val find_last : (key -> bool) -> 'a t -> key * 'a
val find_last_opt : (key -> bool) -> 'a t -> (key * 'a) option
val map : ('a -> 'b) -> 'a t -> 'b t
val mapi : (key -> 'a -> 'b) -> 'a t -> 'b t
val to_seq : 'a t -> (key * 'a) Seq.t
val to_seq_from : key -> 'a t -> (key * 'a) Seq.t
val add_seq : (key * 'a) Seq.t -> 'a t -> 'a t
val of_seq : (key * 'a) Seq.t -> 'a t
val get : key -> 'a t -> 'a option

get k p returns Some v if p contains a property with name k where v is its value. It returns None if p doesn't contain such property

val get_or_default : key -> default:'a -> 'a t -> 'a

get_or_default def k p returns v if p contains a property with name k where v is its value. It returns def if p doesn't contain such property

val of_list : (key * 'a) list -> 'a t

of_list kvs returns a properties map made from the (key,value) list kvs. Note that if kvs contains duplicate keys, only the first associated value from the list is added into the properties map

val to_list : 'a t -> (key * 'a) list

of_list kvs returns a properties map made from the (key,value) list kvs. Note that if kvs contains duplicate keys, only the first associated value from the list is added into the properties map

to_list p returns the (key,value) list of all properties from p

val of_string : ?prop_sep:string -> ?kv_sep:string -> string -> string t

of_string s parses the string s using kv_sep as separator between key and value ("=" by default) and prop_sep as separator between the (key,value) tuples (";" by default), and returns a properties map from the parsed (key, value) tuples

val to_string : ?prop_sep:string -> ?kv_sep:string -> string t -> string

of_string s parses the string s using kv_sep as separator between key and value ("=" by default) and prop_sep as separator between the (key,value) tuples (";" by default), and returns a properties map from the parsed (key, value) tuples

to_string p returns a string representing p as a (key,value) list, with prop_sep as separator between the (key,value) tuples (";" by default) and kv_sep as separator between key and value ("=" by default)

val contains_key : key -> 'a t -> bool

contains_key k p returns true if p contains a property with k as a key

val contains_property : key -> 'a -> 'a t -> bool

contains_key k p returns true if p contains a property with k as a key

contains_property k v p returns true if p contains a (k*v) property

val contains_conflicting_property : key -> 'a -> 'a t -> bool

contains_property k v p returns true if p contains a (k*v) property

contains_conflicting_property k v p returns true if p contains a property with k as a key and with a value different than v

val is_subset : 'a t -> 'a t -> bool

is_subset p p' return true if p is a subset of p'. I.e.: it doesn't exist in p a property (k,v) which is not included in p'

val not_conflicting : 'a t -> 'a t -> bool

is_subset p p' return true if p is a subset of p'. I.e.: it doesn't exist in p a property (k,v) which is not included in p'

not_conflicting p p' return true if p is not conflicting with p'. I.e.: it doesn't exist in p a property with is conflicting with a property in p'

val decode_property_value : ('a -> 'b) -> key -> 'a t -> 'b option
val encode_property_value : ('a -> 'b) -> 'a -> 'b option