Core.count_err: def of bend-schema-lib@0.4.1.0 Import: import bend-schema-lib@0.4.1.0/core.bend as Core Lines 836-848 of bend-schema-lib@0.4.1.0/core.bend: https://jend.leeeet.dev/read.txt?path=bend-schema-lib@0.4.1.0/core.bend&start_line=836&end_line=848 import Base # The count, as an error: at an SListLen the count is read before any element, # so a list out of bounds is CountNotIn at the list's own path. A value that is # not a list has no count to object to, and is refused as a list schema refuses # it: NotList, or Missing/TooLarge for the two nodes that are never a shape # (the same reasons check's own arms give them). def count_err(+lo: Nat, +hi: Nat, r: Raw) -> Maybe<&2, Err>: match r: case RNil{}: in_err(list_len_ok(lo, hi, r), CountNotIn{lo, hi}) case RCons{h, t}: in_err(list_len_ok(lo, hi, r), CountNotIn{lo, hi}) case _: here(missing_or(r, NotList{})) Uses (9): 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=bend-schema-lib@0.4.1.0/core.bend&name=Err https://jend.leeeet.dev/definition.txt?path=bend-schema-lib@0.4.1.0/core.bend&name=Raw https://jend.leeeet.dev/definition.txt?path=bend-schema-lib@0.4.1.0/core.bend&name=Why https://jend.leeeet.dev/definition.txt?path=bend-schema-lib@0.4.1.0/core.bend&name=here https://jend.leeeet.dev/definition.txt?path=bend-schema-lib@0.4.1.0/core.bend&name=in_err https://jend.leeeet.dev/definition.txt?path=bend-schema-lib@0.4.1.0/core.bend&name=list_len_ok https://jend.leeeet.dev/definition.txt?path=bend-schema-lib@0.4.1.0/core.bend&name=missing_or