Cleanup compiler warnings

This commit is contained in:
2024-10-22 10:48:44 +01:00
parent c0b1092fb6
commit 65f05b93f8
10 changed files with 72 additions and 161 deletions
+2 -6
View File
@@ -1,3 +1,4 @@
{-# OPTIONS -Wno-incomplete-uni-patterns #-}
{- Helpers for random generation. -}
module RandomHelp (
module System.Random,
@@ -29,6 +30,7 @@ takeOneWeighted ws xs = state (randomR (0, sum ws)) >>= (\w -> return (xs !! i w
| otherwise = 1 + i (y - z) zs
i _ _ = 0
--{-# OPTIONS -Wno-incomplete-uni-patterns #-}
takeOneMore :: RandomGen g => ([a], [a]) -> State g ([a], [a])
takeOneMore (_, []) = error "trying to takeOneMore from empty list"
takeOneMore (xs, ys) = do
@@ -119,9 +121,3 @@ randsSpread (a, b) i
randsOnCirc :: RandomGen g => Int -> State g [Float]
randsOnCirc = randsSpread (0, 2 * pi)
--randsOnCirc i
-- | i <= 0 = error "tried to take <= 0 randsOnCirc"
-- | otherwise = zipWith (+) [x,2*x..] <$> replicateM i (state $ randomR (0,x))
-- where
-- x = 2*pi/fromIntegral i