def scan
stelliferous@0.0.2.0 · tensor_model.bend:36
import stelliferous@0.0.2.0/tensor_model.bend as TensorModel
import Base
36def scan(rest: Store,same: Bool,+name: String,tensor: Tensor(),+wanted: String) -> Tensor() & Store:
37 match rest same:
38 case Empty{} True{}: (tensor,Empty{})
39 case Entry{next,other,more} True{}: (tensor,Entry{next,other,more})
40 case Empty{} False{}: (missing(wanted),Entry{name,tensor,Empty{}})
41 case Entry{+next,other,more} False{}: passed(name,tensor,scan(more,String.eq(next,wanted),next,other,wanted))