[GHC] #7989: "No constructor has all these fields" message can be improved
GHC
ghc-devs at haskell.org
Thu Jun 20 13:21:13 CEST 2013
#7989: "No constructor has all these fields" message can be improved
---------------------------------+------------------------------------------
Reporter: akio | Owner:
Type: feature request | Status: patch
Priority: normal | Milestone:
Component: Compiler | Version: 7.7
Keywords: | Os: Unknown/Multiple
Architecture: Unknown/Multiple | Failure: Other
Difficulty: Unknown | Testcase:
Blockedby: | Blocking:
Related: |
---------------------------------+------------------------------------------
Comment(by simonpj):
OK.... It's not easy to understand that code! Maybe it would be worth a
few more named intermediate values, with types, and a comment?
You could produce a very big set when a very small set exists, couldn't
you?
Could you ameliorate that as follows? Use `T` to mean the data type of
the first field in `rbinds`.
* Sort the `membership` list in order of increasing number of `True`
fields. So the earlier fields `f` in the list have few `T` constructors
that have field `f`.
* Now a field with a different type will be right at the front of the
list.
* And the `(&&)` process will terminate more quickly because of all the
`False` items.
Simon
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/7989#comment:7>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list