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
recursive datatypes
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 1997-11-12 (07:23)
From: Simon Helsen <helsen@i...>
Subject: recursive datatypes
Why does Caml type-check the following program? It wouldn't in Standard ML
and I don't see the use for it, as it may lead to infinite programs...

(I don't have a french keyboard)

Pourquoi est le programme ci-desous bon type ? C'est ne pas le
cas en Standard ML et je ne comprend pas l'usage pour ca parce que le
programme peut eventuellement cours a l'infini... 

type 'a tree = Tree of 'a

let f x = Tree (f x)

----------------------- Simon Helsen ------------------------ 
--       Wilhelm-Schickard-Institut fuer Informatik        --
--           Arbeitsbereich Programmierung (PU)            --
--            Universitaet Tuebingen, Germany              --
-- --