MlbendSplit.rows_of_class: def of mlbend-split@0.1.1.0 Import: import mlbend-split@0.1.1.0/main.bend as MlbendSplit Lines 40-47 of mlbend-split@0.1.1.0/main.bend: https://jend.leeeet.dev/read.txt?path=mlbend-split@0.1.1.0/main.bend&start_line=40&end_line=47 import Base # The rows of one class, with their indices. def rows_of_class(labels: List<&2, Nat>, +c: Nat, +i: Nat, +acc: List<&2, Nat>) -> List<&2, Nat>: match labels: case Nil{}: acc case Con{h, t}: rows_of_class(t, c, Nat.add(i, 1n), Bool.pick(List<&2, Nat>, Nat.is_eq(h, c), List.append(&2, Nat, acc, Con{i, Nil{}}), acc)) Uses (6): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.pick https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List.append https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.add https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.is_eq