Sha256: 139a977882c2f509df38f95019fdf685c864f9e17a242431efba5e853bd3efd8

Contents?: true

Size: 1.03 KB

Versions: 151

Compression:

Stored size: 1.03 KB

Contents

(** Zipper exercise interface *)
open Core

(** 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

151 entries across 151 versions & 1 rubygems

Version Path
trackler-2.2.1.50 tracks/ocaml/exercises/zipper/zipper.mli
trackler-2.2.1.49 tracks/ocaml/exercises/zipper/zipper.mli
trackler-2.2.1.48 tracks/ocaml/exercises/zipper/zipper.mli
trackler-2.2.1.47 tracks/ocaml/exercises/zipper/zipper.mli
trackler-2.2.1.46 tracks/ocaml/exercises/zipper/zipper.mli
trackler-2.2.1.45 tracks/ocaml/exercises/zipper/zipper.mli
trackler-2.2.1.44 tracks/ocaml/exercises/zipper/zipper.mli
trackler-2.2.1.43 tracks/ocaml/exercises/zipper/zipper.mli
trackler-2.2.1.42 tracks/ocaml/exercises/zipper/zipper.mli
trackler-2.2.1.41 tracks/ocaml/exercises/zipper/zipper.mli
trackler-2.2.1.40 tracks/ocaml/exercises/zipper/zipper.mli
trackler-2.2.1.39 tracks/ocaml/exercises/zipper/zipper.mli
trackler-2.2.1.38 tracks/ocaml/exercises/zipper/zipper.mli
trackler-2.2.1.37 tracks/ocaml/exercises/zipper/zipper.mli
trackler-2.2.1.36 tracks/ocaml/exercises/zipper/zipper.mli
trackler-2.2.1.35 tracks/ocaml/exercises/zipper/zipper.mli
trackler-2.2.1.34 tracks/ocaml/exercises/zipper/zipper.mli
trackler-2.2.1.33 tracks/ocaml/exercises/zipper/zipper.mli
trackler-2.2.1.32 tracks/ocaml/exercises/zipper/zipper.mli
trackler-2.2.1.31 tracks/ocaml/exercises/zipper/zipper.mli