IntrusiveList.count_loop: def of bend-collections@1.0.0.0 Import: import bend-collections@1.0.0.0/src/containers/internal/intrusive_list.bend as IntrusiveList Lines 263-268 of bend-collections@1.0.0.0/src/containers/internal/intrusive_list.bend: https://jend.leeeet.dev/read.txt?path=bend-collections@1.0.0.0/src/containers/internal/intrusive_list.bend&start_line=263&end_line=268 import Base import bend-collections@1.0.0.0/src/containers/types/intrusive_doubly_linked_list.bend as E def count_loop(~S: Type, ~N: Data, ~V: Data, ~C: Data, ~next: S -> N -> S & Maybe<&2, N>, ~value: S -> N -> S & V, ~pred: S -> C -> V -> S & Bool, +fuel: Nat, +c: C, r: S & (Maybe<&2, N> & Nat)) -> S & Result<&2, &1, E.Error, Nat>: match fuel r: case _ Tuple{s, Tuple{None{}, acc}}: (s, Done{acc}) case 0n Tuple{s, Tuple{Some{node}, acc}}: (s, Fail{E.LimitExceeded{}}) case 1n+p Tuple{s, Tuple{Some{node}, acc}}: count_loop(~S, ~N, ~V, ~C, ~next, ~value, ~pred, p, c, count_step(~S, ~N, ~V, ~C, ~next, ~value, ~pred, s, node, c, acc)) 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=Pair https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Result https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Sigma https://jend.leeeet.dev/definition.txt?path=bend-collections@1.0.0.0/src/containers/internal/intrusive_list.bend&name=count_step https://jend.leeeet.dev/definition.txt?path=bend-collections@1.0.0.0/src/containers/types/intrusive_doubly_linked_list.bend&name=Error