hvm-core 0.2.26

HVM-Core is a massively parallel Interaction Combinator evaluator.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Leaf = @x @Leaf @Node (Leaf x)
Node = @x0 @x1 @Leaf @Node (Node x0 x1)

add = λa λb (+ a b)

gen = λn match n {
  0: (Leaf 1)
  1+: (Node (gen n-1) (gen n-1))
}

sum = λt
  let case_leaf = λx x
  let case_node = λx0 λx1 (add (sum x0) (sum x1))
  (t case_leaf case_node)

main = (sum (gen 24))