def uniq

bolt@1.27.0.0 · src/lint/plan.bend:214

import bolt@1.27.0.0/src/lint/plan.bend as Plan
import Base

214# each path once, where it first appears
215def uniq(ps: List<&2, String>, +seen: List<&2, String>) -> List<&2, String>:
216  match ps:
217    case Nil{}:
218      Nil{}
219    case Con{+p, rest}:
220      +dup = seen.has(seen, p)
221      +more = uniq(rest, p <> seen)
222      Bool.pick(List<&2, String>, dup, more, p <> more)

Uses (4)

Used by (3)