TensorOperations.apply_context_when: def of stelliferous@0.0.2.0 Import: import stelliferous@0.0.2.0/tensor_operations.bend as TensorOperations Lines 138-144 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=138&end_line=144 import Base import stelliferous@0.0.2.0/storage_buffer.bend as Storage import stelliferous@0.0.2.0/tensor_view.bend as Views def apply_context_when(~Element: Data,~Context: Data,~mapper: @+count: Nat -> @+position: U32 -> @+context: Context -> Storage.Buffer -> Storage.Buffer,context: Context,valid: Bool,count: Maybe<&2,U32>,view: Views.View, buffer: Storage.Buffer) -> Outcome>: match valid count: case True{} Some{+count}: Views.View{axes,+offset} = view Accepted{mapper(U32.to_nat(count),offset,context,buffer)} case valid count: Rejected{buffer} Uses (8): 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=Nat 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/storage_buffer.bend&name=Buffer 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_view.bend&name=View