Version française
Home     About     Download     Resources     Contact us    
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: -- (:)
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.