/* * Copyright 2026 Flix Authors * * Use of this source code is governed by the Apache 2.0 license * that can be found in the LICENSE.md file. */////// Effect for reading the bytes of a file, and its functions.///pubmod Fs.ReadBytes {use Fs.FileRead////// Effect for reading the bytes of a file.////// Use the `ReadBytes.runWithFileRead` handler.///pubeffReadBytes {////// Returns a vector of all the bytes in the given file `f`.///defreadBytes(f: String): Result[IoError, Vector[Int8]] }////// Handles the `ReadBytes` effect of the given function `f` using the `FileRead` effect.///pubdefrunWithFileRead(f: Unit -> a \ ef): a \ (ef - ReadBytes) + FileRead =run { f() } withhandlerReadBytes {defreadBytes(filename, k) = k(Fs.FileRead.readBytes(filename)) }}