mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-02 16:21:11 +00:00
Update roc code base to use $(...) syntax
This commit is contained in:
parent
163bde0c41
commit
7189104df8
16 changed files with 65 additions and 65 deletions
|
@ -948,7 +948,7 @@ fn specialize_unique_newtype_records() {
|
|||
main =
|
||||
when Str.fromUtf8 (Encode.toBytes {a: Bool.true} TotallyNotJson.json) is
|
||||
Ok s -> when Str.fromUtf8 (Encode.toBytes {b: Bool.true} TotallyNotJson.json) is
|
||||
Ok t -> "\(s)\(t)"
|
||||
Ok t -> "$(s)$(t)"
|
||||
_ -> "<bad>"
|
||||
_ -> "<bad>"
|
||||
"#
|
||||
|
|
|
@ -330,7 +330,7 @@ fn list_map_try_ok() {
|
|||
List.mapTry [1, 2, 3] \num ->
|
||||
str = Num.toStr (num * 2)
|
||||
|
||||
Ok "\(str)!"
|
||||
Ok "$(str)!"
|
||||
"#,
|
||||
// Result Str [] is unwrapped to just Str
|
||||
RocList::<RocStr>::from_slice(&[
|
||||
|
@ -3695,10 +3695,10 @@ fn issue_3571_lowlevel_call_function_with_bool_lambda_set() {
|
|||
List.concat state mappedVals
|
||||
|
||||
add2 : Str -> Str
|
||||
add2 = \x -> "added \(x)"
|
||||
add2 = \x -> "added $(x)"
|
||||
|
||||
mul2 : Str -> Str
|
||||
mul2 = \x -> "multiplied \(x)"
|
||||
mul2 = \x -> "multiplied $(x)"
|
||||
|
||||
foo = [add2, mul2]
|
||||
bar = ["1", "2", "3", "4"]
|
||||
|
|
|
@ -1882,7 +1882,7 @@ fn task_always_twice() {
|
|||
@Effect inner
|
||||
|
||||
effectAfter : Effect a, (a -> Effect b) -> Effect b
|
||||
effectAfter = \(@Effect thunk), transform -> transform (thunk {})
|
||||
effectAfter = $(@Effect thunk), transform -> transform (thunk {})
|
||||
|
||||
Task a err : Effect (Result a err)
|
||||
|
||||
|
@ -1986,7 +1986,7 @@ fn todo_bad_error_message() {
|
|||
@Effect inner
|
||||
|
||||
effectAfter : Effect a, (a -> Effect b) -> Effect b
|
||||
effectAfter = \(@Effect thunk), transform -> transform (thunk {})
|
||||
effectAfter = $(@Effect thunk), transform -> transform (thunk {})
|
||||
|
||||
Task a err : Effect (Result a err)
|
||||
|
||||
|
@ -3197,7 +3197,7 @@ fn recursively_build_effect() {
|
|||
hi = "Hello"
|
||||
name = "World"
|
||||
|
||||
"\(hi), \(name)!"
|
||||
"$(hi), $(name)!"
|
||||
|
||||
main =
|
||||
when nestHelp 4 is
|
||||
|
@ -3219,7 +3219,7 @@ fn recursively_build_effect() {
|
|||
always = \x -> @XEffect (\{} -> x)
|
||||
|
||||
after : XEffect a, (a -> XEffect b) -> XEffect b
|
||||
after = \(@XEffect e), toB ->
|
||||
after = $(@XEffect e), toB ->
|
||||
@XEffect \{} ->
|
||||
when toB (e {}) is
|
||||
@XEffect e2 ->
|
||||
|
@ -3953,8 +3953,8 @@ fn compose_recursive_lambda_set_productive_toplevel() {
|
|||
compose = \f, g -> \x -> g (f x)
|
||||
|
||||
identity = \x -> x
|
||||
exclaim = \s -> "\(s)!"
|
||||
whisper = \s -> "(\(s))"
|
||||
exclaim = \s -> "$(s)!"
|
||||
whisper = \s -> "($(s))"
|
||||
|
||||
main =
|
||||
res: Str -> Str
|
||||
|
@ -3976,8 +3976,8 @@ fn compose_recursive_lambda_set_productive_nested() {
|
|||
compose = \f, g -> \x -> g (f x)
|
||||
|
||||
identity = \x -> x
|
||||
exclaim = \s -> "\(s)!"
|
||||
whisper = \s -> "(\(s))"
|
||||
exclaim = \s -> "$(s)!"
|
||||
whisper = \s -> "($(s))"
|
||||
|
||||
res: Str -> Str
|
||||
res = List.walk [ exclaim, whisper ] identity compose
|
||||
|
@ -3998,8 +3998,8 @@ fn compose_recursive_lambda_set_productive_inferred() {
|
|||
compose = \f, g -> \x -> g (f x)
|
||||
|
||||
identity = \x -> x
|
||||
exclaim = \s -> "\(s)!"
|
||||
whisper = \s -> "(\(s))"
|
||||
exclaim = \s -> "$(s)!"
|
||||
whisper = \s -> "($(s))"
|
||||
|
||||
res = List.walk [ exclaim, whisper ] identity compose
|
||||
res "hello"
|
||||
|
@ -4024,8 +4024,8 @@ fn compose_recursive_lambda_set_productive_nullable_wrapped() {
|
|||
else \x -> f (g x)
|
||||
|
||||
identity = \x -> x
|
||||
exclame = \s -> "\(s)!"
|
||||
whisper = \s -> "(\(s))"
|
||||
exclame = \s -> "$(s)!"
|
||||
whisper = \s -> "($(s))"
|
||||
|
||||
main =
|
||||
res: Str -> Str
|
||||
|
@ -4552,7 +4552,7 @@ fn reset_recursive_type_wraps_in_named_type() {
|
|||
Cons x xs ->
|
||||
strX = f x
|
||||
strXs = printLinkedList xs f
|
||||
"Cons \(strX) (\(strXs))"
|
||||
"Cons $(strX) ($(strXs))"
|
||||
"#
|
||||
),
|
||||
RocStr::from("Cons 2 (Cons 3 (Cons 4 (Nil)))"),
|
||||
|
|
|
@ -952,7 +952,7 @@ fn phantom_polymorphic() {
|
|||
zero = Point (@World {}) 0 0
|
||||
|
||||
add : Point a -> Point a
|
||||
add = \(Point c x y) -> (Point c x y)
|
||||
add = $(Point c x y) -> (Point c x y)
|
||||
|
||||
add zero
|
||||
#"
|
||||
|
|
|
@ -577,7 +577,7 @@ fn tuple_length_polymorphism() {
|
|||
b = (1, 2, 44)
|
||||
|
||||
f : (I64, I64)a, (I64, I64)b -> I64
|
||||
f = \(x1, x2), (x3, x4) -> x1 + x2 + x3 + x4
|
||||
f = $(x1, x2), (x3, x4) -> x1 + x2 + x3 + x4
|
||||
|
||||
f a b
|
||||
"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue