Skip to content

Commit b427a77

Browse files
authored
Merge pull request #301 from roc-lang/no-task-refs
remove references to Task
2 parents 71a0666 + 032712e commit b427a77

File tree

3 files changed

+14
-15
lines changed

3 files changed

+14
-15
lines changed

platform/Env.roc

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ var! = \name ->
5252
## Reads the given environment variable and attempts to decode it.
5353
##
5454
## The type being decoded into will be determined by type inference. For example,
55-
## if this ends up being used like a `Task U16 _` then the environment variable
55+
## if this ends up being used like a `Result U16 _` then the environment variable
5656
## will be decoded as a string representation of a `U16`. Trying to decode into
5757
## any other type will fail with a `DecodeErr`.
5858
##
@@ -65,8 +65,8 @@ var! = \name ->
6565
##
6666
## ```
6767
## # Reads "NUM_THINGS" and decodes into a U16
68-
## getU16Var : Str -> Task U16 [VarNotFound, DecodeErr DecodeError] [Read [Env]]
69-
## getU16Var = \var -> Env.decode! var
68+
## get_u16_var! : Str => Result U16 [VarNotFound, DecodeErr DecodeError] [Read [Env]]
69+
## get_u16_var! = \var -> Env.decode! var
7070
## ```
7171
##
7272
## If `NUM_THINGS=123` then `getU16Var` succeeds with the value of `123u16`.
@@ -108,10 +108,9 @@ dict! = \{} ->
108108
# ##
109109
# ## If any key or value contains invalid Unicode, the [Unicode replacement character](https://unicode.org/glossary/#replacement_character)
110110
# ## (`�`) will be used in place of any parts of keys or values that are invalid Unicode.
111-
# walk : state, (state, Str, Str -> state) -> Task state [NonUnicodeEnv state] [Read [Env]]
112-
# walk = \state, walker ->
113-
# Effect.envWalk state walker
114-
# |> InternalTask.fromEffect
111+
# walk! : state, (state, Str, Str -> state) => Result state [NonUnicodeEnv state] [Read [Env]]
112+
# walk! = \state, walker ->
113+
# Host.env_walk! state walker
115114
# TODO could potentially offer something like walkNonUnicode which takes (state, Result Str Str, Result Str Str) so it
116115
# tells you when there's invalid Unicode. This is both faster than (and would give you more accurate info than)
117116
# using regular `walk` and searching for the presence of the replacement character in the resulting
@@ -123,7 +122,7 @@ dict! = \{} ->
123122
# decode all the required vars only, and then decode the optional ones separately some other way.
124123
# Alternatively, it could make sense to have some sort of tag union convention here, e.g.
125124
# if decoding into a tag union of [Present val, Missing], then it knows what to do.
126-
# decodeAll : Task val [] [EnvDecodingFailed Str] [Env] where val implements Decoding
125+
# decode_all : Result val [] [EnvDecodingFailed Str] [Env] where val implements Decoding
127126

128127
ARCH : [X86, X64, ARM, AARCH64, OTHER Str]
129128
OS : [LINUX, MACOS, WINDOWS, OTHER Str]

platform/Path.roc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,8 @@ display = \path ->
174174
Err _ -> ""
175175

176176
## Returns true if the path exists on disk and is pointing at a directory.
177-
## Returns `Task.ok false` if the path exists and it is not a directory. If the path does not exist,
178-
## this function will return `Task.err PathErr PathDoesNotExist`.
177+
## Returns `Ok false` if the path exists and it is not a directory. If the path does not exist,
178+
## this function will return `Err (PathErr PathDoesNotExist)`.
179179
##
180180
## This uses [rust's std::path::is_dir](https://doc.rust-lang.org/std/path/struct.Path.html#method.is_dir).
181181
##
@@ -186,8 +186,8 @@ is_dir! = \path ->
186186
Ok (res == IsDir)
187187

188188
## Returns true if the path exists on disk and is pointing at a regular file.
189-
## Returns `Task.ok false` if the path exists and it is not a file. If the path does not exist,
190-
## this function will return `Task.err PathErr PathDoesNotExist`.
189+
## Returns `Ok false` if the path exists and it is not a file. If the path does not exist,
190+
## this function will return `Err (PathErr PathDoesNotExist)`.
191191
##
192192
## This uses [rust's std::path::is_file](https://doc.rust-lang.org/std/path/struct.Path.html#method.is_file).
193193
##
@@ -198,8 +198,8 @@ is_file! = \path ->
198198
Ok (res == IsFile)
199199

200200
## Returns true if the path exists on disk and is pointing at a symbolic link.
201-
## Returns `Task.ok false` if the path exists and it is not a symbolic link. If the path does not exist,
202-
## this function will return `Task.err PathErr PathDoesNotExist`.
201+
## Returns `Ok false` if the path exists and it is not a symbolic link. If the path does not exist,
202+
## this function will return `Err (PathErr PathDoesNotExist)`.
203203
##
204204
## This uses [rust's std::path::is_symlink](https://doc.rust-lang.org/std/path/struct.Path.html#method.is_symlink).
205205
##

platform/Tcp.roc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ parse_connect_err = \err ->
4444
"ErrorKind::Unsupported" -> Unsupported
4545
other -> Unrecognized other
4646

47-
## Represents errors that can occur when performing a [Task] with a [Stream].
47+
## Represents errors that can occur when performing an effect with a [Stream].
4848
StreamErr : [
4949
StreamNotFound,
5050
PermissionDenied,

0 commit comments

Comments
 (0)