[GHC] #16140: Cannot create type synonym for quantified constraint without ImpredicativeTypes

GHC ghc-devs at haskell.org
Thu Feb 21 06:52:25 UTC 2019


#16140: Cannot create type synonym for quantified constraint without
ImpredicativeTypes
-------------------------------------+-------------------------------------
        Reporter:  Ashley Yakeley    |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.6.3
      Resolution:                    |             Keywords:
                                     |  QuantifiedConstraints,
                                     |  ImpredicativeTypes
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  GHC rejects       |  Unknown/Multiple
  valid program                      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by osa1):

 Sorry if I'm talking about a different bug, but I think this may be a
 regression. The original reproducer is rejected by GHC 8.6.3 too, but if
 you
 build Cabal (the library) with GHC HEAD at some point you get this error:

 {{{
 $ head.hackage.sh init-local
 $ cabal new-build --enable-benchmarks --enable-tests --allow-newer=base
 ,template-haskell,tagged
 ...
 [211 of 220] Compiling Distribution.Simple.PreProcess (
 Distribution/Simple/PreProcess.hs,
 dist/build/Distribution/Simple/PreProcess.o )

 Distribution/Simple/PreProcess.hs:697:24: error:
     • Illegal qualified type:
         GHC.Stack.Types.HasCallStack =>
         ghc-prim-0.5.3:GHC.Types.IO [FilePath]
       GHC doesn't yet support impredicative polymorphism
     • In the expansion of type synonym ‘WithCallStack’
       In the expansion of type synonym ‘IO’
       In the expansion of type synonym ‘PreProcessorExtras’
     |
 697 | knownExtrasHandlers :: [ PreProcessorExtras ]
     |                        ^^^^^^^^^^^^^^^^^^^^^^
 cabal: Failed to build Cabal-2.4.1.0 (which is required by exe:ppsh from
 pretty-show-1.6.16 and cabal-install-2.5.0.0). See the build log above for
 details.
 }}}

 This builds fine with GHC 8.6.3.

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


More information about the ghc-tickets mailing list