Document how GHC disambiguates between multiple COMPLETE sets
ClosedPublic

Authored by RyanGlScott on Sep 21 2017, 8:49 AM.

Details

Summary

Up until now, the knowledge of how GHC chooses which
COMPLETE set to use in the presence of multiple applicable
COMPLETE sets for a single data type constructor was only
documented in the GHC wiki. But this really should be advertised to
anyone who uses COMPLETE pragmas heavily, so per SPJ's advice in
https://ghc.haskell.org/trac/ghc/ticket/14253#comment:10, this adds
this wisdom to the GHC users' guide.

Test Plan

Read it

Diff Detail

Repository
rGHC Glasgow Haskell Compiler
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
RyanGlScott created this revision.Sep 21 2017, 8:49 AM
RyanGlScott edited the summary of this revision. (Show Details)Sep 21 2017, 9:01 AM
mpickering added inline comments.
docs/users_guide/glasgow_exts.rst
14090

This it the wrong way around I think. The Provenance is compared using derived equality and the lesser of the two is preferred. See Check.getResult

RyanGlScott marked an inline comment as done.
  • Fix point (4)
docs/users_guide/glasgow_exts.rst
14090

Huh, you are right! I must say that this is somewhat surprising to me, since I would expect it to be the other way around (a view I expressed in https://ghc.haskell.org/trac/ghc/ticket/13964#comment:4). But that's a battle for another time and place, so I'll update this Diff to accurately reflect the current behavior.

This revision was automatically updated to reflect the committed changes.