def path.clone.pair.build
mylsm-lsm-store@0.6.0.1 · src/ByteSstIo.bend:36
import mylsm-lsm-store@0.6.0.1/src/ByteSstIo.bend as ByteSstIo
import Base
36def path.clone.pair.build(
37 path: String,
38 copies: String & String
39) -> String & String:
40 match path:
41 case SNil{}:
42 match copies:
43 case (left, right): (path.clone.reverse(left, SNil{}), path.clone.reverse(right, SNil{}))
44 case SCon{Chr{+scalar}, rest}:
45 match copies:
46 case (left, right):
47 path.clone.pair.build(rest,
48 path.clone.pair.scalar(left, right,
49 nat.clone.pair(U32.to_nat(scalar))))