« So, this happened Discerning God's will »

Research proposal

Posted by Simon Welsh | 18 April 2012 | Comments (6)

Explaining Type Errors in Haskell

I propose conducting research into improving the error messages provided by the Haskell type system. This would be done by implementing a different algorithm for the type checking system that provides more information about type errors.

Introduction

This project intends to provide better type failure errors in Haskell, specifically when using the Glasgow Haskell Compiler (GHC), by changing the algorithm used in the type checking system to one capable of conveying more information.

The Problem

The current algorithm used for type checking in GHC, while correct, has a tendency to provide slightly cryptic error messages. These can confuse people learning the Haskell language and make it harder to find the exact source(s) of an error, as the source is likely to only have a minor effect on the line that explicitly causes the error.

The aim of this project is to investigate a possible alternative algorithm for use in GHC and, if it is feasible, implement a version of GHC that uses this algorithm for its type checking.

Proposed Solution

In Explaining Type Inference[1], an algorithm is set forth that collects more accurate type information during the type inference process, allowing for more informative error messages when a type check fails. This project will endeavour to use this algorithm.

To achieve this, I will need to research how the current type checking system in GHC works and if this algorithm has previously been considered instead of the current one. I estimate this will take about two weeks.

Secondly, I will need to research how the Duggan-Bent algorithm[1] may need to be altered to fit in with Haskell’s type system. I estimate this will take between two and four weeks.

Finally, I will need to adapt GHC’s type checking system to use the Duggan-Bent algorithm for its inference, checking and error messages. I envision this will take the remainder of project to complete. Part of this process will involve research into alternative ways of displaying the additional information.

Evaluating your Solution

The solution will be evaluated on its ability to correctly infer and check the types of Haskell programmes, the error messages it produces and its efficiency in relation to the current type check system.

Resource Requirements

At the present time, no extra resources are expected to be required.

Bibliography

[1] D. Duggan and F. Bent, “Explaining type inference,” Science of Computer Programming, vol. 27, no. 1, pp. 37–83, 1996.


Share on FaceBook

Trackbacks

None
Trackback URL: http://simon.geek.nz/Trackbacks/add/1355

Post your comment

Sign in with Twitter

Comments

  • Also, ran out of posts!

    Posted by Caitlin, 14/08/2012 1:19pm (9 months ago)

  • I'll buy you some chocolate if you come collect it.

    Posted by Caitlin, 14/08/2012 1:19pm (9 months ago)

  • Though, http://memphisfridge.interface.org.nz/webfridge/WebFridge.html does suggest that it has 26 chocolates in stock. (And my has Memphis Fridge's stock list decreased.)

    Posted by qwandor, 18/04/2012 3:32pm (1 year ago)

  • Oh dear, what good is a Fridge without chocolate? Perhaps you should talk to the admins and buy some for Fridge?

    Posted by qwandor, 18/04/2012 3:31pm (1 year ago)

  • It probably will. I've never been good at estimates, so I just made some somewhat-beliveable numbers up.

    Fridge doesn't seem to be stocking chocolate at the moment, so I may have to bring in my own supplies.

    Posted by Simon Welsh, 18/04/2012 3:29pm (1 year ago)

  • I estimate that this will take longer than you think. I also expect that extra chocolate will be required.

    Posted by qwandor, 18/04/2012 1:32pm (1 year ago)

RSS feed for comments on this page | RSS feed for all comments