tensort-1.0.1.4: Tunable sorting for responsive robustness and beyond
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.Tensort.Utils.RandomizeList

Description

This module prvodies the randomizeList function, which randomizes the order of elements in Sortable lists.

Synopsis

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

Expand
>>> 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)]