Sha256: 380915c5278de0ffcdc405d988e0b1db6c8246a1cf7cf832530efe3e33bcfe5d

Contents?: true

Size: 325 Bytes

Versions: 98

Compression:

Stored size: 325 Bytes

Contents

(* Binary tree with leaves car­rying an integer. *)
type tree = Leaf of int | Node of tree * tree

let rec exists_leaf test tree =
  match tree with
  | Leaf v -> test v
  | Node (left, right) ->
      exists_leaf test left
      || exists_leaf test right

let has_even_leaf tree =
  exists_leaf (fun n -> n mod 2 = 0) tree

Version data entries

98 entries across 96 versions & 9 rubygems

Version Path
rouge-4.5.1 lib/rouge/demos/ocaml
rouge-4.5.0 lib/rouge/demos/ocaml
rouge-4.4.0 lib/rouge/demos/ocaml
rouge-4.3.0 lib/rouge/demos/ocaml
rouge-4.2.1 lib/rouge/demos/ocaml
rouge-4.2.0 lib/rouge/demos/ocaml
rouge-4.1.3 lib/rouge/demos/ocaml
rouge-4.1.2 lib/rouge/demos/ocaml
rouge-4.1.1 lib/rouge/demos/ocaml
mumukit-content-type-1.12.1 vendor/bundle/ruby/2.7.0/gems/rouge-3.30.0/lib/rouge/demos/ocaml
mumukit-content-type-1.12.0 vendor/bundle/ruby/2.7.0/gems/rouge-3.30.0/lib/rouge/demos/ocaml
rouge-4.1.0 lib/rouge/demos/ocaml
rouge-4.0.1 lib/rouge/demos/ocaml
rouge-4.0.0 lib/rouge/demos/ocaml
rouge-3.30.0 lib/rouge/demos/ocaml
rouge-3.29.0 lib/rouge/demos/ocaml
rouge-3.28.0 lib/rouge/demos/ocaml
rouge-3.27.0 lib/rouge/demos/ocaml
rouge-3.26.1 lib/rouge/demos/ocaml
mumukit-content-type-1.11.1 vendor/bundle/ruby/2.6.0/gems/rouge-3.26.0/lib/rouge/demos/ocaml