Sha256: 086f5bd7d081587ba02b72f5e5166d8d24e84cda93d1202d423deba89b3781db

Contents?: true

Size: 1.04 KB

Versions: 177

Compression:

Stored size: 1.04 KB

Contents

(** Zipper exercise interface *)
open Core.Std

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

177 entries across 177 versions & 1 rubygems

Version Path
trackler-2.0.8.37 tracks/ocaml/exercises/zipper/zipper.mli
trackler-2.0.8.36 tracks/ocaml/exercises/zipper/zipper.mli
trackler-2.0.8.35 tracks/ocaml/exercises/zipper/zipper.mli
trackler-2.0.8.34 tracks/ocaml/exercises/zipper/zipper.mli
trackler-2.0.8.33 tracks/ocaml/exercises/zipper/zipper.mli
trackler-2.0.8.32 tracks/ocaml/exercises/zipper/zipper.mli
trackler-2.0.8.31 tracks/ocaml/exercises/zipper/zipper.mli
trackler-2.0.8.30 tracks/ocaml/exercises/zipper/zipper.mli
trackler-2.0.8.29 tracks/ocaml/exercises/zipper/zipper.mli
trackler-2.0.8.28 tracks/ocaml/exercises/zipper/zipper.mli
trackler-2.0.8.27 tracks/ocaml/exercises/zipper/zipper.mli
trackler-2.0.8.26 tracks/ocaml/exercises/zipper/zipper.mli
trackler-2.0.8.24 tracks/ocaml/exercises/zipper/zipper.mli
trackler-2.0.8.23 tracks/ocaml/exercises/zipper/zipper.mli
trackler-2.0.8.22 tracks/ocaml/exercises/zipper/zipper.mli
trackler-2.0.8.21 tracks/ocaml/exercises/zipper/zipper.mli
trackler-2.0.8.20 tracks/ocaml/exercises/zipper/zipper.mli
trackler-2.0.8.19 tracks/ocaml/exercises/zipper/zipper.mli
trackler-2.0.8.18 tracks/ocaml/exercises/zipper/zipper.mli
trackler-2.0.8.17 tracks/ocaml/exercises/zipper/zipper.mli