Version française
Home     About     Download     Resources     Contact us    
Browse thread
how can I express empty element?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Laurent Le Brun <laurentlb@g...>
Subject: Re: [Caml-list] how can I express empty element?
On Mon, Mar 9, 2009 at 2:14 PM, AUGER Cedric <sedrikov@gmail.com> wrote:
> David Rajchenbach-Teller wrote:
>>
>> No, that's not possible. :: is an algebraic constructor, which means,
>> among other things, that it accepts no neutral element (well, except
>> when the list is infinite, but that's probably not what you're looking
>> for).
>
> And even if the list is infinite, I don't see any way to do it;

let rec li = 1 :: li

1 can be considered as a neutral element, since li = 1 :: li (of
course, the "=" function doesn't return, but the two lists have the
same elements).

-- 
  Laurent