fileWriter static method

Conveyor<Free<IOOp, dynamic>, SinkF<Free<IOOp, dynamic>, IList<int>>> fileWriter(
  1. String path
)

Implementation

static Conveyor<Free<IOOp, dynamic>, SinkF<Free<IOOp, dynamic>, IList<int>>> fileWriter(String path) => Source.resource(
    io.openFile(path, false),
    (FileRef file) => Source.constant(IOM, (IList<int> bytes) => Source.eval_(io.writeBytes(file, bytes))),
    (FileRef file) => Source.eval_(io.closeFile(file)));