Skip to content

Commit

Permalink
Replace 'when' with 'if'
Browse files Browse the repository at this point in the history
  • Loading branch information
ageron committed Oct 2, 2024
1 parent 7d61426 commit 815d2ca
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions exercises/practice/octal/.meta/Example.roc
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
module [parse]

parseOctalDigit = \char ->
when char is
c if c >= '0' && c <= '7' -> Ok (c - '0' |> Num.toU64)
_ -> Err InvalidNumStr
if char >= '0' && char <= '7' then
Ok (char - '0' |> Num.toU64)
else
Err InvalidNumStr

parse : Str -> Result U64 _
parse = \string ->
Expand Down

0 comments on commit 815d2ca

Please sign in to comment.