Commits

Bryan O'Sullivan committed 5efe521

Simplify the type of the B tuple.

Comments (0)

Files changed (1)

Criterion/Types.hs

+{-# LANGUAGE ExistentialQuantification, FlexibleInstances, GADTs #-}
+
 -- |
 -- Module      : Criterion.Types
 -- Copyright   : (c) Bryan O'Sullivan 2009
 -- For an action of type @IO a@, the benchmarking harness calls the
 -- action repeatedly, but does not reduce the result.
 
-{-# LANGUAGE FlexibleInstances, GADTs #-}
 module Criterion.Types
     (
       Benchmarkable(..)
 
 -- | A container for a pure function to benchmark, and an argument to
 -- supply to it each time it is evaluated.
-data B a b = B (a -> b) a
+data B a = forall b. B (a -> b) a
 
 instance Benchmarkable (a -> b, a) where
     run fx@(f,x) n
         | otherwise = evaluate (f x) >> run fx (n-1)
     {-# INLINE run #-}
 
-instance Benchmarkable (B a b) where
+instance Benchmarkable (B a) where
     run fx@(B f x) n
         | n <= 0    = return ()
         | otherwise = evaluate (f x) >> run fx (n-1)