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
Preferred Way to Split a List
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Matthew William Cox <matt@m...>
Subject: Re: [Caml-list] Preferred Way to Split a List
On Mon, Oct 29, 2007 at 06:33:11PM -0500, Robert Fischer wrote:
> What is the preferred way to split a list into two, at an arbitrary point?  
> There's lots of ways you could do it, but I'm not sure if there's a 
> standard best practice for this.
That's the thing, there are lots of best ways. Which is the best depends
on what properties your list-splitter needs.

Do you need to preserve ordering in the sublists? Do they need to be
roughly equivalent lengths? Elaborating on these requirements will guide
your search.