From 3d375fae96258214ec9b2928d2d1a267c1ec7bd9 Mon Sep 17 00:00:00 2001 From: Rnhmjoj Date: Mon, 20 Oct 2014 17:32:36 +0200 Subject: [PATCH] Refactor randWords function --- Alea/Random.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Alea/Random.hs b/Alea/Random.hs index e775abf..100ade2 100644 --- a/Alea/Random.hs +++ b/Alea/Random.hs @@ -3,4 +3,4 @@ module Alea.Random where import Crypto.Threefish.Random randWords :: Int -> Int -> IO [Int] -randWords n k = newSkeinGen >>= \x -> return . take k $ randomRs (0, n) x +randWords n k = newSkeinGen >>= return . take k . randomRs (0, n-1)