def whole.read
ezx@1.11.0.0 · src/lock/run.bend:463
import ezx@1.11.0.0/src/lock/run.bend as Run
import Base
import ezx@1.11.0.0/src/io/file.bend as F
import ezx@1.11.0.0/src/pkg/pkg.bend as K
463
464
465
466def whole.read(+work: String, ps: List<&2, String>) -> IO(List<&2, K.Source>):
467 match ps:
468 case []:
469 IO.pure(List<&2, K.Source>, [])
470 case +h <> t:
471 do IO<List<&2, K.Source>>:
472 m : Maybe<&2, String> <- F.read(h)
473 rest : List<&2, K.Source> <- whole.read(work, t)
474 return whole.put(m, String.drop(h, (1n + String.length(work) : Nat)), rest)