Documenttype id = Stateid.tval create : unit -> 'a documentval tip_data : 'a document -> 'aThe last sentence.
val push : 'a document -> 'a -> unitAdd a sentence on the top (with no state_id)
val pop : 'a document -> 'aRemove the tip setence.
val set_errors : 'a document -> string list -> unitpreserve the last error(s) (tooltip fix)
val get_errors : 'a document -> string listget the last error(s) (tooltip fix)
cut_at d id cuts the document at id that is the new tip. Returns the list of sentences that were cut.
returns the id of the topmost sentence validating the predicate and a boolean that is true if one needs to unfocus the document to access such sentence.
look for a sentence validating the predicate. The boolean is true if the sentence is in the zone currently focused.
After focus s c1 c2 the top of s is the topmost element x such that c1 x is true and the bottom is the first element y following x such that c2 y is true.
val unfocus : 'a document -> unitUndoes a focus.
val focused : 'a document -> boolIs the document focused
val is_empty : 'a document -> boolNo sentences at all
returns the 1 to-last sentence, and true if we need to unfocus to reach it.
Folds over the whole document starting from the topmost (maybe unfocused) sentence.
Returns (top,bot) such that the document is morally top @ s @ bot where s is the focused part.
Callbacks on documents
class type 'a signals = object ... end