-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Library for parsing GHC time and allocation profiling reports
--   
--   ghc-prof is a library for parsing GHC time and allocation profiling
--   reports.
@package ghc-prof
@version 1.4.1.3

module GHC.Prof.Types

-- | Top-level profiling report
data Profile
Profile :: !LocalTime -> !Text -> !TotalTime -> !TotalAlloc -> [AggregatedCostCentre] -> !CostCentreTree -> Profile
[profileTimestamp] :: Profile -> !LocalTime
[profileCommandLine] :: Profile -> !Text
[profileTotalTime] :: Profile -> !TotalTime
[profileTotalAlloc] :: Profile -> !TotalAlloc
[profileTopCostCentres] :: Profile -> [AggregatedCostCentre]
[profileCostCentreTree] :: Profile -> !CostCentreTree

-- | <tt>total time</tt> in the profiling reports
data TotalTime
TotalTime :: !DiffTime -> !Integer -> !DiffTime -> !(Maybe Int) -> TotalTime

-- | Total elapsed time in seconds
[totalTimeElapsed] :: TotalTime -> !DiffTime

-- | Total number of ticks
[totalTimeTicks] :: TotalTime -> !Integer

-- | Duration of a tick
[totalTimeResolution] :: TotalTime -> !DiffTime

-- | Number of processors
[totalTimeProcessors] :: TotalTime -> !(Maybe Int)

-- | <tt>total alloc</tt> in the profiling reports
newtype TotalAlloc
TotalAlloc :: Integer -> TotalAlloc

-- | Total memory allocation in bytes
[totalAllocBytes] :: TotalAlloc -> Integer
data AggregatedCostCentre
AggregatedCostCentre :: !Text -> !Text -> !(Maybe Text) -> !(Maybe Integer) -> !Scientific -> !Scientific -> !(Maybe Integer) -> !(Maybe Integer) -> AggregatedCostCentre

-- | Name of the cost-centre
[aggregatedCostCentreName] :: AggregatedCostCentre -> !Text

-- | Module name of the cost-centre
[aggregatedCostCentreModule] :: AggregatedCostCentre -> !Text

-- | Source location of the cost-centre
[aggregatedCostCentreSrc] :: AggregatedCostCentre -> !(Maybe Text)

-- | Number of entries to the cost-centre
[aggregatedCostCentreEntries] :: AggregatedCostCentre -> !(Maybe Integer)

-- | Total time spent in the cost-centre
[aggregatedCostCentreTime] :: AggregatedCostCentre -> !Scientific

-- | Total allocation in the cost-centre
[aggregatedCostCentreAlloc] :: AggregatedCostCentre -> !Scientific

-- | Total ticks in the cost-centre. This number exists only if <tt>-P</tt>
--   or <tt>-Pa</tt> option is given at run-time.
[aggregatedCostCentreTicks] :: AggregatedCostCentre -> !(Maybe Integer)

-- | Total memory allocation in the cost-centre. This number exists only if
--   <tt>-P</tt> or <tt>-Pa</tt> option is given at run-time.
[aggregatedCostCentreBytes] :: AggregatedCostCentre -> !(Maybe Integer)

-- | Cost-centre node
data CostCentre
CostCentre :: !CostCentreNo -> !Text -> !Text -> !(Maybe Text) -> !Integer -> !Scientific -> !Scientific -> !Scientific -> !Scientific -> !(Maybe Integer) -> !(Maybe Integer) -> CostCentre

-- | Identifier of the cost-centre
[costCentreNo] :: CostCentre -> !CostCentreNo

-- | Name of the cost-centre
[costCentreName] :: CostCentre -> !Text

-- | Module name of the cost-centre
[costCentreModule] :: CostCentre -> !Text

-- | Source location of the cost-centre
[costCentreSrc] :: CostCentre -> !(Maybe Text)

-- | Number of entries to the cost-centre
[costCentreEntries] :: CostCentre -> !Integer

-- | Time spent in the cost-centre itself
[costCentreIndTime] :: CostCentre -> !Scientific

-- | Allocation incurred by the cost-centre itself
[costCentreIndAlloc] :: CostCentre -> !Scientific

-- | Time spent in the cost-centre's children
[costCentreInhTime] :: CostCentre -> !Scientific

