{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeFamilies #-}
module Crypto.Lol.Utils.Benchmarks
(mkBench, mkBenchIO
,C.bgroup, C.Benchmark) where
import Control.DeepSeq
import qualified Criterion as C
mkBench :: NFData b => String -> (a -> b) -> a -> C.Benchmark
mkBench name f input = C.bench name $ C.nf f input
mkBenchIO :: NFData b => String -> IO b -> C.Benchmark
mkBenchIO name i = C.bench name $ C.nfIO i