
Thanks Job & Martijn for the feedback.
I would like to write a type inferrer that is mostly Haskell 98 with
Trex row polymorphism extensions (a bit like CAL I guess).
That will certainly take a while because I'm also studying the theory
in my spare time.
So as soon as (or if) I have something working, I will need a larger
set of tests.
So Job, no need to do put any effort in preparing test sets, but I
highly appreciate your offer.
Cheers,
Peter
On Wed, Oct 21, 2009 at 4:47 PM, Job Vranish
I was recently working on an type inference algorithm and to test it I did the following: 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 expressions
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,
- Job
On Tue, Oct 20, 2009 at 10:07 AM, Peter Verswyvelen
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?
Thanks, Peter _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe