Skip to content

Move Test.QuickCheck.Gen to seperate repo? #104

Open

Description

@safareli

There are cases when you need to random values and the Gen monad will be handy in that case. It would be great if the Test.QuickCheck.Gen monad was published as purescript-lcg-gen (as Random.LCG.Gen) or something and reexported from Test.QuickCheck.Gen for compatibility reasons.

If this seams desirable please create a repo and will volunteer with PRs

Activity

  1. garyb commented on Apr 24, 2020

    @garyb
    Member

    I don't think this needs to have anything to do with quickcheck, it seems what you're asking about is just a stateful MonadGen instance that is not Gen?

  2. safareli commented on Apr 24, 2020

    @safareli
    ContributorAuthor

    The stateful MonadGen instance which i'm asking is already implemented here as Gen.

    I think about renaming Test.QuickCheck.Gen to Random.LCG.Gen and move it in a repo purescript-lcg-gen

  3. hdgarrood commented on Apr 26, 2020

    @hdgarrood
    Contributor

    There's not really very much left in this library if you take Test.QuickCheck.Gen out. Is there a problem with depending on quickcheck?

  4. garyb commented on Apr 26, 2020

    @garyb
    Member

    It would still provide Arbitrary, Coarbitrary, the results and reporting stuff, etc.

    I think if we were to make a separate library we'd want it to be GenT too, as being restricted to Gen might not be that useful in a non-test-context, since you can't do Effectful things without GenT.

  5. milesfrain commented on Jul 5, 2020

    @milesfrain

    Is there a problem with depending on quickcheck?

    It's a discoverability problem.

    If you just need to generate random data, but aren't using this data for testing purposes, then it's easy to assume that quickcheck is the wrong library for that job.

    There's not really very much left in this library if you take Test.QuickCheck.Gen out.

    I think small libraries are fine.

  6. thomashoneyman commented on Dec 17, 2020

    @thomashoneyman
    Member

    Is there any interest in doing this as part of the 0.14 library updates? Otherwise, we can reconsider it for 0.15.

  7. JordanMartinez commented on Dec 17, 2020

    @JordanMartinez
    Contributor

    Yes. I would like this to occur, but I'm not sure about others.

  8. hdgarrood commented on Dec 18, 2020

    @hdgarrood
    Contributor

    I think small libraries are a pain, and rearranging things into separate libraries is a breaking change. I’m not super keen on this.

  9. hdgarrood commented on Dec 18, 2020

    @hdgarrood
    Contributor

    Actually, I suppose the original proposal isn’t necessarily breaking. It would be a bit awkward to indefinitely re-export this new Gen library from Test.QuickCheck.Gen though (for example, any breaking change in our new Gen library would have to imply a breaking change in quickcheck too), so I think we’d want to have a deprecation cycle and then remove it. But my main concern is really that we have too many small libraries at the centre of the ecosystem, and I think the discoverability issue could be mostly solved by writing a half decent blog post called “generating random data in PureScript with quickcheck” or something.

  10. JordanMartinez commented on Dec 18, 2020

    @JordanMartinez
    Contributor

    I think the discoverability issue could be mostly solved by writing a half decent blog post called “generating random data in PureScript with quickcheck” or something.

    There's a lot of truth to this (or even updating this repo's docs / Readme) to state that, so people can find it via Google.

    On another hand, if Gen was extracted from this repo, are there any Quickcheck implementations that depend on Gen specifically (you may have already stated this elsewhere)? In short, if one wanted to swap out a different generator, could they do so easily?

  11. added
    purs-0.15A reminder to address this issue or merge this PR before we release PureScript v0.15.0
    type: breaking changeA change that requires a major version bump.
    on Dec 4, 2021
  12. JordanMartinez commented on Mar 16, 2022

    @JordanMartinez
    Contributor

    This is something I still think should be done.

  13. JordanMartinez commented on Mar 25, 2022

    @JordanMartinez
    Contributor

    Actually, I suppose the original proposal isn’t necessarily breaking. It would be a bit awkward to indefinitely re-export this new Gen library from Test.QuickCheck.Gen though (for example, any breaking change in our new Gen library would have to imply a breaking change in quickcheck too), so I think we’d want to have a deprecation cycle and then remove it. But my main concern is really that we have too many small libraries at the centre of the ecosystem, and I think the discoverability issue could be mostly solved by writing a half decent blog post called “generating random data in PureScript with quickcheck” or something.

    This still doesn't solve the problem of GenT, right?

    As a way forward, here's what I'm proposing that doesn't cause any breaking changes. I can fork this repo, drop all the quickcheck stuff and explore the design space for just GenT. Then I can see in more detail what issues arise if quickcheck did depend on such a library and how that complicates its API surface.
    If things works out, I can transfer the library to the purescript GH org and quickcheck can depend on it. If not, then at least my library enables people to generate things when purposes are not test-related.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    purs-0.15A reminder to address this issue or merge this PR before we release PureScript v0.15.0type: breaking changeA change that requires a major version bump.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions