<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;"><div><font class="Apple-style-span" face="arial" size="2">Reason why this doesn't work?</font></div><div><font class="Apple-style-span" face="arial" size="2"><br></font></div><div><font class="Apple-style-span" face="arial" size="2">Michael</font></div><div><font class="Apple-style-span" face="arial" size="2"><br></font></div><div><font class="Apple-style-span" face="arial" size="2">==========</font></div><div><font class="Apple-style-span" face="arial" size="2"><br></font></div><div><font class="Apple-style-span" face="arial" size="2">[michael@sabal ~]$ cabal install monte-carlo</font></div><div><font class="Apple-style-span" face="arial" size="2">Resolving dependencies...</font></div><div><font class="Apple-style-span" face="arial" size="2">Downloading primitive-0.3.1...</font></div><div><font class="Apple-style-span" face="arial" size="2">Configuring
 primitive-0.3.1...</font></div><div><font class="Apple-style-span" face="arial" size="2">Preprocessing library primitive-0.3.1...</font></div><div><font class="Apple-style-span" face="arial" size="2">Building primitive-0.3.1...</font></div><div><font class="Apple-style-span" face="arial" size="2">[1 of 7] Compiling Data.Primitive.MachDeps ( Data/Primitive/MachDeps.hs, dist/build/Data/Primitive/MachDeps.o )</font></div><div><font class="Apple-style-span" face="arial" size="2">[2 of 7] Compiling Control.Monad.Primitive ( Control/Monad/Primitive.hs, dist/build/Control/Monad/Primitive.o )</font></div><div><font class="Apple-style-span" face="arial" size="2"><br></font></div><div><font class="Apple-style-span" face="arial" size="2">Control/Monad/Primitive.hs:24:1:</font></div><div><font class="Apple-style-span" face="arial" size="2">&nbsp; &nbsp; Warning: Module `GHC.IOBase' is deprecated: use GHC.IO instead</font></div><div><font class="Apple-style-span"
 face="arial" size="2">[3 of 7] Compiling Data.Primitive.Types ( Data/Primitive/Types.hs, dist/build/Data/Primitive/Types.o )</font></div><div><font class="Apple-style-span" face="arial" size="2"><br></font></div><div><font class="Apple-style-span" face="arial" size="2">Data/Primitive/Types.hs:39:30:</font></div><div><font class="Apple-style-span" face="arial" size="2">&nbsp; &nbsp; Warning: In the use of `mkNorepType'</font></div><div><font class="Apple-style-span" face="arial" size="2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;(imported from Data.Data):</font></div><div><font class="Apple-style-span" face="arial" size="2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Deprecated: "Use mkNoRepType instead"</font></div><div><font class="Apple-style-span" face="arial" size="2">[4 of 7] Compiling Data.Primitive.Array ( Data/Primitive/Array.hs, dist/build/Data/Primitive/Array.o )</font></div><div><font class="Apple-style-span" face="arial"
 size="2"><br></font></div><div><font class="Apple-style-span" face="arial" size="2">Data/Primitive/Array.hs:27:30:</font></div><div><font class="Apple-style-span" face="arial" size="2">&nbsp; &nbsp; Warning: In the use of `mkNorepType'</font></div><div><font class="Apple-style-span" face="arial" size="2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;(imported from Data.Data):</font></div><div><font class="Apple-style-span" face="arial" size="2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Deprecated: "Use mkNoRepType instead"</font></div><div><font class="Apple-style-span" face="arial" size="2">[5 of 7] Compiling Data.Primitive.ByteArray ( Data/Primitive/ByteArray.hs, dist/build/Data/Primitive/ByteArray.o )</font></div><div><font class="Apple-style-span" face="arial" size="2"><br></font></div><div><font class="Apple-style-span" face="arial" size="2">Data/Primitive/ByteArray.hs:36:30:</font></div><div><font class="Apple-style-span" face="arial"
 size="2">&nbsp; &nbsp; Warning: In the use of `mkNorepType'</font></div><div><font class="Apple-style-span" face="arial" size="2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;(imported from Data.Data):</font></div><div><font class="Apple-style-span" face="arial" size="2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Deprecated: "Use mkNoRepType instead"</font></div><div><font class="Apple-style-span" face="arial" size="2">[6 of 7] Compiling Data.Primitive.Addr ( Data/Primitive/Addr.hs, dist/build/Data/Primitive/Addr.o )</font></div><div><font class="Apple-style-span" face="arial" size="2">[7 of 7] Compiling Data.Primitive &nbsp; ( Data/Primitive.hs, dist/build/Data/Primitive.o )</font></div><div><font class="Apple-style-span" face="arial" size="2">Registering primitive-0.3.1...</font></div><div><font class="Apple-style-span" face="arial" size="2">Installing library in /home/michael/.cabal/lib/primitive-0.3.1/ghc-7.0.2</font></div><div><font
 class="Apple-style-span" face="arial" size="2">Registering primitive-0.3.1...</font></div><div><font class="Apple-style-span" face="arial" size="2">Downloading vector-0.7.0.1...</font></div><div><font class="Apple-style-span" face="arial" size="2">Configuring vector-0.7.0.1...</font></div><div><font class="Apple-style-span" face="arial" size="2">Preprocessing library vector-0.7.0.1...</font></div><div><font class="Apple-style-span" face="arial" size="2">Building vector-0.7.0.1...</font></div><div><font class="Apple-style-span" face="arial" size="2">[ 1 of 19] Compiling Data.Vector.Storable.Internal ( Data/Vector/Storable/Internal.hs, dist/build/Data/Vector/Storable/Internal.o )</font></div><div><font class="Apple-style-span" face="arial" size="2">[ 2 of 19] Compiling Data.Vector.Fusion.Util ( Data/Vector/Fusion/Util.hs, dist/build/Data/Vector/Fusion/Util.o )</font></div><div><font class="Apple-style-span" face="arial" size="2">[ 3 of 19] Compiling
 Data.Vector.Fusion.Stream.Size ( Data/Vector/Fusion/Stream/Size.hs, dist/build/Data/Vector/Fusion/Stream/Size.o )</font></div><div><font class="Apple-style-span" face="arial" size="2"><br></font></div><div><font class="Apple-style-span" face="arial" size="2">Data/Vector/Fusion/Stream/Size.hs:25:10:</font></div><div><font class="Apple-style-span" face="arial" size="2">&nbsp; &nbsp; Warning: No explicit method nor default method for `*'</font></div><div><font class="Apple-style-span" face="arial" size="2">&nbsp; &nbsp; In the instance declaration for `Num Size'</font></div><div><font class="Apple-style-span" face="arial" size="2"><br></font></div><div><font class="Apple-style-span" face="arial" size="2">Data/Vector/Fusion/Stream/Size.hs:25:10:</font></div><div><font class="Apple-style-span" face="arial" size="2">&nbsp; &nbsp; Warning: No explicit method nor default method for `abs'</font></div><div><font class="Apple-style-span" face="arial"
 size="2">&nbsp; &nbsp; In the instance declaration for `Num Size'</font></div><div><font class="Apple-style-span" face="arial" size="2"><br></font></div><div><font class="Apple-style-span" face="arial" size="2">Data/Vector/Fusion/Stream/Size.hs:25:10:</font></div><div><font class="Apple-style-span" face="arial" size="2">&nbsp; &nbsp; Warning: No explicit method nor default method for `signum'</font></div><div><font class="Apple-style-span" face="arial" size="2">&nbsp; &nbsp; In the instance declaration for `Num Size'</font></div><div><font class="Apple-style-span" face="arial" size="2">[ 4 of 19] Compiling Data.Vector.Internal.Check ( Data/Vector/Internal/Check.hs, dist/build/Data/Vector/Internal/Check.o )</font></div><div><font class="Apple-style-span" face="arial" size="2">[ 5 of 19] Compiling Data.Vector.Fusion.Stream.Monadic ( Data/Vector/Fusion/Stream/Monadic.hs, dist/build/Data/Vector/Fusion/Stream/Monadic.o )</font></div><div><font
 class="Apple-style-span" face="arial" size="2">Loading package ghc-prim ... linking ... done.</font></div><div><font class="Apple-style-span" face="arial" size="2">Loading package integer-gmp ... linking ... done.</font></div><div><font class="Apple-style-span" face="arial" size="2">Loading package base ... linking ... done.</font></div><div><font class="Apple-style-span" face="arial" size="2">Loading package primitive-0.3.1 ... linking ... done.</font></div><div><font class="Apple-style-span" face="arial" size="2">[ 6 of 19] Compiling Data.Vector.Fusion.Stream ( Data/Vector/Fusion/Stream.hs, dist/build/Data/Vector/Fusion/Stream.o )</font></div><div><font class="Apple-style-span" face="arial" size="2">[ 7 of 19] Compiling Data.Vector.Generic.Mutable ( Data/Vector/Generic/Mutable.hs, dist/build/Data/Vector/Generic/Mutable.o )</font></div><div><font class="Apple-style-span" face="arial" size="2">[ 8 of 19] Compiling Data.Vector.Generic.Base (
 Data/Vector/Generic/Base.hs, dist/build/Data/Vector/Generic/Base.o )</font></div><div><font class="Apple-style-span" face="arial" size="2">[ 9 of 19] Compiling Data.Vector.Generic.New ( Data/Vector/Generic/New.hs, dist/build/Data/Vector/Generic/New.o )</font></div><div><font class="Apple-style-span" face="arial" size="2">[10 of 19] Compiling Data.Vector.Generic ( Data/Vector/Generic.hs, dist/build/Data/Vector/Generic.o )</font></div><div><font class="Apple-style-span" face="arial" size="2"><br></font></div><div><font class="Apple-style-span" face="arial" size="2">Data/Vector/Generic.hs:185:36:</font></div><div><font class="Apple-style-span" face="arial" size="2">&nbsp; &nbsp; Warning: In the use of `mkNorepType'</font></div><div><font class="Apple-style-span" face="arial" size="2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;(imported from Data.Data):</font></div><div><font class="Apple-style-span" face="arial" size="2">&nbsp; &nbsp; &nbsp; &nbsp;
 &nbsp; &nbsp; &nbsp;Deprecated: "Use mkNoRepType instead"</font></div><div><font class="Apple-style-span" face="arial" size="2">[11 of 19] Compiling Data.Vector.Primitive.Mutable ( Data/Vector/Primitive/Mutable.hs, dist/build/Data/Vector/Primitive/Mutable.o )</font></div><div><font class="Apple-style-span" face="arial" size="2">[12 of 19] Compiling Data.Vector.Primitive ( Data/Vector/Primitive.hs, dist/build/Data/Vector/Primitive.o )</font></div><div><font class="Apple-style-span" face="arial" size="2">[13 of 19] Compiling Data.Vector.Storable.Mutable ( Data/Vector/Storable/Mutable.hs, dist/build/Data/Vector/Storable/Mutable.o )</font></div><div><font class="Apple-style-span" face="arial" size="2">[14 of 19] Compiling Data.Vector.Storable ( Data/Vector/Storable.hs, dist/build/Data/Vector/Storable.o )</font></div><div><font class="Apple-style-span" face="arial" size="2">[15 of 19] Compiling Data.Vector.Unboxed.Base ( Data/Vector/Unboxed/Base.hs,
 dist/build/Data/Vector/Unboxed/Base.o )</font></div><div><font class="Apple-style-span" face="arial" size="2">[16 of 19] Compiling Data.Vector.Unboxed ( Data/Vector/Unboxed.hs, dist/build/Data/Vector/Unboxed.o )</font></div><div><font class="Apple-style-span" face="arial" size="2">[17 of 19] Compiling Data.Vector.Unboxed.Mutable ( Data/Vector/Unboxed/Mutable.hs, dist/build/Data/Vector/Unboxed/Mutable.o )</font></div><div><font class="Apple-style-span" face="arial" size="2">[18 of 19] Compiling Data.Vector.Mutable ( Data/Vector/Mutable.hs, dist/build/Data/Vector/Mutable.o )</font></div><div><font class="Apple-style-span" face="arial" size="2">[19 of 19] Compiling Data.Vector &nbsp; &nbsp; &nbsp;( Data/Vector.hs, dist/build/Data/Vector.o )</font></div><div><font class="Apple-style-span" face="arial" size="2">Registering vector-0.7.0.1...</font></div><div><font class="Apple-style-span" face="arial" size="2">Installing library in
 /home/michael/.cabal/lib/vector-0.7.0.1/ghc-7.0.2</font></div><div><font class="Apple-style-span" face="arial" size="2">Registering vector-0.7.0.1...</font></div><div><font class="Apple-style-span" face="arial" size="2">Downloading gsl-random-0.4.3...</font></div><div><font class="Apple-style-span" face="arial" size="2">[1 of 1] Compiling Main &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ( /tmp/gsl-random-0.4.32479/gsl-random-0.4.3/Setup.lhs, /tmp/gsl-random-0.4.32479/gsl-random-0.4.3/dist/setup/Main.o )</font></div><div><font class="Apple-style-span" face="arial" size="2">Linking /tmp/gsl-random-0.4.32479/gsl-random-0.4.3/dist/setup/setup ...</font></div><div><font class="Apple-style-span" face="arial" size="2">Configuring gsl-random-0.4.3...</font></div><div><font class="Apple-style-span" face="arial" size="2">setup: The program gsl-config is required but it could not be found.</font></div><div><font class="Apple-style-span" face="arial" size="2">cabal:
 Error: some packages failed to install:</font></div><div><font class="Apple-style-span" face="arial" size="2">gsl-random-0.4.3 failed during the configure step. The exception was:</font></div><div><font class="Apple-style-span" face="arial" size="2">ExitFailure 1</font></div><div><font class="Apple-style-span" face="arial" size="2">monte-carlo-0.4.1 depends on gsl-random-0.4.3 which failed to install.</font></div><div><font class="Apple-style-span" face="arial" size="2">[michael@sabal ~]$ ghci</font></div><div><font class="Apple-style-span" face="arial" size="2">GHCi, version 7.0.2: http://www.haskell.org/ghc/ &nbsp;:? for help</font></div><div><font class="Apple-style-span" face="arial" size="2">Loading package ghc-prim ... linking ... done.</font></div><div><font class="Apple-style-span" face="arial" size="2">Loading package integer-gmp ... linking ... done.</font></div><div><font class="Apple-style-span" face="arial" size="2">Loading package base ...
 linking ... done.</font></div><div><font class="Apple-style-span" face="arial" size="2">Prelude&gt; :m + Control.Monad.MC.Class</font></div><div><font class="Apple-style-span" face="arial" size="2"><br></font></div><div><font class="Apple-style-span" face="arial" size="2">&lt;no location info&gt;:</font></div><div><font class="Apple-style-span" face="arial" size="2">&nbsp; &nbsp; Could not find module `Control.Monad.MC.Class':</font></div><div><font class="Apple-style-span" face="arial" size="2">&nbsp; &nbsp; &nbsp; it is not a module in the current program, or in any known package.</font></div><div><font class="Apple-style-span" face="arial" size="2">Prelude&gt;</font></div><br><font class="Apple-style-span" face="arial" size="2">--- On </font><b style="font-family: arial; font-size: 10pt; ">Mon, 6/13/11, michael rice <i>&lt;nowgate@yahoo.com&gt;</i></b><font class="Apple-style-span" face="arial" size="2"> wrote:</font><br><blockquote
 style="font-family: arial; font-size: 10pt; border-left-width: 2px; border-left-style: solid; border-left-color: rgb(16, 16, 255); margin-left: 5px; padding-left: 5px; "><br>From: michael rice &lt;nowgate@yahoo.com&gt;<br>Subject: Re: [Haskell-cafe] Acquiring a random set of a specific size (w/o dups) from a range of Ints<br>To: "Felipe Almeida Lessa" &lt;felipe.lessa@gmail.com&gt;<br>Cc: haskell-cafe@haskell.org<br>Date: Monday, June 13, 2011, 10:31 PM<br><br><div id="yiv698524098"><table cellspacing="0" cellpadding="0" border="0"><tbody><tr><td valign="top" style="font:inherit;"><div id="yiv698524098"><table cellspacing="0" cellpadding="0" border="0" id="yiv698524098bodyDrftID" class="yiv698524098"><tbody><tr><td id="yiv698524098drftMsgContent" style="font:inherit;"><font class="yiv698524098Apple-style-span" size="2">Thanks, all.</font><div style="font-family:arial;font-size:10pt;"><br></div><div style="font-family:arial;font-size:10pt;">It seemed
 like something like this should exist in a prob/stat package, and if so, didn't want to reinvent the wheel.</div><div style="font-family:arial;font-size:10pt;"><br></div><div style="font-family:arial;font-size:10pt;"><span class="yiv698524098Apple-style-span" style="font-family:monospace;font-size:14px;line-height:16px;">Shuffle [1..20], then take 5?</span></div><div style="font-family:arial;font-size:10pt;"><span class="yiv698524098Apple-style-span" style="font-family:monospace;font-size:14px;line-height:16px;"><br></span></div><div style="font-family:arial;font-size:10pt;"><span class="yiv698524098Apple-style-span" style="font-family:monospace;font-size:14px;line-height:16px;">Yes, so simple, I'm embarrassed I didn't think of it.</span></div><div style="font-family:arial;font-size:10pt;"><span class="yiv698524098Apple-style-span" style="font-family:monospace;font-size:14px;line-height:16px;"><br></span></div><div
 style="font-family:arial;font-size:10pt;"><span class="yiv698524098Apple-style-span" style="font-family:monospace;font-size:14px;line-height:16px;">Michael</span></div><div style="font-family:arial;font-size:10pt;"><span class="yiv698524098Apple-style-span" style="font-family:monospace;font-size:14px;line-height:16px;"><br></span></div><div><font class="yiv698524098Apple-style-span" face="monospace"><span class="yiv698524098Apple-style-span" style="font-size:14px;
