sampling

Basic sampling functionality for Haskell.
git clone git://git.jtobin.io/sampling.git
Log | Files | Refs | README | LICENSE

Main.hs (357B)


      1 {-# OPTIONS_GHC -fno-warn-type-defaults #-}
      2 
      3 module Main where
      4 
      5 import Criterion.Main
      6 import Numeric.Sampling (sampleIO, resampleIO)
      7 
      8 main :: IO ()
      9 main = defaultMain [
     10   env (return ([1..10000] :: [Int])) $ \x ->
     11       bgroup "benchmarks" [
     12         bench "sample"   $ nfIO (sampleIO 100 x)
     13       , bench "resample" $ nfIO (resampleIO 100 x)
     14       ]
     15     ]
     16