Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Data.Tensort.Utils.RandomizeList
Description
This module prvodies the randomizeList function, which randomizes the order of elements in Sortable lists.
Synopsis
- randomizeList :: Int -> Sortable -> Sortable
Documentation
randomizeList :: Int -> Sortable -> Sortable Source #
Takes a seed for random generation and a Sortable list and returns a new Sortable list with the same elements as the input list but in a random order.
Examples
>>>
randomizeList 143 (SortBit [4, 8, 15, 16, 23, 42])
SortBit [16,23,4,8,15,42]
>>>
randomizeList 143 (SortRec [(2,4),(3,8),(0,15),(1,16),(5,23),(4,42)])
SortRec [(1,16),(5,23),(2,4),(3,8),(0,15),(4,42)]