[Haskell] randomgen for foreign random functions