Skip to content

Error thunks not being exposed with "B" strictness

At the moment GHC often floats error "urk" to the top level (which it should), after the strictness analyser. But since it's after strictness analysis, the exported thing doesn't have a strictness signature saying "I am a diverging term", which in turn loses useful optimisations in importing modules.

An example is test T3286. If you compile it with -O --ddump-simpl, you'll see stuff like

     case T3286b.$fFractionalLogFloat3
          `cast` (CoUnsafe T3286b.LogFloat GHC.Prim.Double#
                  :: T3286b.LogFloat ~ GHC.Prim.Double#)
     of ww2_aGk { __DEFAULT ->
     (GHC.Types.D# ww2_aGk)
     `cast` (sym T3286b.NTCo:LogFloat
             :: GHC.Types.Double ~ T3286b.LogFloat)

But if you look at T3286b.$fFractionalLogFloat3, it turns out to be bottom, so the case should be eliminated.

This is a long-standing infelicity; I'm making a ticket so I don't forget it.

Trac metadata
Trac field Value
Version 6.11
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information