h*      0.2.0 Safe-Inferred timestats)Formats an int with a thousand separator. For instance :formatIntWithSeparator '_' 123456789 "a" == "123_456_789a" Safe-Inferred  timestats:Reports how much time (in nanoseconds) the invocations to  took for a given label and how many times it was invoked on a given label. timestatsA reference to a  value timestats,Measure the time it takes to run the action.Add the time to the stats of the given label and increase its count by one. keeps the stats in a globally available store in order to minimize the changes necessary when instrumenting a program. Otherwise a reference to the store would need to be passed to every function that might invoke functions that need this reference.A time measure isn't collected if the given action fails with an exception. This is a deliberate choice to demand less of the monad in which measures are taken.Time measures aren't collected either if the environment variable DEBUG_TIMESTATS_ENABLE6 isn't set the first time this function is evaluated.Monads that run the continuation of bind multiple times might only have accounted the time to run the first time only. timestatsLike > but allows to change the function to lift IO into the monad. timestatsPure version of . Measures the time taken to reduce the given value to head normal form. is a bit dangerous to use in contexts where there are monadic computations. If  is applied to a monadic computation it will measure the time of constructing the computation rather than the time of executing it, and the typechecker won't catch the mistake. We try to fence against it with a longer name.  timestatsTrue iff the environment variable DEBUG_TIMESTATS_ENABLE is set to any valueWe assume the value of the environment variable doesn't change during the lifetime of the program.The purpose of making this a top-level value is to have all calls to  checking it only the first time. Thus we save the trouble of looking up the environment variable repeteadly. timestatsA unique global reference to the map associating labels to their stats.  timestats%Set all statistics to initial values.  timestatsRun an action by previously reseting all stats to initial values and printing them afterwards.  timestatsLooks up the stats of a label. If no stats are found for the label, a new TimeStatsRef is created with initial values.  timestats3Yields the labels and the stats collected thus far. timestats*Prints the time stats to the given handle. timestats Prints the time stats to stderr. timestats0Renders the given time stats in a tabular format timestats'Measured time is 0 and call count is 0. timestats4Creates a reference to time stats with intial values timestatsMeasure the time it takes to run the given action and update with it the given reference to time stats, using the given IO lifting function. timestats'Updates the TimeStats in a TimeStatsRef         Safe-Inferred timestatsLike  but can measure other monads.This function relies on a hack to perform IO in any monad, which does not always work. In particular, we can expect it to miss time in monads where seq (m >>= \_ -> undefined) () == undefined -- for some computation m,An example of such a monad is the list monad .seq ([()] >>= \_ -> undefined) () == undefinedAnother example is the monad Control.Monad.Free.Free f. seq (return () >>= \_ -> undefined :: Free IO ()) () == undefined/But it seems to work in monads with state like IO,  ReaderT IO, and Control.Monad.State.State s. seq (return () >>= \_ -> undefined :: YourMonadHere ()) () == () timestats-Hack to intersperse IO actions into any monad     ×tats-0.2.0-4Di7cAReZbkJwZyiuE3bFODebug.TimeStats.InternalDebug.TimeStatsDebug.TimeStats.Unsafe timestatsmeasureMformatIntWithSeparator TimeStatstimeStat countStat TimeStatsRefmeasureMWithLiftIO measurePureenabledresetscopelookupTimeStatsRefcollecthPrintTimeStatsprintTimeStatsasTextupdateTimeStatsRef$fShowTimeStatsunsafeMeasureMlabelStatsMapRefinitialTimeStatsnewTimeStatsRefmeasureMWithRefintersperseIOinM