Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DO NOT REVIEW] Change unit type to empty tuple #7505

Closed
wants to merge 3 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Update more roc files
  • Loading branch information
smores56 committed Jan 12, 2025
commit b3bbaa8813223ae2ba4a346238c04dc16a260e63
16 changes: 8 additions & 8 deletions crates/cli/tests/benchmarks/closure.roc
Original file line number Diff line number Diff line change
@@ -2,11 +2,11 @@ app [main!] { pf: platform "platform/main.roc" }

main! : () => ()
main! = \() ->
closure1(())
|> Result.try(closure2)
|> Result.try(closure3)
|> Result.try(closure4)
|> Result.with_default(())
closure1()
|> closure2()?
|> closure3()?
|> closure4()?
?? ()

# ---
closure1 : () -> Result () []
@@ -24,7 +24,7 @@ closure2 = \_ ->
x : Str
x = "a long string such that it's malloced"

Ok(())
Ok()
|> Result.map(\_ -> x)
|> Result.map(to_unit)

@@ -36,7 +36,7 @@ closure3 = \_ ->
x : Str
x = "a long string such that it's malloced"

Ok(())
Ok()
|> Result.try(\_ -> Ok(x) |> Result.map(\_ -> ()))

# # ---
@@ -45,6 +45,6 @@ closure4 = \_ ->
x : Str
x = "a long string such that it's malloced"

Ok(())
Ok()
|> Result.try(\_ -> Ok(x))
|> Result.map(\_ -> ())
4 changes: 2 additions & 2 deletions crates/cli/tests/test-projects/false-interpreter/main.roc
Original file line number Diff line number Diff line change
@@ -17,7 +17,7 @@ InterpreterErrors : [BadUtf8, DivByZero, EmptyStack, InvalidBooleanValue, Invali
main! : Str => ()
main! = \filename ->
when interpret_file!(filename) is
Ok(()) ->
Ok() ->
()

Err(StringErr(e)) ->
@@ -29,7 +29,7 @@ interpret_file! = \filename ->
result = interpret_ctx!(ctx)
when result is
Ok(_) ->
Ok(())
Ok()

Err(BadUtf8) ->
Err(StringErr("Failed to convert string from Utf8 bytes"))
4 changes: 2 additions & 2 deletions crates/cli/tests/test-projects/module_params/issue_7116.roc
Original file line number Diff line number Diff line change
@@ -2,10 +2,10 @@ app [main] {
cli: platform "https://github.com/roc-lang/basic-cli/releases/download/0.17.0/lZFLstMUCUvd5bjnnpYromZJXkQUrdhbva4xdBInicE.tar.br",
}

import Alias { passed: \_ -> Ok(()) }
import Alias { passed: \_ -> Ok() }

main =
Task.loop!((), loop)

loop = \{} ->
loop = \() ->
Task.map(Alias.exposed, \x -> Done(x))
2 changes: 1 addition & 1 deletion crates/compiler/builtins/roc/Inspect.roc
Original file line number Diff line number Diff line change
@@ -92,7 +92,7 @@ Inspect implements
inspect : val -> f where val implements Inspect, f implements InspectFormatter
inspect = \val ->
@Inspector(val_fn) = to_inspector(val)
val_fn(init(()))
val_fn(init())

to_str : val -> Str where val implements Inspect
to_str = \val ->
Loading