Turn shapeObject's vertices into a stream

This commit is contained in:
2022-06-27 17:47:03 +01:00
parent 8d5800d806
commit 673e9b11fc
7 changed files with 47 additions and 38 deletions
+2 -1
View File
@@ -5,6 +5,7 @@ module RandomHelp
, module RandomHelp
) where
import Geometry
import StrictHelp
import System.Random
import Control.Monad.State
@@ -48,7 +49,7 @@ shuffle xs = do
let f ys rand = let (as,b:bs) = splitAt rand ys
in (as ++ bs, b)
let (_,zs) = mapAccumR f xs rands
return zs
return $ forceElements zs `seq` zs
-- | Randomly shuffle the tail of a list, not safe.
shuffleTail :: RandomGen g => [a] -> State g [a]