def fill_step_success
bendtorch-core@0.1.0.0 · src/tensor/construction_PROOF.bend:567
import bendtorch-core@0.1.0.0/src/tensor/construction_PROOF.bend as ConstructionPROOF
import Base
import bendtorch-core@0.1.0.0/src/shape/core.bend as Shape
import bendtorch-core@0.1.0.0/src/storage/arith.bend as Arith
import bendtorch-core@0.1.0.0/src/tensor/core.bend as Core
import bendtorch-core@0.1.0.0/src/tensor/transform_totality.bend as TransformTotality
567def fill_step_success(+shape: Shape.Shape, +rest: List<&2, F32>, +cursor: Nat,
568 pair: Core.Tensor<shape> & Result<&2, &2, Core.Error, Unit>,
569 successful: {TransformTotality.write_succeeded(shape, pair) == True{} : Bool},
570 -rec: @tensor: Core.Tensor<shape> -> FillSuccess<shape, Core.fill_values(rest, shape, tensor, 1n+cursor)>) ->
571 FillSuccess<shape, Core.fill_values_step(shape, tensor => Core.fill_values(rest, shape, tensor, 1n+cursor), pair)>:
572 (tensor, result) = pair
573 match result:
574 case Fail{error}:
575 FillSuccess{Empty.absurd({False{} == True{} : Bool}, Arith.clash(successful))}
576 case Done{unit}:
577 FillSuccess{{\{FillSuccess: successful => successful} : FillSuccess<shape, Core.fill_values(rest, shape, tensor, 1n+cursor)> ->
578 {Result.is_done(&2, &1, Core.Error, Core.Tensor<shape>, Core.fill_values(rest, shape, tensor, 1n+cursor)) == True{} : Bool}}(rec(tensor))}