Skip to content

Commit 86ec56b

Browse files
authored
Merge pull request #24 from dtbenson43/main
change examples to match parameter order for clarity
2 parents a7180ae + 2e131d7 commit 86ec56b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/simplifile.gleam

+4-4
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ pub fn read(from filepath: String) -> Result(String, FileError) {
177177
/// Write a string to a file at the given path
178178
/// ## Example
179179
/// ```gleam
180-
/// let assert Ok(Nil) = write("Hello, World!", to: "./hello_world.txt")
180+
/// let assert Ok(Nil) = write(to: "./hello_world.txt", contents: "Hello, World!")
181181
/// ```
182182
///
183183
pub fn write(
@@ -221,7 +221,7 @@ pub fn delete_all(paths paths: List(String)) -> Result(Nil, FileError) {
221221
/// Append a string to the contents of a file at the given path
222222
/// ## Example
223223
/// ```gleam
224-
/// let assert Ok(Nil) = append("more text", to: "./needs_more_text.txt")
224+
/// let assert Ok(Nil) = append(to: "./needs_more_text.txt", contents: "more text")
225225
/// ```
226226
///
227227
pub fn append(
@@ -246,7 +246,7 @@ pub fn read_bits(from filepath: String) -> Result(BitArray, FileError) {
246246
/// Write a bitstring to a file at the given path
247247
/// ## Example
248248
/// ```gleam
249-
/// let assert Ok(Nil) = write_bits(<<"Hello, World!":utf8>>, to: "./hello_world.txt")
249+
/// let assert Ok(Nil) = write_bits(to: "./hello_world.txt", bits: <<"Hello, World!":utf8>>)
250250
/// ```
251251
///
252252
pub fn write_bits(
@@ -260,7 +260,7 @@ pub fn write_bits(
260260
/// Append a bitstring to the contents of a file at the given path
261261
/// ## Example
262262
/// ```gleam
263-
/// let assert Ok(Nil) = append_bits(<<"more text":utf8>>, to: "./needs_more_text.txt")
263+
/// let assert Ok(Nil) = append_bits(to: "./needs_more_text.txt", bits: <<"more text":utf8>>)
264264
/// ```
265265
///
266266
pub fn append_bits(

0 commit comments

Comments
 (0)