Module PropList.Field

module Field: sig .. end

This module defines a field that hold a value. A field can be set and retrieve. It is stored in PropList.Data.t.


type ('a, 'b, 'c) t 

A field.

val create : ?schema:('a, 'b) PropList.Schema.t ->
?name:PropList.name ->
?parse:(?context:'a -> string -> 'c) ->
?print:('c -> string) ->
?default:'c ->
?update:(?context:'a -> 'c -> 'c -> 'c) ->
?help:(unit -> string) -> 'b -> ('a, 'c, 'b) t

Create a field, and optionally attached it to a schema.

val fset : PropList.Data.t -> ('a, 'b, 'c) t -> ?context:'a -> 'b -> unit

Store a field in a PropList.Data.t.

val fget : PropList.Data.t -> ('a, 'b, 'c) t -> 'b

Retrieve a field from a PropList.Data.t.

val fsets : PropList.Data.t ->
('a, 'b, 'c) t -> ?context:'a -> string -> unit

Same as PropList.Field.fset but parses a string to get the value.

val fgets : PropList.Data.t -> ('a, 'b, 'c) t -> string

Same as PropList.Field.fget but applies a printer to the value returned.