| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Data.Tensort.Tensort
Description
This module provides variations of the Tensort algorithm using the Sortable type
Documentation
tensort :: TensortProps -> Sortable -> Sortable Source #
Sort a list of Sortables using a custom Tensort algorithm
| Takes TensortProps and a Sortable and returns a sorted Sortable
Examples
>>>import Data.Tensort.Subalgorithms.Bubblesort (bubblesort)>>>import Data.Tensort.Utils.MkTsProps (mkTsProps)>>>tensort (mkTsProps 2 bubblesort) (SortBit [16, 23, 4, 8, 15, 42])SortBit [4,8,15,16,23,42]
>>>tensort (mkTsProps 2 bubblesort) (SortRec [(1, 16), (5, 23), (2, 4) ,(3, 8), (0, 15) , (4, 42)])SortRec [(2,4),(3,8),(0,15),(1,16),(5,23),(4,42)]
tensortB4 :: Sortable -> Sortable Source #
Sort a list of Sortables using a Standard Tensort algorithm with a 4-Bit Bytesize
Examples
>>>tensortB4 (SortBit [16, 23, 4, 8, 15, 42])SortBit [4,8,15,16,23,42]
>>>tensortB4 (SortRec [(1, 16), (5, 23), (2, 4) ,(3, 8), (0, 15) , (4, 42)])SortRec [(2,4),(3,8),(0,15),(1,16),(5,23),(4,42)]
tensortBN :: Int -> Sortable -> Sortable Source #
Sort a list of Sortables using a Standard Tensort algorithm with a custom Bytesize
Examples
>>>tensortBN 3 (SortBit [16, 23, 4, 8, 15, 42])SortBit [4,8,15,16,23,42]
>>>tensortBN 3 (SortRec [(1, 16), (5, 23), (2, 4) ,(3, 8), (0, 15) , (4, 42)])SortRec [(2,4),(3,8),(0,15),(1,16),(5,23),(4,42)]
tensortBL :: Sortable -> Sortable Source #
Sort a list of Sortables using a Standard Logarithmic Tensort algorithm
Examples
>>>tensortBL (SortBit [16, 23, 4, 8, 15, 42])SortBit [4,8,15,16,23,42]
>>>tensortBL (SortRec [(1, 16), (5, 23), (2, 4) ,(3, 8), (0, 15) , (4, 42)])SortRec [(2,4),(3,8),(0,15),(1,16),(5,23),(4,42)]