-- | Allocation incurred by the cost-centre's children
[costCentreInhAlloc] :: CostCentre -> !Scientific

-- | Number of ticks in the cost-centre.
[costCentreTicks] :: CostCentre -> !(Maybe Integer)

-- | Number of allocated bytes in the cost-centre.
[costCentreBytes] :: CostCentre -> !(Maybe Integer)
type CostCentreNo = Int
data CostCentreTree
CostCentreTree :: !(IntMap CostCentre) -> !(IntMap CostCentreNo) -> !(IntMap (Set CostCentre)) -> !(Map (Text, Text) (Set CostCentre)) -> !(Map Text (Map Text AggregatedCostCentre)) -> CostCentreTree
[costCentreNodes] :: CostCentreTree -> !(IntMap CostCentre)
[costCentreParents] :: CostCentreTree -> !(IntMap CostCentreNo)
[costCentreChildren] :: CostCentreTree -> !(IntMap (Set CostCentre))
[costCentreCallSites] :: CostCentreTree -> !(Map (Text, Text) (Set CostCentre))
[costCentreAggregate] :: CostCentreTree -> !(Map Text (Map Text AggregatedCostCentre))
emptyCostCentreTree :: CostCentreTree
data CallSite cc
CallSite :: cc -> !Integer -> !Scientific -> !Scientific -> !(Maybe Integer) -> !(Maybe Integer) -> CallSite cc

-- | Metrics for the caller function
[callSiteCostCentre] :: CallSite cc -> cc

-- | Number of entries contriubted by the caller function
[callSiteContribEntries] :: CallSite cc -> !Integer

-- | Time contributed by the caller function
[callSiteContribTime] :: CallSite cc -> !Scientific

-- | Allocation contributed by the caller function
[callSiteContribAlloc] :: CallSite cc -> !Scientific

-- | Number of tikcs contributed by the caller function
[callSiteContribTicks] :: CallSite cc -> !(Maybe Integer)

-- | Number of allocated bytes contributed byt hte caller function
[callSiteContribBytes] :: CallSite cc -> !(Maybe Integer)
data AggregateModule
AggregateModule :: !Text -> !(Maybe Integer) -> !Scientific -> !Scientific -> !(Maybe Integer) -> !(Maybe Integer) -> AggregateModule

-- | Name of the module
[aggregateModuleName] :: AggregateModule -> !Text

-- | Total number of entries to cost centres in the module
[aggregateModuleEntries] :: AggregateModule -> !(Maybe Integer)

-- | Total time spent on cost centres in the module
[aggregateModuleTime] :: AggregateModule -> !Scientific

-- | Total allocation on cost centres in the module
[aggregateModuleAlloc] :: AggregateModule -> !Scientific

-- | Total ticks on cost centres in the module. This number exists only if
--   <tt>-P</tt> or <tt>-Pa</tt> option is given at run-time.
[aggregateModuleTicks] :: AggregateModule -> !(Maybe Integer)

-- | Total memory allocation on cost centres in the module. This number
--   exists only if <tt>-P</tt> or <tt>-Pa</tt> option is given at
--   run-time.
[aggregateModuleBytes] :: AggregateModule -> !(Maybe Integer)
emptyAggregateModule :: Text -> AggregateModule
instance GHC.Classes.Ord GHC.Prof.Types.AggregateModule
instance GHC.Classes.Eq GHC.Prof.Types.AggregateModule
instance GHC.Show.Show GHC.Prof.Types.AggregateModule
instance GHC.Show.Show cc => GHC.Show.Show (GHC.Prof.Types.CallSite cc)
instance GHC.Show.Show GHC.Prof.Types.Profile
instance GHC.Show.Show GHC.Prof.Types.CostCentreTree
instance GHC.Classes.Ord GHC.Prof.Types.CostCentre
instance GHC.Classes.Eq GHC.Prof.Types.CostCentre
instance GHC.Show.Show GHC.Prof.Types.CostCentre
instance GHC.Classes.Ord GHC.Prof.Types.AggregatedCostCentre
instance GHC.Classes.Eq GHC.Prof.Types.AggregatedCostCentre
instance GHC.Show.Show GHC.Prof.Types.AggregatedCostCentre
instance GHC.Show.Show GHC.Prof.Types.TotalAlloc
instance GHC.Show.Show GHC.Prof.Types.TotalTime

