[GHC] #14765: Levity polymorphism panic

GHC ghc-devs at haskell.org
Fri Feb 9 08:49:06 UTC 2018


#14765: Levity polymorphism panic
-------------------------------------+-------------------------------------
        Reporter:  dfeuer            |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:  8.6.1
       Component:  Compiler          |              Version:  8.5
      Resolution:                    |             Keywords:
                                     |  LevityPolymorphism
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Compile-time      |  Unknown/Multiple
  crash or panic                     |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by simonpj):

 More thoughts

 > Perhaps we could just make that more efficient by not using tryM.

 No: we need to know if there are any error messages ''from the enclosed
 thing''.

 > I really don't like having isUnliftedType return False for levity
 polymorphism.

 Actually I've decided I do!  The compiler should panic if there is no
 other alternative.  Here there is -- and Lint will catch the error shortly
 afterwards in a much more civilised way.  It's such a simple fix.

 > How would the new mkCoreApp work?

 Just like the current one, but without panicing in `isUnliftedType`, and
 with the entire apparatus introduced by #12709.  That is, build a term
 that may not pass Lint; but it doesn't matter because we are going to
 report LP errors anyway and stop.

 So a "new mkCoreApp" duplicates code, but in exchange means that all other
 uses of `isUnliftedType` can panic if you still feel strongly that they
 should.

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


More information about the ghc-tickets mailing list