def fresh.fast

bolt@1.27.0.0 · src/rules/imports.bend:142

import bolt@1.27.0.0/src/rules/imports.bend as Imports
import Base
import bolt@1.27.0.0/src/lazy/lazy.bend as Lazy

142# `fresh.spec`, asking the short lists first and each only while the answer is
143# open: a target already found or seen is never looked for among every file
144def fresh.fast(ds: List<&2, String>, +seen: List<&2, String>, +read: List<&2, String>) -> List<&2, String>:
145  match ds:
146    case Nil{}:
147      Nil{}
148    case Con{+d, rest}:
149      +more = fresh.fast(rest, seen, read)
150      Bool.pick(List<&2, String>,
151        Lazy.and_then(Bool.not(seek(more, d)), _u => Lazy.and_then(Bool.not(seek(seen, d)), _v => seek(read, d))),
152        d <> more, more)

Uses (6)

Used by (1)