With regards to generating random numbers, the Foreign Function Interface is also really useful. Here's a one-line wrapper around random(3).
foreign import ccall "stdlib.h random" c_rand :: CDouble -> CLong