Skip to content

Commit

Permalink
Merge pull request #221 from roc-lang/format-update
Browse files Browse the repository at this point in the history
new format Result/main.roc
  • Loading branch information
Anton-4 authored Dec 2, 2024
2 parents cb0b815 + a3df108 commit 0630231
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions examples/Results/main.roc
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,15 @@ parseWithTryOp = \line ->
parseWithTryOpV2 = \line ->
{ before: fullName, after: birthYearStr } =
line
|> Str.splitFirst " was born in "
|> Result.mapErr? \_ -> Err InvalidRecordFormat
|> Str.splitFirst " was born in "
|> Result.mapErr? \_ -> Err InvalidRecordFormat
{ before: firstName, after: lastName } =
fullName
|> Str.splitFirst " "
|> Result.mapErr? \_ -> Err InvalidNameFormat
|> Str.splitFirst " "
|> Result.mapErr? \_ -> Err InvalidNameFormat
birthYear =
Str.toU16 birthYearStr
|> Result.mapErr? \_ -> Err InvalidBirthYearFormat
|> Result.mapErr? \_ -> Err InvalidBirthYearFormat
Ok { firstName, lastName, birthYear }

## This function parses a string using a given parser and returns a string to
Expand Down
6 changes: 3 additions & 3 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0630231

Please sign in to comment.