[GHC] #14969: Underconstrained typed holes are non-performant (was: panic on incorrect syntax)

GHC ghc-devs at haskell.org
Fri Apr 13 16:22:18 UTC 2018


#14969: Underconstrained typed holes are non-performant
-------------------------------------+-------------------------------------
        Reporter:  johnleo           |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.5
      Resolution:                    |             Keywords:  TypedHoles
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  Compile-time      |            Test Case:
  performance bug                    |  ghci/scripts/T14969
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------
Changes (by RyanGlScott):

 * failure:  None/Unknown => Compile-time performance bug


Comment:

 Note that it doesn't loop infinitely, but rather takes a very long time to
 compute:

 {{{
 $ time ghc/inplace/bin/ghc-stage2 -XFlexibleContexts -e "3 _ 4"

 <interactive>:0:1: error:
     • Could not deduce (Num t1)
       from the context: (Num t, Num (t2 -> t -> t3))
         bound by the inferred type for ‘it’:
                    forall t t2 t3. (Num t, Num (t2 -> t -> t3)) => t3
         at <interactive>:0:1-5
       The type variable ‘t1’ is ambiguous
     • In the ambiguity check for the inferred type for ‘it’
       To defer the ambiguity check to use sites, enable
 AllowAmbiguousTypes
       When checking the inferred type
         it :: forall t1 t2 t3. (Num t1, Num (t2 -> t1 -> t3)) => t3

 real    0m32.219s
 user    0m32.176s
 sys     0m0.084s
 }}}

 In other words, this is the same problem observed in
 https://ghc.haskell.org/trac/ghc/ticket/10946#comment:9. This is good home
 for this particular bug.

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


More information about the ghc-tickets mailing list