ghc-8.0.2: The GHC API

Safe Haskell | None
Language | Haskell2010

CoreStats

Contents

- Expression and bindings size

Description

Functions to computing the statistics reflective of the "size" of a Core expression

Synopsis

- coreBindsSize :: [CoreBind] -> Int
- exprSize :: CoreExpr -> Int
- data CoreStats = CS {
  - cs_tm :: Int
  - cs_ty :: Int
  - cs_co :: Int
  }
- coreBindsStats :: [CoreBind] -> CoreStats
- exprStats :: CoreExpr -> CoreStats

# Expression and bindings size

coreBindsSize :: [CoreBind] -> Int Source #

exprSize :: CoreExpr -> Int Source #

A measure of the size of the expressions, strictly greater than 0 It also forces the expression pretty drastically as a side effect Counts *leaves*, not internal nodes. Types and coercions are not counted.

data CoreStats Source #

Constructors

CS |
Fields cs_tm :: Int cs_ty :: Int cs_co :: Int

Instances

Outputable CoreStats # |
Methods ppr :: CoreStats -> SDoc Source # pprPrec :: Rational -> CoreStats -> SDoc Source #

coreBindsStats :: [CoreBind] -> CoreStats Source #

exprStats :: CoreExpr -> CoreStats Source #