From 399bbb80cdc73e3d7ba40a7c112c609e9194c61b Mon Sep 17 00:00:00 2001 From: Zandbee Date: Mon, 13 Feb 2017 18:45:54 +0300 Subject: [PATCH] Update Getting_Started.md --- docs/Getting_Started.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/Getting_Started.md b/docs/Getting_Started.md index 827db1b2..121bb41c 100644 --- a/docs/Getting_Started.md +++ b/docs/Getting_Started.md @@ -77,8 +77,7 @@ So what’s to notice here, in this new program? Well, the parser for "number" l * Doesn't have a .r because it isn't a regular expression (it's a combinator). * Returns instances of `Parser[WordFreq]`, so the function to the right hand side of the `^^` operator had better return instances of the composite type `WordFreq`. * Combines the "word" rule with the "number" rule. It uses the `~` (tilde) combinator to say "you have to match a word first, and then a number". The tilde combinator is the most common combinator for rules that don't involve regular expressions. - -Uses a pattern match on the right side of the rule. Sometimes these match expressions are complex but many times they are just echoes of the rule on the left hand side. In that case, all it really does is gives names to the different elements of the rule (in this case "wd" and "fr") so that we can operate on those elements. In this case, we use those named elements to construct the object we are interested in. But there are also cases where the pattern match is not an echo of the left hand side. Those cases may arise when parts of the rule are optional, or when there are very specific cases to match. For instance, if we wanted to perform special handling in the case where fr was exactly 0. For that, we could have added the case: +* Uses a pattern match on the right side of the rule. Sometimes these match expressions are complex but many times they are just echoes of the rule on the left hand side. In that case, all it really does is gives names to the different elements of the rule (in this case "wd" and "fr") so that we can operate on those elements. In this case, we use those named elements to construct the object we are interested in. But there are also cases where the pattern match is not an echo of the left hand side. Those cases may arise when parts of the rule are optional, or when there are very specific cases to match. For instance, if we wanted to perform special handling in the case where fr was exactly 0. For that, we could have added the case: ``` case wd ~ 0 ```