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

KC kc1956 at gmail.com
Tue Nov 4 16:29:48 UTC 2014


Functions are expected to terminate; therefore, one needs the concept of a
continuing computation.
In Haskell, monads represent the continuing context containing the
terminating functions.

Having your functions run in a monad is not a limitation.

--
--

Sent from an expensive device which will be obsolete in a few months! :D

Casey

On Nov 4, 2014 5:33 AM, "Carter Schonwald" <carter.schonwald at gmail.com>
wrote:

> Threading the state can also mean using the STATE monad as suggested
> Earlier.
> On Nov 4, 2014 3:54 AM, "Hiromi ISHII" <konn.jinro at gmail.com> wrote:
>
>> 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
>>
>>
>>
>>
>> _______________________________________________
>> Haskell-Cafe mailing list
>> Haskell-Cafe at haskell.org
>> http://www.haskell.org/mailman/listinfo/haskell-cafe
>>
>>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20141104/1ae2ce17/attachment.html>


More information about the Haskell-Cafe mailing list