[Haskell-cafe] Test cases for type inference
jvranish at gmail.com
Wed Oct 21 10:47:00 EDT 2009
I was recently working on an type inference algorithm and to test it I did
Used the quickcheck Arbitrary typeclass to generate expressions
Inferred types of the expressions using my algorithm,
converted the expressions that passed inference to haskell and wrote them
to a file (without type signatures)
converted and wrote the failed expression to a separate file
compiled the "passed" file with -Wall, and extracted all the type
signatures that were spit out as warnings
parsed the type signatures that -Wall spit out and compare with the
signatures generated by my algorithm.
compiled the "failed" file and make sure I get type errors for all my
My algorithm also infers infinite types (which haskell does not) so I had to
test that functionality manually.
Overall it was kinda messy, but it worked ok.
I could possibly send you one of my lists. My test expressions are all very
simple, no type classes, only 2 types (function and number), and the only
expression components are let, lambda, apply, identifier, and number. If
something like that would work, let me know.
Hope that helps,
On Tue, Oct 20, 2009 at 10:07 AM, Peter Verswyvelen <bugfact at gmail.com>wrote:
> For learning, I would like to develop my own implementation of type
> inference, based on the paper "Typing Haskell in Haskell".
> At first sight, the source code of THIH contains a small number of
> tests, but I was wandering if a large test set exist?
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe