caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Typechecking madness
@ 2004-03-01 14:18 Alex Baretta
  2004-03-03  8:16 ` Jacques Garrigue
  0 siblings, 1 reply; 4+ messages in thread
From: Alex Baretta @ 2004-03-01 14:18 UTC (permalink / raw)
  To: Ocaml

I'm sure the typechecker knows what he's doing, but the following error 
message does look strange.

This expression has type
   'a. (('a Pxp_document.node #Pxp_document.extension as 'a) -> unit) -> 
unit
but is here used with type
   'b. (('b Pxp_document.node #Pxp_document.extension as 'b) -> unit) -> 
unit

Is this due to the two '#' signs on Pxp_document.extension, yielding two 
different ellipsis type variables?

Alex

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Caml-list] Typechecking madness
  2004-03-01 14:18 [Caml-list] Typechecking madness Alex Baretta
@ 2004-03-03  8:16 ` Jacques Garrigue
  2004-03-03 15:19   ` Mikael Brockman
  0 siblings, 1 reply; 4+ messages in thread
From: Jacques Garrigue @ 2004-03-03  8:16 UTC (permalink / raw)
  To: alex; +Cc: caml-list

From: Alex Baretta <alex@baretta.com>
> I'm sure the typechecker knows what he's doing, but the following error 
> message does look strange.
> 
> This expression has type
>    'a. (('a Pxp_document.node #Pxp_document.extension as 'a) -> unit) -> 
> unit
> but is here used with type
>    'b. (('b Pxp_document.node #Pxp_document.extension as 'b) -> unit) -> 
> unit
> 
> Is this due to the two '#' signs on Pxp_document.extension, yielding two 
> different ellipsis type variables?

Indeed, this is a strange error message.
As far as I can see, it really says "This expression has type t but is
here used with type t". 'a and 'b are bound variables, so the ellipsis
is not the problem.
Even if the type checking is correct in detecting a type error, this
is not a valid error message.
Can you send me a sufficiently small program exhibiting this
behaviour?

        Jacques Garrigue

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Caml-list] Typechecking madness
  2004-03-03  8:16 ` Jacques Garrigue
@ 2004-03-03 15:19   ` Mikael Brockman
  2004-03-04 11:48     ` Alex Baretta
  0 siblings, 1 reply; 4+ messages in thread
From: Mikael Brockman @ 2004-03-03 15:19 UTC (permalink / raw)
  To: caml-list

Jacques Garrigue <garrigue@kurims.kyoto-u.ac.jp> writes:

> From: Alex Baretta <alex@baretta.com>
> > I'm sure the typechecker knows what he's doing, but the following error 
> > message does look strange.
> > 
> > This expression has type
> >    'a. (('a Pxp_document.node #Pxp_document.extension as 'a) -> unit) -> 
> > unit
> > but is here used with type
> >    'b. (('b Pxp_document.node #Pxp_document.extension as 'b) -> unit) -> 
> > unit
> > 
> > Is this due to the two '#' signs on Pxp_document.extension, yielding two 
> > different ellipsis type variables?
> 
> Indeed, this is a strange error message.
> As far as I can see, it really says "This expression has type t but is
> here used with type t". 'a and 'b are bound variables, so the ellipsis
> is not the problem.
> Even if the type checking is correct in detecting a type error, this
> is not a valid error message.

Actually, the first expert FAQ [1] addresses a (valid) such error
message.  Briefly, this kind of error occurs when you have defined two
types with the same name, which is easy to do when you're using the
REPL.

> Can you send me a sufficiently small program exhibiting this
> behaviour?
> 
>         Jacques Garrigue
> 
> -------------------
> To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
> Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners

Footnotes: 
[1] http://caml.inria.fr/FAQ/FAQ_EXPERT-eng.html#message_incomprehensible

(Sorry, Jacques, for sending you this message once in private.  I keep
expecting R in Gnus to reply to the list. :-))

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Caml-list] Typechecking madness
  2004-03-03 15:19   ` Mikael Brockman
@ 2004-03-04 11:48     ` Alex Baretta
  0 siblings, 0 replies; 4+ messages in thread
From: Alex Baretta @ 2004-03-04 11:48 UTC (permalink / raw)
  To: Mikael Brockman, ocaml

Mikael Brockman wrote:
> Jacques Garrigue <garrigue@kurims.kyoto-u.ac.jp> writes:
> 
> 
>>From: Alex Baretta <alex@baretta.com>

>>>This expression has type
>>>   'a. (('a Pxp_document.node #Pxp_document.extension as 'a) -> unit) -> 
>>>unit
>>>but is here used with type
>>>   'b. (('b Pxp_document.node #Pxp_document.extension as 'b) -> unit) -> 
>>>unit

>>Even if the type checking is correct in detecting a type error, this
>>is not a valid error message.
> 
> 
> Actually, the first expert FAQ [1] addresses a (valid) such error
> message.  Briefly, this kind of error occurs when you have defined two
> types with the same name, which is easy to do when you're using the
> REPL.
> 

Allow me to point out that I was not using the toplevel (REPL, as you 
call it); rather I was compiling a PXP document transformation with the 
toplevel. There actually was a type error in my code, and I did manage 
to figure it out. The error message did not really help, though.

Alex

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-03-04 11:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-03-01 14:18 [Caml-list] Typechecking madness Alex Baretta
2004-03-03  8:16 ` Jacques Garrigue
2004-03-03 15:19   ` Mikael Brockman
2004-03-04 11:48     ` Alex Baretta

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).