Commit before generalising picture transformation to alternative
This commit is contained in:
@@ -36,7 +36,7 @@ takeOneMore (xs,ys) = do
|
||||
return (w:xs, zs ++ ws)
|
||||
|
||||
takeNMore :: RandomGen g => Int -> ([a],[a]) -> State g ([a],[a])
|
||||
takeNMore n p = foldr (const (>>= takeOneMore)) (return p) [1..n]
|
||||
takeNMore n p = foldl' (flip $ const (>>= takeOneMore)) (return p) [1..n]
|
||||
|
||||
takeN :: RandomGen g => Int -> [a] -> State g [a]
|
||||
takeN 0 _ = return []
|
||||
|
||||
Reference in New Issue
Block a user