Skip to content

ApplicativeDo is too strict with newtype patterns

The fix to #13875 (closed) went a little too far, and interprets newtype constructor patterns as strict. It's not clear to me how to fix this, as the Name of the constructor doesn't seem to give any clue as to whether it is a newtype constructor or a data constructor. The comment at the top of basicTypes/Name.hs indicates

-- *  'Name.Name' is the type of names that have had their scoping and binding resolved. They
--   have an 'OccName.OccName' but also a 'Unique.Unique' that disambiguates Names that have
--   the same 'OccName.OccName' and indeed is used for all 'Name.Name' comparison. Names
--   also contain information about where they originated from, see "Name#name_sorts"

which suggests that this information should be available, but I don't know what's involved in propagating it to the right place.

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