TensorFile.write_all: def of stelliferous@0.0.2.0 Import: import stelliferous@0.0.2.0/tensor_file.bend as TensorFile Lines 345-354 of stelliferous@0.0.2.0/tensor_file.bend: https://jend.leeeet.dev/read.txt?path=stelliferous@0.0.2.0/tensor_file.bend&start_line=345&end_line=354 import Base def write_all(fuel: Nat,writing: Writing) -> IO(Bool): match fuel writing: case 0n Pending{file,storage,offset,remaining}: finished(file,False{}) case 0n Finished{file,complete}: finished(file,complete) case 1n+rest Finished{file,complete}: finished(file,complete) case 1n+rest Pending{file,storage,+offset,+remaining}: +count = Nat.min(U32.to_nat(chunk()),remaining) do IO: next : Writing <- write_chunk(file,read_chunk(count,offset,storage,[]),count,remaining,offset) write_all(rest,next) Uses (12): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=IO https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=IO.bind https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.min https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.to_nat https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/tensor_file.bend&name=Writing https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/tensor_file.bend&name=chunk https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/tensor_file.bend&name=finished https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/tensor_file.bend&name=read_chunk https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/tensor_file.bend&name=write_chunk