From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id MAA15095; Sat, 1 May 2004 12:03:43 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id MAA15271 for ; Sat, 1 May 2004 12:03:42 +0200 (MET DST) Received: from aomori.annexia.org (annexia.force9.co.uk [212.56.101.183]) by nez-perce.inria.fr (8.12.10/8.12.10) with ESMTP id i41A3gEV014684 for ; Sat, 1 May 2004 12:03:42 +0200 Received: from rich by aomori.annexia.org with local (Exim 3.36 #1 (Debian)) id 1BJrLR-0002z5-00 for ; Sat, 01 May 2004 11:03:41 +0100 Date: Sat, 1 May 2004 11:03:41 +0100 Cc: caml-list@inria.fr Subject: Re: [Caml-list] "List.index" or "List.unique" functions? Message-ID: <20040501100341.GA11419@redhat.com> References: <20040430175429.GB11118@online.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040430175429.GB11118@online.fr> User-Agent: Mutt/1.5.5.1+cvs20040105i From: Richard Jones X-Miltered: at nez-perce with ID 409375FE.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 2004:99 0400,:01 trotts:01 beginners:01 ltd:98 ocaml:01 int:01 groups:01 wrote:03 library:03 suppose:03 group:04 group:04 functions:05 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Fri, Apr 30, 2004 at 01:54:29PM -0400, Rahul Siddharthan wrote: > I have a question: suppose I have a list l1, and I want to create a new > list l2 with only one copy of any repeated members of the first list > (eg, l1=[1;2;3;4;3;4;5;6;5] -> l2=[1;2;3;4;5;6]) This is actually another function which could be usefully added to the standard library, along with: frequency : 'a list -> (int * 'a) list (requires input list to be sorted) and group_by, defined by Isaac Trotts here: http://groups.yahoo.com/group/ocaml_beginners/message/1556 Rich. -- Richard Jones. http://www.annexia.org/ http://www.j-london.com/ Merjis Ltd. http://www.merjis.com/ - improving website return on investment http://www.YouUnlimited.co.uk/ - management courses ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners