Opened 4 years ago

Closed 3 years ago

#9970 closed feature request (fixed)

Export more types in GHC.RTS.Flags

Reported by: RyanGlScott Owned by: RyanGlScott
Priority: normal Milestone: 7.10.3
Component: libraries/base Version: 7.10.1-rc1
Keywords: Cc: hvr, ekmett
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Other Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s): Phab:D1030
Wiki Page:


There are some ADTs in GHC.RTS.Flags that have arguments whose types are not exported. These types are:

  • GiveGCStats (found in GCFlags)
  • DoCostCentres (found in CCFlags)
  • DoHeapProfile (found in ProfFlags)
  • DoTrace (found in TraceFlags)

This makes it pretty difficult to do anything useful with them, since they can't be pattern-matched.

In addition, there are some unexported type synonyms:

  • type Time = Word64
  • type Nat = #{type unsigned int} (likely a Word32)

The Haddock docs for GHC.RTS.Flags don't give much of an indication of what Time and Nat are, and since they're already documented in the source, they should probably be exported.

Change History (8)

comment:1 Changed 4 years ago by ezyang

Milestone: 7.10.1

Let's try to fix this for 7.10. Can someone contribute a patch?

comment:2 Changed 4 years ago by thoughtpolice


Moving to 7.12.1 milestone.

comment:3 Changed 4 years ago by RyanGlScott

Differential Rev(s): Phab:D1030
Owner: set to RyanGlScott

comment:4 Changed 4 years ago by Ben Gamari <ben@…>

In 1967a52df5bea5539e46393fa0da0a1ebd6d9db8/ghc:

Export more types from GHC.RTS.Flags (#9970)

Export the data types `GiveGCStats`, `DoCostCentres`, `DoHeapProfiles`,
and `DoTrace`, as well as the type synonyms `Time` and `RtsNat`. The
above data types appear as fields in the `-Stats` data types in
`GHC.RTS.Flags`, but since they only have `Show` instances, it is
practically impossible to due anything useful with the above types
unless they are exported.

Reviewers: hvr, ekmett, austin, ezyang, bgamari

Reviewed By: bgamari

Subscribers: thomie, bgamari

Differential Revision:

GHC Trac Issues: #9970

comment:5 Changed 4 years ago by bgamari

Status: newmerge

comment:6 Changed 4 years ago by bgamari

Resolution: fixed
Status: mergeclosed

comment:7 Changed 4 years ago by bgamari

Status: closedmerge

comment:8 Changed 3 years ago by bgamari

Status: mergeclosed

Merged to ghc-7.10 as e435b0a.

Note: See TracTickets for help on using tickets.