line-height:16px;"><br></span></font></div><div style="font-family:arial;font-size:10pt;"><br>--- On <b>Mon, 6/13/11, Felipe Almeida Lessa <i>&lt;felipe.lessa@gmail.com&gt;</i></b> wrote:<br><blockquote style="border-left:2px solid rgb(16, 16, 255);margin-left:5px;padding-left:5px;"><br>From: Felipe Almeida Lessa &lt;felipe.lessa@gmail.com&gt;<br>Subject: Re: [Haskell-cafe] Acquiring a random set of a specific size (w/o dups) from a range of Ints<br>To: "michael rice" &lt;nowgate@yahoo.com&gt;<br>Cc: haskell-cafe@haskell.org<br>Date: Monday, June 13, 2011, 9:38 PM<br><br><div class="yiv698524098plainMail">On Mon, Jun 13, 2011 at 8:56 PM, michael rice &lt;<a rel="nofollow">nowgate@yahoo.com</a>&gt; wrote:<br>&gt; Is there an (existing) way to select 5 Ints randomly (no duplicates) from a population, say 1-20 (inclusive)?<br><br>Yes, already implemented in the monte-carlo package as sampleSubset [1],<br><br>&nbsp; sampleSubset :: MonadMC m =&gt; [a] -&gt;
 Int
 -&gt; m [a]<br><br>Complete example code for your example:<br><br>&nbsp; evalMC (sampleSubset [1..20] 5) (mt19937 0)<br><br>Cheers!<br><br>[1] <a rel="nofollow" target="_blank" href="http://hackage.haskell.org/packages/archive/monte-carlo/0.4.1/doc/html/Control-Monad-MC-Class.html#v:sampleSubset">http://hackage.haskell.org/packages/archive/monte-carlo/0.4.1/doc/html/Control-Monad-MC-Class.html#v:sampleSubset</a><br><br>--<br>Felipe.<br></div></blockquote></div></td></tr></tbody></table></div></td></tr></tbody></table></div><br>-----Inline Attachment Follows-----<br><br><div class="plainMail">_______________________________________________<br>Haskell-Cafe mailing list<br><a ymailto="mailto:Haskell-Cafe@haskell.org" href="/mc/compose?to=Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br><a href="http://www.haskell.org/mailman/listinfo/haskell-cafe"
 target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br></div></blockquote></td></tr></table>