mirror of
https://github.com/ekmett/speculation.git
synced 2024-11-30 00:49:00 +03:00
15 lines
217 B
Haskell
15 lines
217 B
Haskell
module Main where
|
|
|
|
import Criterion.Main
|
|
|
|
fib :: Int -> Int
|
|
fib 0 = 0
|
|
fib 1 = 1
|
|
fib n = fib (n - 1) + fib (n - 2)
|
|
|
|
main :: IO ()
|
|
main = defaultMain
|
|
[ bench "fib 1" $ nf fib 1
|
|
, bench "fib 2" $ nf fib 2
|
|
]
|