/* * 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 contents of a file as a string, and its functions.///pubmod Fs.ReadFile {use Fs.FileRead////// Effect for reading the contents of a file as a string.////// Use the `ReadFile.runWithFileRead` handler.///pubeffReadFile {////// Returns a string of all the contents of the given file `f`.///defread(f: String): Result[IoError, String] }////// Handles the `ReadFile` effect of the given function `f` using the `FileRead` effect.///pubdefrunWithFileRead(f: Unit -> a \ ef): a \ (ef - ReadFile) + FileRead =run { f() } withhandlerReadFile {defread(filename, k) = k(Fs.FileRead.read(filename)) }}