ghc-8.2.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
  - cs_vb :: Int
  - cs_jb :: Int
  }
- coreBindsStats :: [CoreBind] -> CoreStats
- exprStats :: CoreExpr -> CoreStats

# Expression and bindings size

coreBindsSize :: [CoreBind] -> Int #

exprSize :: CoreExpr -> Int #

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 #

Constructors

CS |

Fields

- cs_tm :: Int
- cs_ty :: Int
- cs_co :: Int
- cs_vb :: Int
- cs_jb :: Int

Instances

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

coreBindsStats :: [CoreBind] -> CoreStats #

exprStats :: CoreExpr -> CoreStats #