summaryrefslogtreecommitdiff
path: root/System/Random
diff options
context:
space:
mode:
authorBen Sima <ben@bsima.me>2024-05-03 22:34:10 -0400
committerBen Sima <ben@bsima.me>2024-05-09 21:38:52 -0400
commitd71c6f8c5955e8a9861e3f3957b293a369aac954 (patch)
treeda77bbbec8e082a77c0d553cf2216dce9b4ced0b /System/Random
parentd36b4360c9c359e6eea480b39e9699b1deae70f1 (diff)
Switch to nixpkgs-23.11, ghc 9.6.3
This brings a bunch of improvements. I got rid of some custom packages, I can now build exllama without using a non-default cuda version. Oh yeah and I get to use GHC 9.6.2 now, a huge upgrade from 9.4. Unfortunately I also updated ormolu and some unrelated formatting changed, but that's life I guess.
Diffstat (limited to 'System/Random')
-rw-r--r--System/Random/Shuffle.hs6
1 files changed, 3 insertions, 3 deletions
diff --git a/System/Random/Shuffle.hs b/System/Random/Shuffle.hs
index 1df376f..4cd36eb 100644
--- a/System/Random/Shuffle.hs
+++ b/System/Random/Shuffle.hs
@@ -94,16 +94,16 @@ shuffle elements = shuffleTree (buildTree elements)
-- | Given a sequence (e1,...en) to shuffle, its length, and a random
-- generator, compute the corresponding permutation of the input
-- sequence.
-shuffle' :: RandomGen gen => [a] -> Int -> gen -> [a]
+shuffle' :: (RandomGen gen) => [a] -> Int -> gen -> [a]
shuffle' elements len = shuffle elements <. rseq len
where
-- The sequence (r1,...r[n-1]) of numbers such that r[i] is an
-- independent sample from a uniform random distribution
-- [0..n-i]
- rseq :: RandomGen gen => Int -> gen -> [Int]
+ rseq :: (RandomGen gen) => Int -> gen -> [Int]
rseq n = map fst <. rseq' (n - 1)
where
- rseq' :: RandomGen gen => Int -> gen -> [(Int, gen)]
+ rseq' :: (RandomGen gen) => Int -> gen -> [(Int, gen)]
rseq' 0 _ = []
rseq' i gen = (j, gen) : rseq' (i - 1) gen'
where