TensorOperations.reduce_when: def of stelliferous@0.0.2.0 Import: import stelliferous@0.0.2.0/tensor_operations.bend as TensorOperations Lines 269-279 of stelliferous@0.0.2.0/tensor_operations.bend: https://jend.leeeet.dev/read.txt?path=stelliferous@0.0.2.0/tensor_operations.bend&start_line=269&end_line=279 import Base import stelliferous@0.0.2.0/storage_buffer.bend as Storage import stelliferous@0.0.2.0/tensor_view.bend as Views import stelliferous@0.0.2.0/tensor_access.bend as Access import stelliferous@0.0.2.0/proofs/tensor_access_certificate.bend as AccessCertificate def reduce_when(~Element: Data,~Accumulator: Data,~operation: Accumulator -> Element -> Accumulator, valid: Bool,count: Maybe<&2,U32>,+view: Views.View,buffer: Storage.Buffer,initial: Accumulator) -> Outcome<(Storage.Buffer & Accumulator)>: match valid count: case True{} Some{+count}: Storage.Buffer{storage,length,certificate} = buffer +fast = Views.is_contiguous(view) Accepted{reduce_buffer(~Element,~Accumulator,length, Access.reduce_run(~Element,~Accumulator,~operation,fast,U32.to_nat(count),view,storage,initial), AccessCertificate.reduce(~Element,~Accumulator,~operation,fast,U32.to_nat(count),view,storage,initial,certificate))} case valid count: Rejected{(buffer,initial)} Uses (13): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Maybe https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Pair https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Sigma https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 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/proofs/tensor_access_certificate.bend&name=reduce https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/storage_buffer.bend&name=Buffer https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/tensor_access.bend&name=reduce_run https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/tensor_operations.bend&name=Outcome https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/tensor_operations.bend&name=reduce_buffer https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/tensor_view.bend&name=View https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/tensor_view.bend&name=is_contiguous