Turn shapeObject's vertices into a stream
This commit is contained in:
+2
-1
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user