Deprecate .:? and add notes to .:! and .!= about use #64
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this pull request do?
Closes #63 by deprecating the
.:?
operator and updating documentation to steer folks away from.:!
and.!=
except in the (seemingly quite rare) case in which their behavior is desired rather than the behavior of.:
for itsMaybe
instance.#63 describes why
.:?
is unnecessary, and #47 and #32 describe why it was introduced in the first place and why.:!
should not be promoted as the most common way to decode an optional field.#63 also describes why
.!=
is unnecessary when using.:
to get fields; I would like to have deprecated it in this pull request, but it is still useful when using.:!
, so I've kept it in.I did add a note about it only being required with
.:!
and not with.:
, where the better<|> pure default
can be used instead. I would like to promote using<|>
instead because it's a natural step from there to realize you can supply multiple ways to parse a field and only take the first successful decoded value.Where should the reviewer start?
All code changes are in
Decode
, and the tests have updated to use the new operators.Other Notes:
The project tutorial should be updated to introduce
<|> pure default
earlier, rather than introducing.!=
first.