def lc.tab.set.go

bend-osdev-cipher-core@0.1.0.0 · cipher_core.bend:308

import bend-osdev-cipher-core@0.1.0.0/cipher_core.bend as CipherCore
import Base

308def lc.tab.set.go(t: LcTab, path: List<&2, Bool>, v: U32) -> LcTab:
309  match t:
310    case LcLeaf{w}:
311      LcLeaf{v}
312    case LcNode{l, r}:
313      match path:
314        case Nil{}:
315          LcNode{l, r}
316        case Con{b, rest}:
317          match b:
318            case True{}:
319              LcNode{l, lc.tab.set.go(r, rest, v)}
320            case False{}:
321              LcNode{lc.tab.set.go(l, rest, v), r}

Uses (4)

Used by (1)