Add `deepseq` on the input for `nf` and `whnf`
Open
- Dominant language
- Haskell
- Stars
- 523
- Forks
- 89
- PR merge metrics
- No merged PRs in 30d
Description
This is to ensure that the input evaluation is not involved in the execution of the benchmark.
Here is the patch that I'm suggesting:
```diff
-nf :: NFData b => (a -> b) -> a -> Benchmarkable
-nf f x = toBenchmarkable (nf' rnf f x)
+nf :: (NFData a, NFData b) => (a -> b) -> a -> Benchmarkable
+nf f x = deepseq x (toBenchmarkable (nf' rnf f x))
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.