HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Modulecriterion-measurement-0.2.3.0Haskell2010

Criterion.Measurement.Types.Internal

  • 1 type
  • 3 values
valuefakeEnvironment :: env
#

A dummy environment that is passed to functions that create benchmarks from environments when no concrete environment is available.

valuenf' :: (b -> ()) -> (a -> b) -> a -> Int64 -> IO ()
#

Generate a function which applies an argument to a function a given number of times, reducing the result to normal form.

valuewhnf' :: (a -> b) -> a -> Int64 -> IO ()
#

Generate a function which applies an argument to a function a given number of times.

datadata SPEC
#

SPEC is used by GHC in the SpecConstr pass in order to inform the compiler when to be particularly aggressive. In particular, it tells GHC to specialize regardless of size or the number of specializations. However, not all loops fall into this category.

Libraries can specify this by using SPEC data type to inform which loops should be aggressively specialized. For example, instead of

loop x where loop arg = ...

write

loop SPEC x where loop !_ arg = ...

There is no semantic difference between SPEC and SPEC2, we just need a type with two constructors lest it is optimised away before SpecConstr.

This type is reexported from GHC.Exts since GHC 9.0 and base-4.15. For compatibility with earlier releases import it from GHC.Types in ghc-prim package.