[Haskell-cafe] How to use randomized algorithm within the implementation of pure data structures?

Hiromi ISHII konn.jinro at gmail.com
Tue Nov 4 08:53:57 UTC 2014


Hi, 


On 2014/11/02 18:50, Travis Cardwell <travis.cardwell at extellisys.com> wrote:

> Indeed: many algorithms merely require values from a uniform distribution,
> not necessarily random numbers.  I was hopeful that Cantor-Zassenhaus
> would be one of them.
> 
> Looking at your code [1], I see that you are exporting both
> `equalDegreeSplitM`, which uses `uniform` from `Control.Monad.Random`, and
> `equalDegreeFactorM`, which iteratively calls `equalDegreeSplitM`.  One of
> the challenges of using a pure uniform stream is threading the state:
> since both functions are exported, implementation details would leak anyway.

"Threading the state" means "using ST monad", right?
If so, I think we can use algebraic numbers only within ST monad, so it would be too restrictive to do some calculation.

> Great work, by the way! :)

Thanks!

-- Hiromi ISHII
konn.jinro at gmail.com



-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 496 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20141104/d171da91/attachment.sig>


More information about the Haskell-Cafe mailing list