ghc-lib-parser-9.12.2.20250421: The GHC API, decoupled from GHC versions

Safe Haskell | Ignore
Language | GHC2021

GHC.Core.Stats

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 Source #

exprSize :: CoreExpr -> Int Source #

A measure of the size of the expressions, strictly greater than 0 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
- cs_vb :: !Int
- cs_jb :: !Int

#### Instances

Instances details

Outputable CoreStats Source # |
Instance details Defined in GHC.Core.Stats Methods ppr :: CoreStats -> SDoc Source #

coreBindsStats :: [CoreBind] -> CoreStats Source #

exprStats :: CoreExpr -> CoreStats Source #