def pkg.next

ezx@1.11.0.0 · src/pkg/pkg.bend:1327

import ezx@1.11.0.0/src/pkg/pkg.bend as Pkg
import Base
import ezx@1.11.0.0/src/io/file.bend as F
import ezx@1.11.0.0/src/pkg/path.bend as P

1327# a question read from disk and the walk carried on, or the walk's end judged
1328def pkg.next(
1329  stop: Stop,
1330  +top: String,
1331  +entry: String,
1332  +tree: Tree,
1333  +st: State,
1334  go: Tree -> State -> IO(Pkg)
1335) -> IO(Pkg):
1336  match stop:
1337    case Asking{+at}:
1338      do IO<Pkg>:
1339        m : Maybe<&2, String> <- F.read(P.join(top, at))
1340        go(tree.add(m, tree, at), resume(st))
1341    case Going{}:
1342      made.io(top, made(entry, st))
1343    case Missing{_at}:
1344      made.io(top, made(entry, st))
1345    case Climbs{_at}:
1346      made.io(top, made(entry, st))
1347    case Spent{}:
1348      made.io(top, made(entry, st))
1349    case Unnamed{_nv}:
1350      made.io(top, made(entry, st))

Uses (14)

Used by (1)