def check_size

bend-ml-llama@0.2.0.0 · main.bend:1187

import bend-ml-llama@0.2.0.0/main.bend as BendMlLlama
import Base

1187# stops the program unless the file holds exactly n F32 numbers (n * 4 bytes)
1188def check_size(+path: String, +n: Nat) -> IO(Unit):
1189  do IO<Unit>:
1190    f : File <- IO.try(File, File.open(path, "r"))
1191    m : File & Result<&1, &1, U32 & String, U32> <- File.size(f)
1192    size_ok(m, Nat.mul(n, 4n), path)

Uses (14)

Used by (2)