MlbendDatasets.cached_or_fail: def of mlbend-datasets@0.1.6.0 Import: import mlbend-datasets@0.1.6.0/main.bend as MlbendDatasets Lines 261-272 of mlbend-datasets@0.1.6.0/main.bend: https://jend.leeeet.dev/read.txt?path=mlbend-datasets@0.1.6.0/main.bend&start_line=261&end_line=272 import Base import mlbend-huggingface@0.1.1.0/main.bend as Hf # A table from the cache when it is there. With MLBEND_DATA set the cache is # the source of the run: a miss is an error, not a quiet fetch, or the # manifest would hash one file and the program would read another. def cached_or_fail(m: Maybe<&1, String>, +repo: String, +path: String, header: Bool, drop: Nat) -> IO(Result<&1, &1, Hf.Err, Table>): match m: case Some{text}: IO.pure(Result<&1, &1, Hf.Err, Table>, Done{csv_text(text, header, drop)}) case None{}: IO.pure(Result<&1, &1, Hf.Err, Table>, Fail{Hf.ErrNet{0, String.append("MLBEND_DATA: no readable file at ", String.append(repo, String.append("/", path)))}}) Uses (11): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=IO https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=IO.pure https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Maybe https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Result https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String.append https://jend.leeeet.dev/definition.txt?path=mlbend-datasets@0.1.6.0/main.bend&name=Table https://jend.leeeet.dev/definition.txt?path=mlbend-datasets@0.1.6.0/main.bend&name=csv_text https://jend.leeeet.dev/definition.txt?path=mlbend-huggingface@0.1.1.0/main.bend&name=Err