/* * 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 size of a file, and its functions.///pubmod Fs.FileSize {use Fs.FileStatuse Fs.Size////// Effect for reading the size of a file.////// Use the `FileSize.runWithFileStat` handler.///pubeffFileSize {////// Returns the size of the given file `f`.///defsize(f: String): Result[IoError, Size] }////// Handles the `FileSize` effect of the given function `f` using the `FileStat` effect.///pubdefrunWithFileStat(f: Unit -> a \ ef): a \ (ef - FileSize) + FileStat =run { f() } withhandlerFileSize {defsize(filename, k) = k(Fs.FileStat.size(filename)) }}