/* * 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 appending a string to a file, and its functions.///pubmod Fs.AppendFile {use Fs.FileWrite////// Effect for appending a string to a file.////// Use the `AppendFile.runWithFileWrite` handler.///pubeffAppendFile {////// Appends `str` to the given file `f`.////// Creates the file `f` if it does not exist.///defappend(data: {str = String}, f: String): Result[IoError, Unit] }////// Handles the `AppendFile` effect of the given function `f` using the `FileWrite` effect.///pubdefrunWithFileWrite(f: Unit -> a \ ef): a \ (ef - AppendFile) + FileWrite =run { f() } withhandlerAppendFile {defappend(data, file, k) = k(Fs.FileWrite.append(data, file)) }}