def files.under

ezx@1.11.0.0 · src/ws/run.bend:290

import ezx@1.11.0.0/src/ws/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

290# every listed file under a directory, read, as the walk takes it
291def files.under(+dir: String, ps: List<&2, String>) -> IO(List<&2, K.Source>):
292  match ps:
293    case []:
294      IO.pure(List<&2, K.Source>, [])
295    case +hd <> tl:
296      do IO<List<&2, K.Source>>:
297        mm : Maybe<&2, String> <- F.read(dir ++ "/" ++ hd)
298        rest : List<&2, K.Source> <- files.under(dir, tl)
299        return K.Source{hd, F.text_of(mm)} <> rest

Uses (10)

Used by (2)