samedi 6 octobre 2018

Why does the shuffle' function require an Int parameter?

In System.Random.Shuffle,

shuffle' :: RandomGen gen => [a] -> Int -> gen -> [a]

The hackage page mentions this Int argument as

..., its length,...

However, it seems that a simple wrapper function like

shuffle'' x = shuffle' x (length x)

should've sufficed.




Aucun commentaire:

Enregistrer un commentaire