module Data.Tensort.Robustsort
  ( robustsortP,
    robustsortB,
    robustsortM,
  )
where

import Data.Tensort.Subalgorithms.Bogosort (bogosort)
import Data.Tensort.Subalgorithms.Bubblesort (bubblesort)
import Data.Tensort.Subalgorithms.Magicsort (magicsort)
import Data.Tensort.Subalgorithms.Permutationsort (permutationsort)
import Data.Tensort.Subalgorithms.Exchangesort (exchangesort)
import Data.Tensort.Subalgorithms.Supersort (magicSuperStrat, mundaneSuperStrat, supersort)
import Data.Tensort.Tensort (mkTSProps, tensort)
import Data.Tensort.Utils.Types (Sortable, Bit)

robustsortP :: [Bit] -> [Bit]
robustsortP :: [Bit] -> [Bit]
robustsortP [Bit]
xs = [Bit] -> TensortProps -> [Bit]
tensort [Bit]
xs (Bit -> SortAlg -> TensortProps
mkTSProps Bit
3 SortAlg
supersortP)

supersortP :: Sortable -> Sortable
supersortP :: SortAlg
supersortP Sortable
xs = Sortable -> (SortAlg, SortAlg, SortAlg, SupersortStrat) -> Sortable
supersort Sortable
xs (SortAlg
bubblesort, SortAlg
exchangesort, SortAlg
permutationsort, SupersortStrat
mundaneSuperStrat)

robustsortB :: [Bit] -> [Bit]
robustsortB :: [Bit] -> [Bit]
robustsortB [Bit]
xs = [Bit] -> TensortProps -> [Bit]
tensort [Bit]
xs (Bit -> SortAlg -> TensortProps
mkTSProps Bit
3 SortAlg
supersortB)

supersortB :: Sortable -> Sortable
supersortB :: SortAlg
supersortB Sortable
xs = Sortable -> (SortAlg, SortAlg, SortAlg, SupersortStrat) -> Sortable
supersort Sortable
xs (SortAlg
bubblesort, SortAlg
exchangesort, SortAlg
bogosort, SupersortStrat
mundaneSuperStrat)

robustsortM :: [Bit] -> [Bit]
robustsortM :: [Bit] -> [Bit]
robustsortM [Bit]
xs = [Bit] -> TensortProps -> [Bit]
tensort [Bit]
xs (Bit -> SortAlg -> TensortProps
mkTSProps Bit
3 SortAlg
supersortM)

supersortM :: Sortable -> Sortable
supersortM :: SortAlg
supersortM Sortable
xs = Sortable -> (SortAlg, SortAlg, SortAlg, SupersortStrat) -> Sortable
supersort Sortable
xs (SortAlg
bubblesort, SortAlg
exchangesort, SortAlg
magicsort, SupersortStrat
magicSuperStrat)