Sha256: fd2e31fe2df589c096407417279eba218afe4ecb1973df8c5b572e2c61ab063c
Contents?: true
Size: 317 Bytes
Versions: 16
Compression:
Stored size: 317 Bytes
Contents
(* Binary tree with leaves carrying an integer. *) type Tree = Leaf of int | Node of Tree * Tree let rec existsLeaf test tree = match tree with | Leaf v -> test v | Node (left, right) -> existsLeaf test left || existsLeaf test right let hasEvenLeaf tree = existsLeaf (fun n -> n % 2 = 0) tree
Version data entries
16 entries across 16 versions & 2 rubygems