[GHC] #9429: Alternative to type family Any

GHC ghc-devs at haskell.org
Sun Aug 10 13:10:27 UTC 2014


#9429: Alternative to type family Any
-------------------------------------+-------------------------------------
              Reporter:  mboes       |            Owner:
                  Type:  feature     |           Status:  new
  request                            |        Milestone:
              Priority:  normal      |          Version:  7.9
             Component:  Compiler    |         Keywords:
            Resolution:              |     Architecture:  Unknown/Multiple
      Operating System:              |       Difficulty:  Unknown
  Unknown/Multiple                   |       Blocked By:
       Type of failure:              |  Related Tickets:  9097, 9380
  None/Unknown                       |
             Test Case:              |
              Blocking:              |
Differential Revisions:              |
-------------------------------------+-------------------------------------

Comment (by mboes):

 Hm, perhaps I was a bit too hasty about the "inhabiting only open kinds"
 criterion as being sufficient for safety. In #9380, we have a GADT indexed
 by types in a closed kind. But the breaking test case exposed there would
 break just as well with an open kind, I think. The problem is that GHC
 chooses `Any` as an arbitrary instantiation for some unbound type variable
 appearing in the type index of the GADT, which then leads GHC to wrongly
 identify some alternatives as being "unreachable" in case analyses.
 Therefore, the second solution in the description of this ticket would
 still have problems with GADT's.

 I guess my point is that while the `Any` that GHC uses to silently
 instantiate things during type checking should be well behaved, clearly,
 there could be an `UnsafeAny`, similar to the old `Any`, for certain
 targeted use cases such as obtaining the `TypeRep` of a polymorphic type
 with no type families. For polymorphic types where there ''might'' be
 occurrences of type families, I so no other solution but to somehow make
 the `Any`-the-type-family `Typeable` somehow.

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


More information about the ghc-tickets mailing list