Weak types ?

From: Pierre CASTERAN (Pierre.Casteran@labri.u-bordeaux.fr)
Date: Tue Feb 03 1998 - 16:46:22 MET


Date: Tue, 3 Feb 1998 16:46:22 +0100 (MET)
Message-Id: <199802031546.QAA21882@scrasmeustache.labri.u-bordeaux.fr>
From: Pierre CASTERAN <Pierre.Casteran@labri.u-bordeaux.fr>
To: caml-list@inria.fr
Subject: Weak types ?

 Hello, all.

 I suppose the following problem concerns "weak" types, but i don't see
 the reason (I have no assignment at all in this definitions !)

let toto =
  let id x = x
  in id id;;
(*
 val toto : '_a -> '_a = <fun>
             ^ ^

             why not " 'a " ?
             
*)

toto 5;;
(* ok *)

toto (fun z -> z);;

(*
This expression has type 'a -> 'a but is here used with type int
*)

If i remember Xavier's works, the "weak" types were necessary for
dealing with references, continuations/exceptions, and i/o streams,....

What's the problem with these gentle purely functional top-level
definitions ?

Pre Scriptum :

 I (still ) work with Objective Caml version 1.03

-- 
Pierre Casteran,

LaBRI, Universite Bordeaux-I | 12 place Puy Paulin 351 Cours de la Liberation | 33000 Bordeaux F-33405 TALENCE Cedex | France France | (+ 33) 5 56 81 15 80 tel : (+ 33) 5 56 84 69 31 fax : (+ 33) 5 56 84 66 69 email: Pierre . Casteran @ labri . u-bordeaux . fr (but whithout white space) www: http://dept-info.labri.u-bordeaux.fr/~casteran

"Combien de petites violences la verité et l'analyse subissent-elles quotidiennement dans le silence de nos pensées engourdies ?"

[Serge Halimi, in "Les nouveaux chiens de garde" (Liber, ed.)]



This archive was generated by hypermail 2b29 : Sun Jan 02 2000 - 11:58:13 MET