Migrate.legacy.apply.loop: def of mylsm-lsm-store@0.6.0.1 Import: import mylsm-lsm-store@0.6.0.1/src/transfer/Migrate.bend as Migrate Lines 109-137 of mylsm-lsm-store@0.6.0.1/src/transfer/Migrate.bend: https://jend.leeeet.dev/read.txt?path=mylsm-lsm-store@0.6.0.1/src/transfer/Migrate.bend&start_line=109&end_line=137 import Base import mylsm-lsm-store@0.6.0.1/src/ByteMemTable.bend as ByteMemTable def legacy.apply.loop( fuel: Nat, state: LegacyApplyState ) -> Result<&1, &1, U32 & String, ByteMemTable.Table>: match fuel: case 0n: match state: case LegacyApplyNeed{_, table}: Done{table} case LegacyApplyConverted{_, _, Fail{error}}: Fail{error} case LegacyApplyConverted{_, table, Done{_}}: Done{table} case 1n+rest: match state: case LegacyApplyNeed{entries, table}: match entries: case Nil{}: Done{table} case Con{entry, tail}: legacy.apply.loop(rest, LegacyApplyConverted{tail, table, legacy.entry.bytes(entry)}) case LegacyApplyConverted{tail, table, result}: match result: case Fail{error}: Fail{error} case Done{ByteMemTable.Entry{key, value}}: match value: case None{}: legacy.apply.loop(rest, LegacyApplyNeed{tail, ByteMemTable.del(table, key)}) case Some{bytes}: legacy.apply.loop(rest, LegacyApplyNeed{tail, ByteMemTable.put(table, key, bytes)}) Uses (13): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Maybe https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Pair https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Result https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/ByteMemTable.bend&name=Entry https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/ByteMemTable.bend&name=Table https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/ByteMemTable.bend&name=del https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/ByteMemTable.bend&name=put https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/transfer/Migrate.bend&name=LegacyApplyState https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/transfer/Migrate.bend&name=legacy.entry.bytes