Skip to content
Merged
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
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.

Loading