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: Re: [Caml-list] Depend-type beginner question
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2007-10-05 (16:46)
From: olsongt@v...
Subject: Re: Re: [Caml-list] Depend-type beginner question
> > The type system is not rich enough to distinguish between 0-lists'  
> > and 1-list's. It is just a list.
> So what is the gain ?

I'm not sure about the actual implementation, but in theory a list is something like:

type 'a list = Nil | Cons of 'a * 'a list

[] and [a]  and h :: t are just syntactic sugar.

So lists don't even know their own length internally, unlike an array.