Notch.file.if: def of bend-kit-notch@0.4.0.0 Import: import bend-kit-notch@0.4.0.0/notch.bend as Notch Lines 258-268 of bend-kit-notch@0.4.0.0/notch.bend: https://jend.leeeet.dev/read.txt?path=bend-kit-notch@0.4.0.0/notch.bend&start_line=258&end_line=268 import Base # Write a stamped line and newline to a File; the returned handle must be kept or closed. # Below the logger's level, returns the same handle and Done without a clock read or write. def file.if(on: Bool, h: File, lg: Logger, lvl: Level, msg: String, fs: List<&2, Field>) -> IO(File & Result<&1, &1, U32 & String, Unit>): match on: case True{}: do IO>: s : String <- stamp(lg, lvl, msg, fs) File.write(h, s ++ "\n") case False{}: IO.pure(File & Result<&1, &1, U32 & String, Unit>, (h, Done{Unit{}})) Uses (18): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=File https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=File.write https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=IO https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=IO.bind https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=IO.pure https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Pair https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Result https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Sigma https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String.append https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Unit https://jend.leeeet.dev/definition.txt?path=bend-kit-notch@0.4.0.0/notch.bend&name=Field https://jend.leeeet.dev/definition.txt?path=bend-kit-notch@0.4.0.0/notch.bend&name=Level https://jend.leeeet.dev/definition.txt?path=bend-kit-notch@0.4.0.0/notch.bend&name=Logger https://jend.leeeet.dev/definition.txt?path=bend-kit-notch@0.4.0.0/notch.bend&name=stamp