Add tree structure generation
This commit is contained in:
@@ -33,6 +33,7 @@ takeNMore :: RandomGen g => Int -> ([a],[a]) -> State g ([a],[a])
|
||||
takeNMore n p = foldr (const ((=<<) takeOneMore)) (return p) [1..n]
|
||||
|
||||
takeN :: RandomGen g => Int -> [a] -> State g [a]
|
||||
takeN 0 xs = return []
|
||||
takeN i xs = fmap fst $ takeNMore i ([],xs)
|
||||
|
||||
-- to randomly shuffle a list
|
||||
|
||||
Reference in New Issue
Block a user