def fits

ezx@1.11.0.0 · src/fetch/plan.bend:169

import ezx@1.11.0.0/src/fetch/plan.bend as Plan
import Base
import ezx@1.11.0.0/src/lock/world.bend as W
import ezx@1.11.0.0/src/pkg/pkg.bend as K

169# whether every file is the one the lock names, in the lock's order. A list
170# longer or shorter than the lock's is not the package.
171def fits(fs: List<&2, K.Item>, ls: List<&2, W.Source>) -> Bool:
172  match fs ls:
173    case Nil{} Nil{}:
174      True{}
175    case Nil{} Con{_l, _m}:
176      False{}
177    case Con{_f, _g} Nil{}:
178      False{}
179    case Con{f, g} Con{l, m}:
180      +rest = fits(g, m)
181      Bool.and(fit(f, l), rest)

Uses (6)

Used by (2)