-
-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
25 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 10 additions & 7 deletions
17
src/content/chapter3_data_types/lesson04_record_pattern_matching/en.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,15 @@ | ||
<p> | ||
It is possible to pattern match on a record, this allows for the extraction | ||
of multiple field values from a record into distinct variables, similar to matching on a tuple or a list. | ||
It is possible to pattern match on a record, this allows for the extraction of | ||
multiple field values from a record into distinct variables, similar to | ||
matching on a tuple or a list. | ||
</p> | ||
<p> | ||
The <code>let</code> keyword can only match on single variant custom types. For types with more variants | ||
a case expression must be used. | ||
The <code>let</code> keyword can only match on single variant custom types, or | ||
when the variant is know, such as after pattern matching with a case | ||
expression. | ||
</p> | ||
<p> | ||
It is possible to use underscore <code>_</code> or the spread syntax <code>..</code> to | ||
discard fields that are not required. | ||
</p> | ||
It is possible to use underscore <code>_</code> or the spread syntax | ||
<code>..</code> to discard fields that are not required. | ||
</p> | ||
|