package calculon

  1. Overview
  2. Docs

Transition Table

type token = private string
val print_token : token CCFormat.printer
type t

A prefix tree of uniform length

val empty : t
val singleton : token -> t
val add : token list -> token -> t -> t
val merge : t -> t -> t
val merge_list : t list -> t
val pick_key : Stdlib.Random.State.t -> t -> token

pick_key rand t picks one of the keys of t

  • raises Not_found

    if t is empty

val pick : Stdlib.Random.State.t -> token list -> t -> token

Pick a token following the given path, randomly

  • raises Not_found

    if there is no token to be found

val print : t CCFormat.printer

Pretty-print the tree on the given formatter

val write_to : Stdlib.out_channel -> t -> unit

Serialize to channel

val read_from : Stdlib.in_channel -> t

Deserialize from channel

OCaml

Innovation. Community. Security.