@@ -19,11 +19,11 @@ The `Match` method actually does two things:
1919- Matches the input value with the pattern and returns a successful result if the match is successful.
2020- Transforms the input value. The returned result contains the transformed value if it's successful.
2121
22- Since options are not supported natively in C#, a custom type – [ ` MatchResult<T> ` ] ( results.md ) – is used.
22+ Since options are not supported natively in C#, a custom type — [ ` MatchResult<T> ` ] ( results.md ) — is used.
2323
2424The definition of patterns is similar to F#'s active patterns.
2525
26- Descriptions for patterns are not terribly important, but can be useful for debugging. As such, they are optional – if
26+ Descriptions for patterns are not terribly important, but can be useful for debugging. As such, they are optional — if
2727you don't want a pattern to have a description, it should be empty. A pattern's description should never be ` null ` .
2828
2929## Null Values
@@ -59,7 +59,7 @@ All methods for getting predefined patterns are overloaded to take a custom desc
5959The ` Matchmaker.Linq ` namespace provides several extension methods for patterns:
6060
6161- ` Select ` maps a pattern's result value if it's successful.
62- - ` Pipe ` creates a pattern pipeline – the result of the first pattern is the input of the second pattern.
62+ - ` Pipe ` creates a pattern pipeline — the result of the first pattern is the input of the second pattern.
6363- ` Cast ` casts a pattern's result to a specified type. It's the same as piping a pattern to the ` Type ` pattern. If the
6464input is ` null ` , then the match will fail only if the destination type is a non-nullable value type.
6565- ` Bind ` flat-maps a pattern's result. If a pattern's result is successful, it calls the specified function and passes
@@ -70,7 +70,7 @@ result is the final result.
7070the input if successful.
7171- ` Compose ` is the same as the three methods above, but the composition operator is passed to it as well.
7272- ` Cached ` returns a pattern which matches the same as the specified pattern but caches its results in a ` null ` -safe
73- hash table. Every input will be matched only once – if it's matched again, the result will be taken from the cache. The
73+ hash table. Every input will be matched only once — if it's matched again, the result will be taken from the cache. The
7474caching process is not thread-safe.
7575
7676All extension methods for patterns are overloaded to take a custom description.
@@ -82,10 +82,10 @@ a combination of the Reader and Maybe monads.
8282
8383## Immutability
8484
85- Every predefined pattern as well as patterns returned by the ` CreatePattern ` and extension methods are immutable.
86- Calling an extension method on a pattern returns a new pattern – the old one is unchanged.
85+ All predefined patterns, as well as patterns returned by ` CreatePattern ` and extension methods, are immutable. Calling
86+ an extension method on a pattern returns a new pattern — the old one is unchanged.
8787
88- An exception is the pattern returned by the ` Cached ` method, which is not immutable – it holds a mutable cache. But if a
88+ An exception is the pattern returned by the ` Cached ` method, which is not immutable — it holds a mutable cache. But if a
8989pattern is referentially transparent (its ` Match ` method always returns the same result for the same input and doesn't
9090have any side effects), then the caching pattern based on it can be thought of as immutable as well, because it doesn't
9191matter how many times the base pattern's ` Match ` method is called.
@@ -109,7 +109,7 @@ There are also overloads which take a description.
109109
110110If you want something more complex than a single function, you can create a class which extends the
111111` Matchmaker.Patterns.Pattern<TInput, TMatchResult> ` class. This is a base class for patterns, and it implements the
112- ` Description ` property which you don't have to use if you don't want – by default the description is empty, which means
112+ ` Description ` property which you don't have to use if you don't want — by default the description is empty, which means
113113that the pattern doesn't have a description.
114114
115115You can also implement the ` IPattern<TInput, TMatchResult> ` interface directly. There is no reason to do that instead of
0 commit comments