Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion package/Base64.roc
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ decode = \str ->
padding_count = List.count_if(chunk4, \c -> c == '=')
chunk4
|> List.map_try(\c -> Dict.get(reverse_base64_index_map, c))
|> Result.map(
|> Result.map_ok(
\l ->
when l is
[six1, six2, six3, six4] ->
Expand Down
6 changes: 3 additions & 3 deletions package/Hex.roc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ byte_to_hex = \byte ->
|> List.get(Num.to_u64(hi))
|> Result.try(
\h ->
List.get(hex_chars, Num.to_u64(lo)) |> Result.map(\l -> Str.concat(h, l)),
List.get(hex_chars, Num.to_u64(lo)) |> Result.map_ok(\l -> Str.concat(h, l)),
)
when result is
Ok(hex) -> hex
Expand Down Expand Up @@ -70,11 +70,11 @@ expect
hex_to_byte : { lo : U8, hi : U8 } -> Result U8 [InvalidHexChar]
hex_to_byte = \{ lo, hi } ->
hex_to_nibble(hi)
|> Result.map(\v -> Num.shift_left_by(v, 4))
|> Result.map_ok(\v -> Num.shift_left_by(v, 4))
|> Result.try(
\hi2 ->
hex_to_nibble(lo)
|> Result.map(\lo2 -> Num.bitwise_or(hi2, lo2)),
|> Result.map_ok(\lo2 -> Num.bitwise_or(hi2, lo2)),
)

expect
Expand Down