Support `Gen.pick` by analogy to `Seq.pick`
See original GitHub issueSeq.pick
is a very useful function that applies a given “chooser” function to successive elements, returning the first x
where the function returns Some x
. By analogy, I think FsCheck should provide a similar function. Here’s a simple implementation that demonstrates the idea:
let rec pick chooser gn =
gen {
let! value = gn
match chooser value with
| Some v -> return v
| None -> return! pick chooser gn
}
Issue Analytics
- State:
- Created 10 months ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Sequences - F# | Microsoft Learn
A sequence is a logical series of elements all of one type. Sequences are particularly useful when you have a large, ordered collection...
Read more >A Beginner's Guide to Analysis of RNA Sequencing Data - NCBI
A major goal of RNA-seq analysis is to identify differentially expressed and coregulated genes and to infer biological meaning for further ...
Read more >A survey of best practices for RNA-seq data analysis
This is achieved by first defining a good experimental design, that is, by choosing the library type, sequencing depth and number of replicates ......
Read more >RefSeq Frequently Asked Questions (FAQ)
These RefSeq records are derived from the genome sequence and have varying levels of transcript or protein homology support.
Read more >Recommendations for Choosing the Genotyping Method ...
Recommendations for Choosing the Genotyping Method and Best Practices for Quality Control in Crop Genome-Wide Association Studies.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
That’s what I get for asking 😅 That’s not really in my wheelhouse, but in any case it’s hard to suggest alternatives without code.
Sure. I’m working on a compiler that does type inferencing, which relies on a unification algorithm. Two types can be unified if there is a substitution that can be applied to both types to make them equal. My unit test generates pairs of types that can be unified and then verifies that the substitution does indeed produce equal types. I don’t know how to do this constructively (i.e. without filtering), but I’m certainly open to suggestions.