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.
This branch has a new module,
Json.Bidirectional.Fuzzable
, which is an altered version ofJson.Bidirectional
that builds upFuzzer
values from elm-test'sFuzz
module along with theEncoder
andDecoder
. This lets you fuzz values for aCoder
without having to define theFuzzer
yourself. SeeFuzzableTests.elm
to see what this is like in practice – it's very similar toTests.elm
, but the fuzzers are provided automatically by the Coders.The thing is: I'm not sure the best way to offer this functionality. Using these fuzzable Coders in production code means including the
Fuzz
module and its dependencies in your production build. If you don't want that, then you could stick to theJson.Bidirectional
module and not add anything extra to your production build – but having this newFuzz
-dependent module in the same package means thatelm-test 4.x.x
would become a transitive dependency of every app that useselm-json-bidirectional
.I've been trying to figure out a way of having an "extensible" version of
Json.Bidirectional
that could somehow allow you to extend it withFuzzer
-building capability "after the fact", without having a dependency on theFuzz
module itself. I have some ideas, but nothing that would provide comparable ergonomics to what's there right now.My current thinking is to release a completely different package (
elm-json-bidirectional-fuzzable
?) in order to keepelm-json-bidirectional
free of theelm-test
dependency. But I welcome any suggestions!