Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FR] - Use classy era constraints in generators. #702

Open
locallycompact opened this issue Dec 6, 2024 · 3 comments · May be fixed by #709
Open

[FR] - Use classy era constraints in generators. #702

locallycompact opened this issue Dec 6, 2024 · 3 comments · May be fixed by #709

Comments

@locallycompact
Copy link
Contributor

In the hedgehog generators we have generators such as

genAddressInEra :: ShelleyBasedEra era -> Gen (AddressInEra era)
genAddressInEra sbe = shelleyAddressInEra sbe <$> genAddressShelley

I think without loss of generality these could all be the type class versions

genAddressInEra :: IsShelleyBasedEra era => Gen (AddressInEra era)
genAddressInEra sbe = shelleyAddressInEra shelleyBasedEra <$> genAddressShelley
@carbolymer
Copy link
Contributor

They're both practically interchangeable. What's the rationale for this change?

@carbolymer carbolymer linked a pull request Dec 30, 2024 that will close this issue
3 tasks
@carbolymer carbolymer linked a pull request Dec 30, 2024 that will close this issue
3 tasks
@locallycompact
Copy link
Contributor Author

The rational is that we are using these generators downstream, and providing the argument, when we want to construct say a validity interval, seems like unnecessary noise when it can be inferred from the era type.

1 similar comment
@locallycompact
Copy link
Contributor Author

The rational is that we are using these generators downstream, and providing the argument, when we want to construct say a validity interval, seems like unnecessary noise when it can be inferred from the era type.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants