diff --git a/platform/Env.roc b/platform/Env.roc index 4e491897..1253bc82 100644 --- a/platform/Env.roc +++ b/platform/Env.roc @@ -44,10 +44,10 @@ exe_path! = |{}| ## ## If the value is invalid Unicode, the invalid parts will be replaced with the ## [Unicode replacement character](https://unicode.org/glossary/#replacement_character) ('�'). -var! : Str => Result Str [VarNotFound] +var! : Str => Result Str [VarNotFound(Str)] var! = |name| Host.env_var!(name) - |> Result.map_err(|{}| VarNotFound) + |> Result.map_err(|{}| VarNotFound(name)) ## Reads the given environment variable and attempts to decode it into the correct type. ## The type being decoded into will be determined by type inference. For example, @@ -74,10 +74,10 @@ var! = |name| ## fail with [DecodeErr](https://www.roc-lang.org/builtins/Decode#DecodeError) ## because `123456789` is too large to fit in a [U16](https://www.roc-lang.org/builtins/Num#U16). ## -decode! : Str => Result val [VarNotFound, DecodeErr DecodeError] where val implements Decoding +decode! : Str => Result val [VarNotFound(Str), DecodeErr DecodeError] where val implements Decoding decode! = |name| when Host.env_var!(name) is - Err({}) -> Err(VarNotFound) + Err({}) -> Err(VarNotFound(name)) Ok(var_str) -> Str.to_utf8(var_str) |> Decode.from_bytes(EnvDecoding.format({})) diff --git a/platform/File.roc b/platform/File.roc index fc5ab627..0e8e1d9e 100644 --- a/platform/File.roc +++ b/platform/File.roc @@ -251,7 +251,7 @@ is_writable! = |path_str| ## This uses [rust's std::fs::Metadata::accessed](https://doc.rust-lang.org/std/fs/struct.Metadata.html#method.accessed). ## Note that this is [not guaranteed to be correct in all cases](https://doc.rust-lang.org/std/fs/struct.Metadata.html#method.accessed). ## -## NOTE: thise function will not work if the platform was built with musl, which is the case for the normal tar.br URL release. +## NOTE: this function will not work on Linux if the platform was built with musl, which is the case for the normal tar.br URL release. ## See "Running Locally" in the README.md file to build without musl. time_accessed! : Str => Result Utc [PathErr IOErr] time_accessed! = |path_str| @@ -263,7 +263,7 @@ time_accessed! = |path_str| ## ## This uses [rust's std::fs::Metadata::modified](https://doc.rust-lang.org/std/fs/struct.Metadata.html#method.modified). ## -## NOTE: this function will not work if the platform was built with musl, which is the case for the normal tar.br URL release. +## NOTE: this function will not work on Linux if the platform was built with musl, which is the case for the normal tar.br URL release. ## See "Running Locally" in the README.md file to build without musl. time_modified! : Str => Result Utc [PathErr IOErr] time_modified! = |path_str| @@ -275,7 +275,7 @@ time_modified! = |path_str| ## ## This uses [rust's std::fs::Metadata::created](https://doc.rust-lang.org/std/fs/struct.Metadata.html#method.created). ## -## NOTE: this function will not work if the platform was built with musl, which is the case for the normal tar.br URL release. +## NOTE: this function will not work on Linux if the platform was built with musl, which is the case for the normal tar.br URL release. ## See "Running Locally" in the README.md file to build without musl. time_created! : Str => Result Utc [PathErr IOErr] time_created! = |path_str|