module GHC.Prof.Parser

-- | Parse a GHC time-allocation profiling report
profile :: Parser Profile

-- | Parse the timestamp in a header as local time
timestamp :: Parser LocalTime
title :: Parser Text
commandLine :: Parser Text
totalTime :: Parser TotalTime
totalAlloc :: Parser TotalAlloc
topCostCentres :: Parser [AggregatedCostCentre]
aggregatedCostCentre :: HeaderParams -> Parser AggregatedCostCentre
costCentres :: Parser CostCentreTree
costCentre :: HeaderParams -> Parser CostCentre
instance GHC.Show.Show GHC.Prof.Parser.HeaderParams

module GHC.Prof.CostCentreTree

-- | Build a list of cost-centres from a profiling report ordered by the
--   time spent and the amount of allocation.
aggregatedCostCentres :: Profile -> [AggregatedCostCentre]

-- | Build a list of cost-centres from a profling report ordered by the
--   given key.
aggregatedCostCentresOrderBy :: Ord a => (AggregatedCostCentre -> a) -> Profile -> [AggregatedCostCentre]

-- | Build a tree of cost-centres from a profiling report.
costCentres :: Profile -> Maybe (Tree CostCentre)

-- | Build a tree of cost-centres from a profiling report. Nodes are sorted
--   by the given key function for each level of the tree.
costCentresOrderBy :: Ord a => (CostCentre -> a) -> Profile -> Maybe (Tree CostCentre)

-- | Build a list of call sites (caller functions of a cost centre)
--   aggregated by their cost centre names and module names.
aggregateCallSites :: Text -> Text -> Profile -> Maybe (AggregatedCostCentre, [CallSite AggregatedCostCentre])

-- | Build a list of call sites (caller functions of a cost centre)
--   aggregated by their cost centre names and module names. Call sites are
--   sorted by the given key function.
aggregateCallSitesOrderBy :: Ord a => (CallSite AggregatedCostCentre -> a) -> Text -> Text -> Profile -> Maybe (AggregatedCostCentre, [CallSite AggregatedCostCentre])

-- | Build a list of call-sites (caller functions) for a specified
--   cost-centre name and module name.
callSites :: Text -> Text -> Profile -> Maybe (AggregatedCostCentre, [CallSite CostCentre])

-- | Build a list of call-sites (caller function) for a specified
--   cost-centre name and module name. Nodes are sorted by the given key
--   function.
callSitesOrderBy :: Ord a => (CallSite CostCentre -> a) -> Text -> Text -> Profile -> Maybe (AggregatedCostCentre, [CallSite CostCentre])

-- | Break down aggregate cost centres by module sorted by total time and
--   allocation.
aggregateModules :: Profile -> [AggregateModule]

-- | Break odwn aggregate cost centres by module.
aggregateModulesOrderBy :: Ord a => (AggregateModule -> a) -> Profile -> [AggregateModule]
buildAggregatedCostCentresOrderBy :: Ord a => (AggregatedCostCentre -> a) -> CostCentreTree -> [AggregatedCostCentre]
buildCostCentresOrderBy :: Ord a => (CostCentre -> a) -> CostCentreTree -> Maybe (Tree CostCentre)
buildCallSitesOrderBy :: Ord a => (CallSite CostCentre -> a) -> Text -> Text -> CostCentreTree -> Maybe (AggregatedCostCentre, [CallSite CostCentre])
buildAggregateCallSitesOrderBy :: Ord a => (CallSite AggregatedCostCentre -> a) -> Text -> Text -> CostCentreTree -> Maybe (AggregatedCostCentre, [CallSite AggregatedCostCentre])

module GHC.Prof

-- | Decode a GHC time allocation profiling report from a lazy <a>Text</a>
decode :: Text -> Either String Profile

-- | Decode a GHC time allocation profiling report from a strict
--   <a>Text</a>
decode' :: Text -> Either String Profile

-- | Parse a GHC time-allocation profiling report
profile :: Parser Profile
data CostCentreTree

-- | Build a list of cost-centres from a profiling report ordered by the
--   time spent and the amount of allocation.
aggregatedCostCentres :: Profile -> [AggregatedCostCentre]

