[GHC] #9580: Possible excessive leniency in interaction between coerce and data families?

GHC ghc-devs at haskell.org
Fri Sep 19 12:34:40 UTC 2014


#9580: Possible excessive leniency in interaction between coerce and data
families?
-------------------------------------+-------------------------------------
              Reporter:  dmcclean    |            Owner:  simonpj
                  Type:  bug         |           Status:  closed
              Priority:  low         |        Milestone:
             Component:  Compiler    |          Version:  7.8.3
  (Type checker)                     |         Keywords:
            Resolution:  fixed       |     Architecture:  Unknown/Multiple
      Operating System:              |       Difficulty:  Unknown
  Unknown/Multiple                   |       Blocked By:
       Type of failure:              |  Related Tickets:
  None/Unknown                       |
             Test Case:  indexed-    |
  types/should_fail/T9580            |
              Blocking:              |
Differential Revisions:              |
-------------------------------------+-------------------------------------

Comment (by dmcclean):

 I think I may have been confused for 2 different reasons.

 First, I forgot that we are coercing in your example from Dimensional Int
 Double -> Double, which should work according to rule 2 in figure 2. I had
 it mixed up with converting from Dimensional Int Double -> Dimensional Int
 x (where there is a coercion from Double to x).

 Second, it doesn't appear to actually be possible to export the Quantity'
 constructor from the defining module at all. (If I put it in the export
 list, GHCi tells me that it isn't in scope even though it is and I checked
 the spelling three times.) So the scenario I was thinking of isn't
 possible for that reason too; I hadn't realized that this was a rule.

 I now think that with the change you made everything is correct, sorry for
 the confusion.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9580#comment:8>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list