[Haskell-cafe] Polymorphic QuickCheck arguments

Hugo Pacheco hpacheco at gmail.com
Tue Jun 17 05:53:49 EDT 2008


Hi all,
There is something about polymorphic tests in QuickCheck that I do not
understand.

If you write the simplest dummy test function

tst :: a -> Bool
tst _ = True

and evaluate it we get

> verboseCheck tst
0:
()
1:
()
...

How come did the polymorphic value a get instanciated to ()? Is this done
via the Testable type class?
Could someone please explain this to me? I'm not saying it does not make
sense, but I would like to understand how it works. Being possible to change
this behavior, this is, assign another "default type" whenever polymorphic
types occur, would be awesome.

Cheers,
hugo

-- 
www.di.uminho.pt/~hpacheco
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20080617/7d73a998/attachment.htm


More information about the Haskell-Cafe mailing list