diff --git a/Haskell-Algorithms.cabal b/Haskell-Algorithms.cabal index bf6ccce..54babe4 100644 --- a/Haskell-Algorithms.cabal +++ b/Haskell-Algorithms.cabal @@ -34,17 +34,18 @@ executable Haskell-Algorithms -- LANGUAGE extensions used by modules in this package. -- other-extensions: - build-depends: base ^>=4.14.1.0, - time >=1.1, - random >=0.1, - array >= 0.5, - MonadRandom >= 0.5, - containers >= 0.1 - - other-modules: Timer, - Mergesort, - Quicksort, - ShuffleList + build-depends: base ^>=4.14.1.0, + time >=1.1, + random >=0.1, + array >= 0.5, + MonadRandom >= 0.5, + containers >= 0.1 + + other-modules: Timer, + Mergesort, + Quicksort, + ShuffleList, + STshuffle hs-source-dirs: app default-language: Haskell2010 diff --git a/app/Main.hs b/app/Main.hs index 9e8824e..a492fe9 100644 --- a/app/Main.hs +++ b/app/Main.hs @@ -4,14 +4,17 @@ import Mergesort(mergeSort) import System.Random import Control.Monad.Random -import ShuffleList(shuffle,fisherYates ) +import ShuffleList(shuffle) +import STshuffle(st_shuffle) ls = [1..8000] rev = reverse ls -xs = fisherYates ls +--xs = st_shuffle ls + main :: IO () main = do + values <- evalRandIO(shuffle ls) -- store Random[[Int]] to values list (unwrap monad) execute (quicksort values) execute (mergeSort values)