Skip to content

Alternative usage of random #84

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

Merged
merged 2 commits into from
Jun 30, 2025
Merged

Alternative usage of random #84

merged 2 commits into from
Jun 30, 2025

Conversation

lehins
Copy link
Member

@lehins lehins commented Jun 27, 2025

Also implement support for random-1.3

This is an equivalent approach in the sense of semantics, but very different in how it is achieved.

Instead of defining CapGenM this PR utilizes an existing StateGenM provided by random package. The two things that were missing in order for us to be able to use StateGenM was missing instances:

  1. MonadState (from mtl) for M
  2. and RandomGen for GenState

I am not sure whether others will find this approach cleaner or easier to understand, but if we want to continue using the older approach, then #85 implements support for random-1.3 that also includes one of the simplifications present in this PR, namely removal of fakeSeed

@lehins lehins requested a review from nc6 June 27, 2025 20:22
@lehins
Copy link
Member Author

lehins commented Jun 27, 2025

@nc6 I think this PR might be of interest to you. I'd also appreciate your feedback if you do find time to provide it. 😉

@lehins lehins mentioned this pull request Jun 27, 2025
@lehins lehins force-pushed the lehins/simplify-random-usage branch from dfa86b9 to 988ab2f Compare June 27, 2025 22:22
@lehins lehins force-pushed the lehins/simplify-random-usage branch from 988ab2f to 6474b8c Compare June 27, 2025 22:25
Copy link
Collaborator

@nc6 nc6 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks nice, really good simplification

@lehins lehins force-pushed the lehins/simplify-random-usage branch from 6474b8c to c30a073 Compare June 30, 2025 22:08
@lehins lehins merged commit adcc5e8 into master Jun 30, 2025
5 checks passed
@lehins
Copy link
Member Author

lehins commented Jun 30, 2025

CC @jasagredo random-1.3.0 support is ready and merged, in case you do need it.

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 this pull request may close these issues.

3 participants