freer-simple-profiling-0.1.0.0: Automatic profling of freer-simple programs

Copyright(c) Ben Weitzman 2018
LicenseMIT
Maintainerben@costarastrolgoy.com
Stabilityexperimental
PortabilityPOSIX
Safe HaskellNone
LanguageHaskell2010

Control.Monad.Freer.Profiling

Description

 
Synopsis

Documentation

profileEffect :: forall q r v. (Member (Writer EffectStats) r, Member IO r, Member q r, Named q) => Eff r v -> Eff r v Source #

Automatically time and count each individual effectful compoutation. An effect that is interpreted to another effect will count towards both effects, flame graph style.

class Named f Source #

Named is a typeclass that defines the type names and constructor names for effects. Effects are defined as GADTs, and unfortunately, GADTs don't work well with Generics or Data, so this is a small typeclass that can be implemented manually to provide the info the profiler needs.

Minimal complete definition

getDataTypeName, getConstructorName

forEachStat :: Monad m => EffectStats -> (String -> String -> SingleEffectStats -> m ()) -> m () Source #

Iterate through each indivudal stat

drawEffectStats :: EffectStats -> String Source #

Pretty print the effect stats