There have been several times where I've tried to write something like this
myFileContent |> File.writeBytes! "/some/path"
and been very surprised that I actually needed to write this
File.writeBytes! "/some/path" myFileContent
In the File module my initial assumption is that the file content is the important data structure that is the first argument to the functions, not the file path. I frequently want to build up the file content in a pipeline, but never the path, so it seems very unergonomic.
Because of this, I think we should change the file writing functions to accept the file content as the first argument. Thoughts?
Absolutely a good idea, I've noticed the same thing
fine by me!
Great!
PRs for basic-cli and basic-webserver:
https://github.com/roc-lang/basic-cli/pull/267
https://github.com/roc-lang/basic-webserver/pull/78
(deleted)
Last updated: Jun 16 2026 at 16:19 UTC