[GHC] #12564: Type family in type pattern kind

GHC ghc-devs at haskell.org
Fri Jan 4 16:56:33 UTC 2019


#12564: Type family in type pattern kind
-------------------------------------+-------------------------------------
        Reporter:  int-index         |                Owner:  goldfire
            Type:  bug               |               Status:  new
        Priority:  high              |            Milestone:  8.4.1
       Component:  Compiler (Type    |              Version:  8.0.1
  checker)                           |             Keywords:  TypeInType,
      Resolution:                    |  TypeFamilies
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  GHC rejects       |  Unknown/Multiple
  valid program                      |            Test Case:
      Blocked By:  14119             |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by simonpj):

 Generally I like this.  But:

 * We'd need to update the dynamic semantics and subject-reduction proof
 for FC to show that the resulting system is sound.

 * I'm very troubled by the fact that the evidence is not used.  It's all
 very similar to class instances, except that in class instances we use the
 evidence.

 * You way that the "evidence may potentially be mentioned" but how might
 that happen?

 * In the example here we know for certain that the evidence is redundant.
 The `(Len @a _1)` was not written by the user; it was inferred.  GHC never
 guesses, so it must be uniquely determined.  So it's really a waste of
 time to construct and pass that evidence at every call site.

   Surely there must be a solid criterion for what components of the type
 are fully determined, and hence redundant and don't need to be matched?

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


More information about the ghc-tickets mailing list