packages feed

wordchoice-0.1.2.7 / bench / Bench.hs

module Main whereimport           Criterion.Mainimport           Data.Text.Lazy      (fromStrict)import           Data.Text.WordCountimport           Text.Pandocmain = do    defaultMain [ env ulysses $ \file ->                  bgroup "ulysses all"                      [ bench "226" $ nf (fun 10000000) file ]                , env beowulf $ \file ->                  bgroup "beowulf all"                      [ bench "226" $ nf (fun 10000000) file ] ]    where fun n   = topN n . fromStrict          ulysses = runIOorExplode $ processFile "test/ulysses.txt"          beowulf = runIOorExplode $ processFile "test/beowulf.txt"