Permalink
Browse files

Super simple benchmark.

--HG--
extra : convert_revision : 58af672a865d716ec72572e86219a37d75adf659
  • Loading branch information...
1 parent 2436920 commit 85affc5f6eb6f523a5485104089a1c83631f827f @bos committed Jul 10, 2010
Showing with 13 additions and 0 deletions.
  1. +13 −0 benchmarks/Quickie.hs
View
13 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.