Skip to content

Commit

Permalink
Super simple benchmark.
Browse files Browse the repository at this point in the history
--HG--
extra : convert_revision : 58af672a865d716ec72572e86219a37d75adf659
  • Loading branch information
bos committed Jul 10, 2010
1 parent 2436920 commit 85affc5
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions benchmarks/Quickie.hs
@@ -0,0 +1,13 @@
{-# LANGUAGE BangPatterns #-}
import System.Random.MWC (create, uniform)
import Control.Monad.ST (ST, runST)

u :: ST s Double
u = do
let last = 1000000 :: Int
gen <- create
let loop !n !i | n == last = return i
| otherwise = uniform gen >>= loop (n+1)
loop 0 0

main = print (runST u)

0 comments on commit 85affc5

Please sign in to comment.