ghci feature request: partially read modules

Stefan O'Rear stefanor at cox.net
Sat Feb 16 13:13:42 EST 2008


On Sat, Feb 16, 2008 at 06:58:29PM +0100, Johannes Waldmann wrote:
> Sure.
> 
> Syntax errors are usually easy to spot and fix
> (for the programmer who uses some reasonable code layout);
> the motivation for my proposal was type errors.
> 
> I think it would be perfectly acceptable
> if ghci rejects modules with parse errors (as it does now)
> but handles modules with type errors more gracefully.
> 
> Since type checking a group of declarations (= a module)
> often considers all declarations at the same time,
> there may be no sensible way to proceed after a type error.
> 
> Then it would even be OK
> to not bind any of the identifiers of the module,
> as long as the import declarations are available at ghci prompt.
> (This would still be an improvement over the present situation.)

Implementing Haskell polymorphism requires that the functions be sorted
into dependancy groups, so that undepended definitions can be
generalized.  Example:

foo x = 2
bar = foo 'a' + foo True


If this were typechecked all at once (using the standard Damas-Milner
algorithm) you would get a "cannot match Bool to Char" type error.

Stefan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://www.haskell.org/pipermail/glasgow-haskell-users/attachments/20080216/f5076397/attachment.bin


More information about the Glasgow-haskell-users mailing list