Skip to content
This repository has been archived by the owner. It is now read-only.

Removing Fuzz.andThen #183

Open
wants to merge 6 commits into
base: master
from
Open

Conversation

@jwoudenberg
Copy link
Collaborator

jwoudenberg commented Jul 1, 2017

Resolves #160 and #161.

This removes Fuzz.andThen making it a breaking change.
It also fixes two points @mgold alluded to before:

  • the Fuzzer type is wrapped in a type instead of being a type alias to prevent people from casing on it. This is not a major change according to elm-package but it is to a user who for some reason is casing on the fuzzer now, so it makes sense to me to bundle the change in here.
  • Move the last two functions in Fuzz.Internal over to Fuzz.

Some things I think should be wrapped up before merging this:

  • Make solutions for users using andThen for building recusive fuzzers or Msg fuzzers presentable, either by publishing them in a library or linking to them as a sort of cookbook.
  • Consider if there's other breaking changes that should be bundled with this change. Personally, I'd like to change Test.Runner.fuzz so it doesn't need a Debug.crash anymore (the last in the codebase).
jwoudenberg added 4 commits Jul 1, 2017
It allows user to case on it using the `Ok` and `Err` instructors, which
would make their tests dependant on the `Fuzzer` implementation.

elm-package doesn't consider this a major change, but it is one to users
who were doing this type of pattern matching.
It's sole purpose now is containing the hidden internal type of the Fuzzer,
like before.
@jwoudenberg
Copy link
Collaborator Author

jwoudenberg commented Jul 9, 2017

From my perspective this is ready to merge but of course happy to make adjustments!

@rtfeldman
Copy link
Member

rtfeldman commented Jul 9, 2017

Love it! Looks good to me!

@@ -373,18 +374,15 @@ type Shrinkable a
{-| Given a fuzzer, return a random generator to produce a value and a
Shrinkable. The value is what a fuzz test would have received as input.

This comment has been minimized.

@mgold

mgold Jul 9, 2017 Member

Let's add a comment saying why there is a Result in the return type.

This comment has been minimized.

@jwoudenberg

jwoudenberg Jul 9, 2017 Author Collaborator

Good point. Something like this?

This comment has been minimized.

@mgold

mgold Jul 9, 2017 Member

Yup, much better.

@mgold
Copy link
Member

mgold commented Jul 9, 2017

This looks good to me. I'm sorting through upcoming changes and don't want breaking API on master right this moment though.

@mgold mgold mentioned this pull request Jul 9, 2017
6 of 11 tasks complete
@rtfeldman
Copy link
Member

rtfeldman commented Jul 9, 2017

@mgold
Copy link
Member

mgold commented Aug 1, 2017

Tagging major-release-blocker so we don't forget about this. Merge conflicts suck but I don't think it's worth resolving them now is we're still not ready to merge. Merging onto a breaking branch will just give us conflicts later.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

3 participants
You can’t perform that action at this time.