-- | Build a list of cost-centres from a profling report ordered by the
--   given key.
aggregatedCostCentresOrderBy :: Ord a => (AggregatedCostCentre -> a) -> Profile -> [AggregatedCostCentre]

-- | Build a tree of cost-centres from a profiling report.
costCentres :: Profile -> Maybe (Tree CostCentre)

-- | Build a tree of cost-centres from a profiling report. Nodes are sorted
--   by the given key function for each level of the tree.
costCentresOrderBy :: Ord a => (CostCentre -> a) -> Profile -> Maybe (Tree CostCentre)

-- | Build a list of call sites (caller functions of a cost centre)
--   aggregated by their cost centre names and module names.
aggregateCallSites :: Text -> Text -> Profile -> Maybe (AggregatedCostCentre, [CallSite AggregatedCostCentre])

-- | Build a list of call sites (caller functions of a cost centre)
--   aggregated by their cost centre names and module names. Call sites are
--   sorted by the given key function.
aggregateCallSitesOrderBy :: Ord a => (CallSite AggregatedCostCentre -> a) -> Text -> Text -> Profile -> Maybe (AggregatedCostCentre, [CallSite AggregatedCostCentre])

-- | Build a list of call-sites (caller functions) for a specified
--   cost-centre name and module name.
callSites :: Text -> Text -> Profile -> Maybe (AggregatedCostCentre, [CallSite CostCentre])

-- | Build a list of call-sites (caller function) for a specified
--   cost-centre name and module name. Nodes are sorted by the given key
--   function.
callSitesOrderBy :: Ord a => (CallSite CostCentre -> a) -> Text -> Text -> Profile -> Maybe (AggregatedCostCentre, [CallSite CostCentre])

-- | Break down aggregate cost centres by module sorted by total time and
--   allocation.
aggregateModules :: Profile -> [AggregateModule]

-- | Break odwn aggregate cost centres by module.
aggregateModulesOrderBy :: Ord a => (AggregateModule -> a) -> Profile -> [AggregateModule]

-- | Top-level profiling report
data Profile
Profile :: !LocalTime -> !Text -> !TotalTime -> !TotalAlloc -> [AggregatedCostCentre] -> !CostCentreTree -> Profile
[profileTimestamp] :: Profile -> !LocalTime
[profileCommandLine] :: Profile -> !Text
[profileTotalTime] :: Profile -> !TotalTime
[profileTotalAlloc] :: Profile -> !TotalAlloc
[profileTopCostCentres] :: Profile -> [AggregatedCostCentre]
[profileCostCentreTree] :: Profile -> !CostCentreTree

-- | <tt>total time</tt> in the profiling reports
data TotalTime
TotalTime :: !DiffTime -> !Integer -> !DiffTime -> !(Maybe Int) -> TotalTime

-- | Total elapsed time in seconds
[totalTimeElapsed] :: TotalTime -> !DiffTime

-- | Total number of ticks
[totalTimeTicks] :: TotalTime -> !Integer

-- | Duration of a tick
[totalTimeResolution] :: TotalTime -> !DiffTime

-- | Number of processors
[totalTimeProcessors] :: TotalTime -> !(Maybe Int)

-- | <tt>total alloc</tt> in the profiling reports
newtype TotalAlloc
TotalAlloc :: Integer -> TotalAlloc

-- | Total memory allocation in bytes
[totalAllocBytes] :: TotalAlloc -> Integer
data AggregatedCostCentre
AggregatedCostCentre :: !Text -> !Text -> !(Maybe Text) -> !(Maybe Integer) -> !Scientific -> !Scientific -> !(Maybe Integer) -> !(Maybe Integer) -> AggregatedCostCentre

-- | Name of the cost-centre
[aggregatedCostCentreName] :: AggregatedCostCentre -> !Text

-- | Module name of the cost-centre
[aggregatedCostCentreModule] :: AggregatedCostCentre -> !Text

-- | Source location of the cost-centre
[aggregatedCostCentreSrc] :: AggregatedCostCentre -> !(Maybe Text)

-- | Number of entries to the cost-centre
[aggregatedCostCentreEntries] :: AggregatedCostCentre -> !(Maybe Integer)

