def file.if
bend-kit-notch@0.4.0.0 · notch.bend:258
import bend-kit-notch@0.4.0.0/notch.bend as Notch
import Base
258
259
260def file.if(on: Bool, h: File, lg: Logger, lvl: Level, msg: String,
261 fs: List<&2, Field>) -> IO(File & Result<&1, &1, U32 & String, Unit>):
262 match on:
263 case True{}:
264 do IO<File & Result<&1, &1, U32 & String, Unit>>:
265 s : String <- stamp(lg, lvl, msg, fs)
266 File.write(h, s ++ "\n")
267 case False{}:
268 IO.pure(File & Result<&1, &1, U32 & String, Unit>, (h, Done{Unit{}}))