def put.write

cswap-bend-cli@0.1.0.0 · fs/write.bend:21

import cswap-bend-cli@0.1.0.0/fs/write.bend as Write
import Base
import cswap-bend-cli@0.1.0.0/fs.bend as Fs

21def put.write(data: String, r: Fs.Res(File)) -> IO(Fs.Res(Unit)):
22  match r:
23    case Fail{e}:
24      IO.pure(Fs.Res(Unit), Fail{e})
25    case Done{f}:
26      IO.bind(File & Fs.Res(Unit), Fs.Res(Unit), File.write(f, data), put.close)

Uses (11)

Used by (2)