haskell-cafe@haskell.org
[Top] [All Lists]

Re: [Haskell-cafe] type families and type signatures

Subject: Re: [Haskell-cafe] type families and type signatures
From: Manuel M T Chakravarty
Date: Fri, 11 Apr 2008 14:26:12 +1000
Lennart Augustsson:
On Thu, Apr 10, 2008 at 4:20 AM, Manuel M T Chakravarty <chak@xxxxxxxxxxxxxxx > wrote:
Lennart Augustsson:

On Wed, Apr 9, 2008 at 8:53 AM, Martin Sulzmann <martin.sulzmann@xxxxxxxxx > wrote:

Lennart, you said

(It's also pretty easy to fix the problem.)

What do you mean? Easy to fix the type checker, or easy to fix the program by inserting annotations
to guide the type checker?

Martin

I'm referring to the situation where the type inferred by the type checker is illegal for me to put into the program. In our example we can fix this in two ways, by making foo' illegal even when it has no signature, or making foo' legal even when it has a signature.

To make it illegal: If foo' has no type signature, infer a type for foo', insert this type as a signature and type check again. If this fails, foo' is illegal.

That would be possible, but it means we have to do this for all bindings in a program (also all lets bindings etc).

Of course, but I'd rather the compiler did it than I. It's not that hard, btw. If the whole module type checks, insert all signatures and type check again.

Sure. I did not argue against this. I think it would be a reasonable way forward.

Manuel

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@xxxxxxxxxxx
http://www.haskell.org/mailman/listinfo/haskell-cafe

<Prev in Thread] Current Thread [Next in Thread>