package scaml

  1. Overview
  2. Docs
type side =
  1. | Left
  2. | Right
type 'a tree =
  1. | Leaf of 'a
  2. | Branch of 'a tree * 'a tree
val place : 'a list -> 'a tree

Layout the list of elements in a binary tree

val path : int -> int -> side list

path i n finds out how to access the i-th element of n in the layout by place.

val fold : leaf:('a -> 'b) -> branch:('b -> 'b -> 'b) -> 'a tree -> 'b

Folding over tree