Sha256: df2628eaa8f0c9c757eb18652384c64e375aba29e6da9946394a082d6c5f3fda
Contents?: true
Size: 316 Bytes
Versions: 53
Compression:
Stored size: 316 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
53 entries across 51 versions & 8 rubygems