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
Re: [Caml-list] Weird typing problem
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2002-05-22 (00:14)
From: Ryan Tarpine <rtarpine@h...>
Subject: Re: [Caml-list] Weird typing problem
>From: Ching-Tsun Chou <>
>Subject: Re: [Caml-list] Weird typing problem
>Date: Tue, 21 May 2002 16:58:32 -0700 (PDT)
>Why can't the compiler just substitute 'a for '_a if '_a can't be
>resolved?  What's wrong with that?  Surely O'Caml can handle
>- Ching Tsun

See  In short, 
(quoted from the FAQ)

When type-checking
  let name = expr1 ...
The type of expr1 is generalized when expr1 is a function, an dentifier or a 
constant. Otherwise the identifier name is not polymorphic (type variables 
are not generalized).
The new rule implies that if expr1 is a function application, then the 
identifier name is monomorphic

This is done because "a secure type system for Caml must forbid the 
existence of polymorphic mutable values at run-time" and this was basically 
the easiest way to do it.  Read the FAQ for an example.


Ryan Tarpine,
"To err is human, to compute divine.  Trust your computer but not its 
  - Morris Kingston

Send and receive Hotmail on your mobile device:

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