[Haskell-beginners] [Haskell-cafe] select :: [(Float,
a)] -> a -- Weighted stochastic selection - help?
Nicolas Pouillard
nicolas.pouillard at gmail.com
Sat Sep 6 04:04:31 EDT 2008
Excerpts from C.M.Brown's message of Fri Sep 05 22:12:05 +0200 2008:
> > Can you give an example? I don't see how that can be done using
> > Control.Monad.State(.Strict).State, unless invocations of put or modify are
> > considered side effects.
>
> Actually, yes, sorry; I do see your point. I guess it's just IO then.
Technically, even the IO monad is pure, that's just the runtime-system
that consume your 'main' function that perform effects (and unsafeP...).
That's an important point to grasp about the way we do effects in a pure
language.
Once we've understood that point one tend to be a little less precise and
consider IO as effect-full.
Best regards,
--
Nicolas Pouillard aka Ertai
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 194 bytes
Desc: not available
Url : http://www.haskell.org/pipermail/beginners/attachments/20080906/5f976bea/signature.bin
More information about the Beginners
mailing list