Hoogle Search
Within LTS Haskell 24.33 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
module Data.Tensort.Subalgorithms.
Permutationsort This module provides the permutationsort function for sorting lists
permutationsort :: Ord a => [a] -> [a]tensort Data.Tensort.Subalgorithms.Permutationsort Takes a list and returns a sorted list using Permutationsort algorithm
Examples
>>> permutationsort ([16, 23, 4, 8, 15, 42] :: [Int]) [4,8,15,16,23,42]
>>> permutationsort ([(1, 16), (5, 23), (2, 4) ,(3, 8), (0, 15) , (4, 42)] :: [(Int, Int)]) [(0,15),(1,16),(2,4),(3,8),(4,42),(5,23)]
module Data.Tensort.Subalgorithms.
Rotationsort This module provides Rotationsort variants for sorting lists. | I was having some issues with the swaps for larger input lists, so for now these functions are only implemented for lists of length 3 or less.
rotationsort :: Ord a => [a] -> [a]tensort Data.Tensort.Subalgorithms.Rotationsort Takes a list and returns a sorted list using a Rotationsort algorithm. I was having some issues with the swaps for larger input lists, so for now this function is only implemented for lists of length 3 or less.
Examples
>>> rotationsort ([1,3,2] :: [Int]) [1,2,3]
>>> rotationsort ([(3, 1), (1, 3), (2, 2)] :: [(Int, Int)]) [(1,3),(2,2),(3,1)]
rotationsortAmbi :: Ord a => [a] -> [a]tensort Data.Tensort.Subalgorithms.Rotationsort Takes a list and returns a sorted list using an Ambidextrous Rotationsort algorithm. I was having some issues with the swaps for larger input lists, so for now this function is only implemented for lists of length 3 or less.
Examples
>>> rotationsortAmbi ([1,3,2] :: [Int]) [1,2,3]
>>> rotationsortAmbi ([(3, 1), (1, 3), (2, 2)] :: [(Int, Int)]) [(1,3),(2,2),(3,1)]
rotationsortReverse :: Ord a => [a] -> [a]tensort Data.Tensort.Subalgorithms.Rotationsort Takes a list and returns a sorted list using a Reverse Rotationsort algorithm. I was having some issues with the swaps for larger input lists, so for now this function is only implemented for lists of length 3 or less.
Examples
>>> rotationsortReverse ([1,3,2] :: [Int]) [1,2,3]
>>> rotationsortReverse ([(3, 1), (1, 3), (2, 2)] :: [(Int, Int)]) [(1,3),(2,2),(3,1)]
rotationsortReverseAmbi :: Ord a => [a] -> [a]tensort Data.Tensort.Subalgorithms.Rotationsort Takes a list and returns a sorted list using an Ambidextrous Reverse Rotationsort algorithm. I was having some issues with the swaps for larger input lists, so for now this function is only implemented for lists of length 3 or less.
Examples
>>> rotationsortReverseAmbi ([1,3,2] :: [Int]) [1,2,3]
>>> rotationsortReverseAmbi ([(3, 1), (1, 3), (2, 2)] :: [(Int, Int)]) [(1,3),(2,2),(3,1)]
module Data.Tensort.Subalgorithms.
Supersort This module provides functions for creating Supersort variants for adjudicating between 3 sorting algorithms.
supersort :: Ord a => (SortAlg a, SortAlg a, SortAlg a, SupersortStrat a) -> [a] -> [a]tensort Data.Tensort.Subalgorithms.Supersort Used for creating a Supersort algorithm that adjudicates between 3 sorting algorithms. Takes 3 sorting algorithms and a SuperStrat and returns a SortAlg that adjudicates between the 3 sorting algorithms using the provided SuperStrat.
Examples
>>> import Data.Tensort.Subalgorithms.Bubblesort (bubblesort) >>> import Data.Tensort.Subalgorithms.Permutationsort (permutationsort) >>> import Data.Tensort.OtherSorts.Mergesort (mergesort)
>>> supersort (mergesort, bubblesort, permutationsort, mundaneSuperStrat) ([16, 23, 4, 8, 15, 42] :: [Int]) [4,8,15,16,23,42]
>>> supersort (mergesort, bubblesort, permutationsort, mundaneSuperStrat) ([(16, 23), (4, 8), (15, 42)] :: [(Int, Int)]) [(4,8),(15,42),(16,23)]
-
This module provides variations of the Tensort algorithm