haskell / criterion

A powerful but simple library for measuring the performance of Haskell code.
http://www.serpentine.com/criterion
BSD 2-Clause "Simplified" License
501 stars 86 forks source link

Use a more precise type for nfIO' #236

Closed ckoparkar closed 3 years ago

ckoparkar commented 3 years ago

Its first argument is supposed to be a function which reduces the result to normal form. Specifying its type as 'a -> ()', rather than 'a -> b' conveys this intention better. Also, presently nfIO' is an internal function used only by nfIO, which uses 'rnf' as a reducer.

Anyway, this is a really minor thing. I was looking at this file for something and happened to notice this.

RyanGlScott commented 3 years ago

Good catch! nfAppIO' already uses () as the return type for its reduce function, but for whatever reason, nfIO' wasn't doing the same. Let's fix that.