[Haskell-cafe] Haskell extension/improvement

Tom Pledger tpledger at ihug.co.nz
Tue Aug 17 23:20:00 EDT 2004


Ron de Bruijn wrote:

>--- Martin_Sjögren <msjogren at gmail.com> wrote:
>
[...]

>>mapM_ quickCheck [Test prop_revrev, Test
>>prop_trivial, Test prop_something]
>>
>>
>>Regards,
>>Martin
>>
>I didn't expect these replies (including one
>mentioning the HList idea(the enforced ordening is
>nice, though)), while I tried to be precise. The idea
>is that you don't write down the Test constructor in
>any place, because you(that's the compiler) can check
>that all the values you put in the list(or any other
>datastructure) belong to a certain class. Everything
>that can be derived should be derived.
>

(The following is adapted from a message in a previous thread, but I 
forget whose it was.)

If you only wanted to minimise the number of tokens, you could rewrite

    test = quickCheck a >> quickCheck b >> quickCheck c

as

    m & p = m >> quickCheck p    -- reusable
    test = quickCheck a & b & c

which is about as succinct as the list notation.

Regards,
Tom




More information about the Haskell-Cafe mailing list