<?xml version="1.0" encoding="UTF-8"?><feed xmlns="http://www.w3.org/2005/Atom"><title xmlns:ns="http://www.w3.org/2005/Atom" ns:type="text">Randomness – Haskell – Aelve Guide</title><id>https://guide.aelve.com/haskell/feed/category/tm1w57n3</id><updated>2016-05-12T17:53:31Z</updated><link xmlns:ns="http://www.w3.org/2005/Atom" ns:href="https://guide.aelve.com/haskell/feed/category/tm1w57n3"/><entry><id>moukx96r</id><title xmlns:ns="http://www.w3.org/2005/Atom" ns:type="text">mersenne-random-pure64</title><updated>2016-05-12T17:53:31Z</updated><content xmlns:ns="http://www.w3.org/2005/Atom" ns:type="html">&lt;h1&gt;  &lt;span class=&#34;item-name&#34;&gt;mersenne-random-pure64&lt;/span&gt;

  
  (&lt;a href=&#34;https://hackage.haskell.org/package/mersenne-random-pure64&#34;&gt;Hackage&lt;/a&gt;)
&lt;/h1&gt;&lt;h2&gt;Pros&lt;/h2&gt;&lt;ul&gt;&lt;/ul&gt;&lt;h2&gt;Cons&lt;/h2&gt;&lt;ul&gt;&lt;/ul&gt;</content><link xmlns:ns="http://www.w3.org/2005/Atom" ns:href="https://guide.aelve.com/haskell/randomness-tm1w57n3#item-moukx96r"/></entry><entry><id>a75p6jif</id><title xmlns:ns="http://www.w3.org/2005/Atom" ns:type="text">pcg-random</title><updated>2016-05-12T15:19:00Z</updated><content xmlns:ns="http://www.w3.org/2005/Atom" ns:type="html">&lt;h1&gt;  &lt;span class=&#34;item-name&#34;&gt;pcg-random&lt;/span&gt;

  
  (&lt;a href=&#34;https://hackage.haskell.org/package/pcg-random&#34;&gt;Hackage&lt;/a&gt;)
&lt;/h1&gt;&lt;p&gt;An implementation of the &lt;a href=&#34;http://www.pcg-random.org/&#34;&gt;PCG&lt;/a&gt; family of generators.&lt;/p&gt;
&lt;h2&gt;Pros&lt;/h2&gt;&lt;ul&gt;&lt;p&gt;&lt;li&gt;Claimed to be faster than the Mersenne twister, and harder to predict (Mersenne twister &lt;a href=&#34;https://jazzy.id.au/2010/09/22/cracking_random_number_generators_part_3.html&#34;&gt;can be predicted&lt;/a&gt; after just 624 outputs).&lt;/li&gt;&lt;/p&gt;&lt;/ul&gt;&lt;h2&gt;Cons&lt;/h2&gt;&lt;ul&gt;&lt;/ul&gt;</content><link xmlns:ns="http://www.w3.org/2005/Atom" ns:href="https://guide.aelve.com/haskell/randomness-tm1w57n3#item-a75p6jif"/></entry><entry><id>xxywmwms</id><title xmlns:ns="http://www.w3.org/2005/Atom" ns:type="text">tf-random</title><updated>2016-04-14T10:16:01Z</updated><content xmlns:ns="http://www.w3.org/2005/Atom" ns:type="html">&lt;h1&gt;  &lt;span class=&#34;item-name&#34;&gt;tf-random&lt;/span&gt;

  
  (&lt;a href=&#34;https://hackage.haskell.org/package/tf-random&#34;&gt;Hackage&lt;/a&gt;)
&lt;/h1&gt;&lt;h2&gt;Pros&lt;/h2&gt;&lt;ul&gt;&lt;/ul&gt;&lt;h2&gt;Cons&lt;/h2&gt;&lt;ul&gt;&lt;/ul&gt;</content><link xmlns:ns="http://www.w3.org/2005/Atom" ns:href="https://guide.aelve.com/haskell/randomness-tm1w57n3#item-xxywmwms"/></entry><entry><id>pk8l1up2</id><title xmlns:ns="http://www.w3.org/2005/Atom" ns:type="text">cryptonite</title><updated>2016-04-14T10:15:08Z</updated><content xmlns:ns="http://www.w3.org/2005/Atom" ns:type="html">&lt;h1&gt;  &lt;span class=&#34;item-name&#34;&gt;cryptonite&lt;/span&gt;

  
  (&lt;a href=&#34;https://hackage.haskell.org/package/cryptonite&#34;&gt;Hackage&lt;/a&gt;)
&lt;/h1&gt;&lt;p&gt;A collection of cryptography-related functions; listed here because it implements &lt;a href=&#34;https://en.wikipedia.org/wiki/Salsa20&#34;&gt;ChaCha&lt;/a&gt;, a cryptographically secure (&lt;a href=&#34;https://en.wikipedia.org/wiki/Cryptographically_secure_pseudorandom_number_generator&#34;&gt;CSPRNG&lt;/a&gt;) random number generator.&lt;/p&gt;
&lt;h2&gt;Pros&lt;/h2&gt;&lt;ul&gt;&lt;p&gt;&lt;li&gt;Cryptographically secure.&lt;/li&gt;&lt;/p&gt;&lt;/ul&gt;&lt;h2&gt;Cons&lt;/h2&gt;&lt;ul&gt;&lt;p&gt;&lt;li&gt;Low-level; only knows how to generate random bytes, not ints or strings.&lt;/li&gt;&lt;/p&gt;&lt;p&gt;&lt;li&gt;The package takes long to build and the random number generator is only a small part of it.&lt;/li&gt;&lt;/p&gt;&lt;/ul&gt;</content><link xmlns:ns="http://www.w3.org/2005/Atom" ns:href="https://guide.aelve.com/haskell/randomness-tm1w57n3#item-pk8l1up2"/></entry><entry><id>etv8fjco</id><title xmlns:ns="http://www.w3.org/2005/Atom" ns:type="text">mwc-random</title><updated>2016-04-14T10:14:43Z</updated><content xmlns:ns="http://www.w3.org/2005/Atom" ns:type="html">&lt;h1&gt;  &lt;span class=&#34;item-name&#34;&gt;mwc-random&lt;/span&gt;

  
  (&lt;a href=&#34;https://hackage.haskell.org/package/mwc-random&#34;&gt;Hackage&lt;/a&gt;)
&lt;/h1&gt;&lt;h2&gt;Pros&lt;/h2&gt;&lt;ul&gt;&lt;p&gt;&lt;li&gt;Very fast!&lt;/li&gt;&lt;/p&gt;&lt;/ul&gt;&lt;h2&gt;Cons&lt;/h2&gt;&lt;ul&gt;&lt;p&gt;&lt;li&gt;Less convinient to use than System.Random as it operates on top of PrimMonad (ie. you need IO or ST to use it). No pure interface available.&lt;/li&gt;&lt;/p&gt;&lt;/ul&gt;</content><link xmlns:ns="http://www.w3.org/2005/Atom" ns:href="https://guide.aelve.com/haskell/randomness-tm1w57n3#item-etv8fjco"/></entry><entry><id>jgrt3qkm</id><title xmlns:ns="http://www.w3.org/2005/Atom" ns:type="text">MonadRandom</title><updated>2016-04-14T10:14:34Z</updated><content xmlns:ns="http://www.w3.org/2005/Atom" ns:type="html">&lt;h1&gt;  &lt;span class=&#34;item-name&#34;&gt;MonadRandom&lt;/span&gt;

  
  (&lt;a href=&#34;https://hackage.haskell.org/package/MonadRandom&#34;&gt;Hackage&lt;/a&gt;)
&lt;/h1&gt;&lt;h2&gt;Pros&lt;/h2&gt;&lt;ul&gt;&lt;/ul&gt;&lt;h2&gt;Cons&lt;/h2&gt;&lt;ul&gt;&lt;/ul&gt;</content><link xmlns:ns="http://www.w3.org/2005/Atom" ns:href="https://guide.aelve.com/haskell/randomness-tm1w57n3#item-jgrt3qkm"/></entry><entry><id>rmkssnwr</id><title xmlns:ns="http://www.w3.org/2005/Atom" ns:type="text">random-fu</title><updated>2016-04-14T10:14:27Z</updated><content xmlns:ns="http://www.w3.org/2005/Atom" ns:type="html">&lt;h1&gt;  &lt;span class=&#34;item-name&#34;&gt;random-fu&lt;/span&gt;

  
  (&lt;a href=&#34;https://hackage.haskell.org/package/random-fu&#34;&gt;Hackage&lt;/a&gt;)
&lt;/h1&gt;&lt;p&gt;A powerful library with:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;random numbers/variables&lt;/li&gt;
&lt;li&gt;list shuffling and random choice&lt;/li&gt;
&lt;li&gt;various &lt;a href=&#34;https://en.wikipedia.org/wiki/Probability_distribution&#34;&gt;probability distributions&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;cumulative distribution functions&lt;/li&gt;
&lt;li&gt;a monadic interface&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Can use different randomness sources (&lt;code&gt;/dev/random&lt;/code&gt; and &lt;code&gt;/dev/urandom&lt;/code&gt;, &lt;code&gt;StdGen&lt;/code&gt;, the Mersenne twister generator).&lt;/p&gt;
&lt;h2&gt;Pros&lt;/h2&gt;&lt;ul&gt;&lt;p&gt;&lt;li&gt;Supports different &lt;a href=&#34;https://en.wikipedia.org/wiki/Probability_distribution&#34;&gt;distributions&lt;/a&gt;.&lt;/li&gt;&lt;/p&gt;&lt;p&gt;&lt;li&gt;Provides a monadic interface.&lt;/li&gt;&lt;/p&gt;&lt;/ul&gt;&lt;h2&gt;Cons&lt;/h2&gt;&lt;ul&gt;&lt;p&gt;&lt;li&gt;Can be harder to use than other, simpler libraries.&lt;/li&gt;&lt;/p&gt;&lt;/ul&gt;&lt;h2&gt;Ecosystem&lt;/h2&gt;&lt;p&gt;&lt;a href=&#34;https://hackage.haskell.org/package/ks-test&#34;&gt;ks-test&lt;/a&gt; (Kolmogorov distribution),
&lt;a href=&#34;https://hackage.haskell.org/package/random-extras&#34;&gt;random-extras&lt;/a&gt; (weighted shuffling and sampling, card shuffling, etc)&lt;/p&gt;
</content><link xmlns:ns="http://www.w3.org/2005/Atom" ns:href="https://guide.aelve.com/haskell/randomness-tm1w57n3#item-rmkssnwr"/></entry><entry><id>eonhwwzz</id><title xmlns:ns="http://www.w3.org/2005/Atom" ns:type="text">random</title><updated>2016-04-14T10:14:10Z</updated><content xmlns:ns="http://www.w3.org/2005/Atom" ns:type="html">&lt;h1&gt;  &lt;span class=&#34;item-name&#34;&gt;random&lt;/span&gt;

  
  (&lt;a href=&#34;https://hackage.haskell.org/package/random&#34;&gt;Hackage&lt;/a&gt;)
&lt;/h1&gt;&lt;p&gt;The default random generator library. Simple to use, doesn&#39;t have many features.&lt;/p&gt;
&lt;h2&gt;Pros&lt;/h2&gt;&lt;ul&gt;&lt;p&gt;&lt;li&gt;Convinient to use&lt;/li&gt;&lt;/p&gt;&lt;/ul&gt;&lt;h2&gt;Cons&lt;/h2&gt;&lt;ul&gt;&lt;p&gt;&lt;li&gt;Very slow&lt;/li&gt;&lt;/p&gt;&lt;/ul&gt;&lt;h2&gt;Ecosystem&lt;/h2&gt;&lt;p&gt;&lt;a href=&#34;https://hackage.haskell.org/package/random-derive&#34;&gt;random-derive&lt;/a&gt; (automatically derive instances of &lt;code&gt;Random&lt;/code&gt;)&lt;/p&gt;
</content><link xmlns:ns="http://www.w3.org/2005/Atom" ns:href="https://guide.aelve.com/haskell/randomness-tm1w57n3#item-eonhwwzz"/></entry></feed>