The Great Renaming, Chapter 9: Monadic and applicative operators#379
Merged
jmid merged 3 commits intoc-cube:mainfrom Dec 4, 2025
Merged
The Great Renaming, Chapter 9: Monadic and applicative operators#379jmid merged 3 commits intoc-cube:mainfrom
jmid merged 3 commits intoc-cube:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Having slayed the
intdragon, we are left with a only a few less interesting challengesm including the monadic and applicative operators. The current status here is as follows:Observations:
QCheck.GenandQCheck2.Genoffer a monadic and applicative interface with similar operators whereasQCheck.arbitrarydoesn'tbindis missing fromQCheck.Genapmissing fromQCheck.GenQCheck.alwayssticks out - it is an equivalent toreturn/pure. A quick search shows that it is used in Tezos and Goblint.i initially went for adding
alwaysas a third alias to bothQCheck.GenandQCheck2.Genfor consistency, but then regretted and rolled back. My thinking is:QCheck.arbitrarydoesn't and cannot offer a monadic or applicative interface it doesn't make sense to providereturnorpurefor it, as it might confuse more than it helps.alwaysto bothQCheck.GenandQCheck2.Genfor existing functionality doesn't bring any direct value, more likely it will just make it harder to read 3 names for the same thing.Alas, I've gone only with adding the missing
bindandapnames toQCheck.Genresulting in the following:This result is consistent across
QCheck.GenandQCheck2.Gen🤷