[Haskell-cafe] Generating random arguments for a function

Roman Cheplyaka roma at ro-che.info
Sun Jan 13 10:28:50 CET 2013


* Stephen Tetley <stephen.tetley at gmail.com> [2013-01-13 08:49:08+0000]
> In general you can't do this whether you use pats of QuickCheck or not
> - `randomEvalute` would need to inspect the supplied function to see
> how many input parameters it has so it can list them, but there is no
> such introspection in Haskell.

This can be done with relatively simple type class hackery. In fact,
QuickCheck already does that in order to generate arguments and print
them in case of failure.

Roman



More information about the Haskell-Cafe mailing list