Sha256: f35d221f2e07c58043a49c0bc28925bd9acc6c8ce20ace2ffe08133e7ed067f1

Contents?: true

Size: 1.04 KB

Versions: 68

Compression:

Stored size: 1.04 KB

Contents

(** Zipper exercise interface *)
open Core_kernel

(** The type of a zipper *)
type 'a t

(* You need to define an equal function *)
include Equal.S1 with type 'a t := 'a t

(* Sexp converters are also required. *)
val t_of_sexp : (Sexp.t -> 'a) -> Sexp.t -> 'a t
val sexp_of_t : ('a -> Sexp.t) -> 'a t -> Sexp.t

(** Create a zipper focussed on the root node. *)
val of_tree : 'a Tree.t -> 'a t

(** Get the complete tree from a zipper. *)
val to_tree : 'a t -> 'a Tree.t

(** Get the value of the focus node. *)
val value : 'a t -> 'a

(** Get the left child of the focus node, if any. *)
val left : 'a t -> 'a t option

(** Get the right child of the focus node, if any. *)
val right : 'a t -> 'a t option

(** Get the parent of the focus node, if any. *)
val up : 'a t -> 'a t option

(** Set the value of the focus node. *)
val set_value : 'a -> 'a t -> 'a t

(** Set the left child tree of the focus node. *)
val set_left : 'a Tree.t option -> 'a t -> 'a t

(** Set the right child tree of the focus node. *)
val set_right : 'a Tree.t option -> 'a t -> 'a t

Version data entries

68 entries across 68 versions & 1 rubygems

Version Path
trackler-2.2.1.180 tracks/ocaml/exercises/zipper/zipper.mli
trackler-2.2.1.179 tracks/ocaml/exercises/zipper/zipper.mli
trackler-2.2.1.178 tracks/ocaml/exercises/zipper/zipper.mli
trackler-2.2.1.177 tracks/ocaml/exercises/zipper/zipper.mli
trackler-2.2.1.176 tracks/ocaml/exercises/zipper/zipper.mli
trackler-2.2.1.175 tracks/ocaml/exercises/zipper/zipper.mli
trackler-2.2.1.174 tracks/ocaml/exercises/zipper/zipper.mli
trackler-2.2.1.173 tracks/ocaml/exercises/zipper/zipper.mli
trackler-2.2.1.172 tracks/ocaml/exercises/zipper/zipper.mli
trackler-2.2.1.171 tracks/ocaml/exercises/zipper/zipper.mli
trackler-2.2.1.170 tracks/ocaml/exercises/zipper/zipper.mli
trackler-2.2.1.169 tracks/ocaml/exercises/zipper/zipper.mli
trackler-2.2.1.167 tracks/ocaml/exercises/zipper/zipper.mli
trackler-2.2.1.166 tracks/ocaml/exercises/zipper/zipper.mli
trackler-2.2.1.165 tracks/ocaml/exercises/zipper/zipper.mli
trackler-2.2.1.164 tracks/ocaml/exercises/zipper/zipper.mli
trackler-2.2.1.163 tracks/ocaml/exercises/zipper/zipper.mli
trackler-2.2.1.162 tracks/ocaml/exercises/zipper/zipper.mli
trackler-2.2.1.161 tracks/ocaml/exercises/zipper/zipper.mli
trackler-2.2.1.160 tracks/ocaml/exercises/zipper/zipper.mli