🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.functional
Article #457

Re: shuffling a list

#457
From: Nigel Perry
Date: Fri, 07 Sep 1990 08:32
23 lines
1177 bytes
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
Technical Details
Message-ID: <2242@gould.doc.ic.ac.uk>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!uunet!mcsun!ukc!icdoc!doc.ic.ac.uk!np

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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