Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] Why must types be always defined at the top level?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2004-06-24 (14:27)
From: John Hughes <jfh@c...>
Subject: RE: [Caml-list] Why must types be always defined at the top level?

As I revise my course notes from SML/NJ to OCaml, I find myself asking
some design questions --- "Why did they do it THIS way?". I should
probably ask "Why is this way the right way to do it, regardless of 
the original motivation?," but let's assume the answers are the same. 

1. Why no eqtypes? The idea of having the type-checker verify that you
weren't doing equality testing on non-equality-testable types seemed 
like GOOD thing in SML, and I was surprised to see it gone. 

2. Why no "end" on "let" expressions, i.e., 

 let a = 3 and b = 2 in a + b;;

rather than 

 let a = 3 and b = 2 in a + b end; ?

3. Why semicolons for separating list items, so that 

  [2,3] is interpreted as [(2,3)] ? 

4. Why expose the hardware with float (and make it have equality
testing) rather than continue with "real" (which was not an eqtype, if
I recally correctly)? 


I'm sure these were all good decisions, but I'd like to better

-John Hughes

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: