def Spans.lean_right
import bend-lint-rules@0.2.0.0/lib/text/main.bend as BendLintRulesimport Base
106# The node over `l` and `r`, where `r` is two levels higher: the mirror of `lean_left`.
107def Spans.lean_right(l: Spans, b: U32, e: U32, r: Spans) -> Spans:
108 match r:
109 case SNode{h, +rl, rb, re, +rr}:
110 Spans.lean_right.if(U32.is_ge(Spans.height(rr), Spans.height(rl)), l, b, e, rl, rb, re, rr)
111 case SLeaf{}:
112 Spans.node(l, b, e, SLeaf{})