caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Type annotations
@ 2000-12-14 14:12 Ohad Rodeh
  2000-12-15  2:25 ` Jacques Garrigue
  2000-12-21 12:50 ` Ref syntax Ohad Rodeh
  0 siblings, 2 replies; 15+ messages in thread
From: Ohad Rodeh @ 2000-12-14 14:12 UTC (permalink / raw)
  To: Caml List

Dear List, 
  I've previously sent a message, for which I got no replies, so
I'm resending it. 

> ... stuff removed ...
> 
> > Also, I am a bit curious why it doesn't help to type explicitely,
> > i.e. to
> > write
> > let x:point_3d={x=10.;y=20.;z=30.} ???
> > 
> 
> Because this is not the way it works. Labels are defined as are values
> or constructors, this is only afterwards that the compiler checks that
> they all belong to the same type. That is, the type cannot influence the
> choice between x(point_3d) and x(point_2d), only the order of
> definition can.
> 
> There has been already various proposals for allowing types to be taken
> into account when typing record labels. The difficulty is that as soon
> as you make it into something useful, you loose the principal type
> property, and that some theoreticians working on ocaml wouldn't like
> it.

The loss of the pricipal type theorem has also recently been discussed in
comp.lang.ml and comp.lang.functional. Using type-annotation by the
compiler prior (call this the PRIOR approach) to unification can help
typing expression that cannot be typed otherwise. For example, cases of
polymoriphic recursion. In fact, this is the way this is handled in
Haskell (this topic has also appeared in this list previously). 
Although I wouldn't go running to implement all my code in Haskell :-), I
do think that using PRIOR could be an improvement. 

Is there a problem with PRIOR? 

	Ohad.




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

end of thread, other threads:[~2000-12-25 21:58 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-12-14 14:12 Type annotations Ohad Rodeh
2000-12-15  2:25 ` Jacques Garrigue
2000-12-21 12:50 ` Ref syntax Ohad Rodeh
2000-12-22  3:29   ` Jacques Garrigue
2000-12-22  8:45     ` Sven LUTHER
2000-12-23  0:30       ` John Prevost
2000-12-22  9:07     ` Pierre Weis
2000-12-22  9:30       ` Jacques Garrigue
2000-12-22 14:22         ` Pierre Weis
2000-12-22 19:24       ` Marcin 'Qrczak' Kowalczyk
2000-12-22  9:17     ` Pascal Brisset
2000-12-23  0:37       ` John Prevost
2000-12-22 16:40   ` Marcin 'Qrczak' Kowalczyk
2000-12-23  0:39     ` John Prevost
2000-12-25 21:58       ` Pierre Weis

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).