Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!uunet!mcsun!ukc!icdoc!doc.ic.ac.uk!np From: np@doc.ic.ac.uk (Nigel Perry) Newsgroups: comp.lang.functional Subject: Re: shuffling a list Message-ID: <2242@gould.doc.ic.ac.uk> Date: 7 Sep 90 08:32:23 GMT Sender: np@doc.ic.ac.uk Reply-To: np@doc.ic.ac.uk (Nigel Perry) Organization: Dept. of Computing, Imperial College, London, UK. Lines: 23 Douglas originally said something like "in Scheme I'd list->vector, shuffle, vector->list", why not do this in a FL? Hope+C code: dec shuffle : list(alpha) -> list(alpha); --- shuffle l <= vectortolist(shuffle_vector listtovector(l)) where shuffle_vector is your favorite vector shuffling algorithm (Hope+C provides map_vector & perm_vector H.O. functions to help you with these.) Now all we need is the Haskell solution.... Nigel --- Nigel Perry Department of Computing Imperial College Janet: np@uk.ac.ic.doc London ARPA: np%uk.ac.ic.doc@ucl-cs SW7 Uucp: np@icdoc.UUCP, ukc!icdoc!np England