random Category

More Random fun

In: random
The next obvious functions after “Pick” are “Unpick” to eject a value randomly from the list, and “Pick N” values from the list. unpick is fairly straight-forward. To do in a single pass, you have to thread through the list of values, but otherwise it's more or less the same as the previous code for pick > unpick [...]

Random pain in Haskell

In: random
Random numbers seem to be a bit of a pain in Haskell. Because they are not a “pure” function (they involve hooking up with a system or user-supplied random number generator) there is a little scaffolding involved. Also when the number comes back, it's wrapped in an IO Ref, making the whole of your function impure — causing me [...]

About this blog

Osfameron's blog on Haskell, Perl programming, stuff.


Categories