-- | Total time spent in the cost-centre
[aggregatedCostCentreTime] :: AggregatedCostCentre -> !Scientific

-- | Total allocation in the cost-centre
[aggregatedCostCentreAlloc] :: AggregatedCostCentre -> !Scientific

-- | Total ticks in the cost-centre. This number exists only if <tt>-P</tt>
--   or <tt>-Pa</tt> option is given at run-time.
[aggregatedCostCentreTicks] :: AggregatedCostCentre -> !(Maybe Integer)

-- | Total memory allocation in the cost-centre. This number exists only if
--   <tt>-P</tt> or <tt>-Pa</tt> option is given at run-time.
[aggregatedCostCentreBytes] :: AggregatedCostCentre -> !(Maybe Integer)

-- | Cost-centre node
data CostCentre
CostCentre :: !CostCentreNo -> !Text -> !Text -> !(Maybe Text) -> !Integer -> !Scientific -> !Scientific -> !Scientific -> !Scientific -> !(Maybe Integer) -> !(Maybe Integer) -> CostCentre

-- | Identifier of the cost-centre
[costCentreNo] :: CostCentre -> !CostCentreNo

-- | Name of the cost-centre
[costCentreName] :: CostCentre -> !Text

-- | Module name of the cost-centre
[costCentreModule] :: CostCentre -> !Text

-- | Source location of the cost-centre
[costCentreSrc] :: CostCentre -> !(Maybe Text)

-- | Number of entries to the cost-centre
[costCentreEntries] :: CostCentre -> !Integer

-- | Time spent in the cost-centre itself
[costCentreIndTime] :: CostCentre -> !Scientific

-- | Allocation incurred by the cost-centre itself
[costCentreIndAlloc] :: CostCentre -> !Scientific

-- | Time spent in the cost-centre's children
[costCentreInhTime] :: CostCentre -> !Scientific

-- | Allocation incurred by the cost-centre's children
[costCentreInhAlloc] :: CostCentre -> !Scientific

-- | Number of ticks in the cost-centre.
[costCentreTicks] :: CostCentre -> !(Maybe Integer)

-- | Number of allocated bytes in the cost-centre.
[costCentreBytes] :: CostCentre -> !(Maybe Integer)
type CostCentreNo = Int
data CallSite cc
CallSite :: cc -> !Integer -> !Scientific -> !Scientific -> !(Maybe Integer) -> !(Maybe Integer) -> CallSite cc

-- | Metrics for the caller function
[callSiteCostCentre] :: CallSite cc -> cc

-- | Number of entries contriubted by the caller function
[callSiteContribEntries] :: CallSite cc -> !Integer

-- | Time contributed by the caller function
[callSiteContribTime] :: CallSite cc -> !Scientific

-- | Allocation contributed by the caller function
[callSiteContribAlloc] :: CallSite cc -> !Scientific

-- | Number of tikcs contributed by the caller function
[callSiteContribTicks] :: CallSite cc -> !(Maybe Integer)

-- | Number of allocated bytes contributed byt hte caller function
[callSiteContribBytes] :: CallSite cc -> !(Maybe Integer)
data AggregateModule
AggregateModule :: !Text -> !(Maybe Integer) -> !Scientific -> !Scientific -> !(Maybe Integer) -> !(Maybe Integer) -> AggregateModule

-- | Name of the module
[aggregateModuleName] :: AggregateModule -> !Text

-- | Total number of entries to cost centres in the module
[aggregateModuleEntries] :: AggregateModule -> !(Maybe Integer)

-- | Total time spent on cost centres in the module
[aggregateModuleTime] :: AggregateModule -> !Scientific

-- | Total allocation on cost centres in the module
[aggregateModuleAlloc] :: AggregateModule -> !Scientific

-- | Total ticks on cost centres in the module. This number exists only if
--   <tt>-P</tt> or <tt>-Pa</tt> option is given at run-time.
[aggregateModuleTicks] :: AggregateModule -> !(Maybe Integer)

-- | Total memory allocation on cost centres in the module. This number
--   exists only if <tt>-P</tt> or <tt>-Pa</tt> option is given at
--   run-time.
[aggregateModuleBytes] :: AggregateModule -> !(Maybe Integer)
