[GHC] #14172: GHC hangs during type-checking

GHC ghc-devs at haskell.org
Thu Aug 31 09:17:34 UTC 2017


#14172: GHC hangs during type-checking
-------------------------------------+-------------------------------------
        Reporter:  lightandlight     |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.0.2
      Resolution:                    |             Keywords:
Operating System:  Linux             |         Architecture:  x86_64
 Type of failure:  Compile-time      |  (amd64)
  crash or panic                     |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by simonpj):

 Seems to work OK with HEAD.

 What about with 8.2?

 With HEAD I get
 {{{
 T14172.hs:7:19: error:
     • Occurs check: cannot construct the infinite type: a ~ g'1 a
       Expected type: (f'0 a -> f (f'0 b))
                      -> Compose f'0 g'1 a -> f (h a')
         Actual type: (Unwrapped (Compose f'0 g'1 a)
                       -> f (Unwrapped (h a')))
                      -> Compose f'0 g'1 a -> f (h a')
     • In the first argument of ‘(.)’, namely ‘_Wrapping Compose’
       In the expression: _Wrapping Compose . traverse
       In an equation for ‘traverseCompose’:
           traverseCompose = _Wrapping Compose . traverse
     • Relevant bindings include
         traverseCompose :: (a -> f b) -> g a -> f (h a')
           (bound at T14172.hs:7:1)
   |
 7 | traverseCompose = _Wrapping Compose . traverse
   |                   ^^^^^^^^^^^^^^^^^

 T14172.hs:7:19: error:
     • Couldn't match type ‘g’ with ‘Compose f'0 g'1’
       ‘g’ is a rigid type variable bound by
         the inferred type of
         traverseCompose :: (a -> f b) -> g a -> f (h a')
         at T14172.hs:7:1-46
       Expected type: (a -> f b) -> g a -> f (h a')
         Actual type: (a -> f b) -> Compose f'0 g'1 a -> f (h a')
     • In the expression: _Wrapping Compose . traverse
       In an equation for ‘traverseCompose’:
           traverseCompose = _Wrapping Compose . traverse
     • Relevant bindings include
         traverseCompose :: (a -> f b) -> g a -> f (h a')
           (bound at T14172.hs:7:1)
   |
 7 | traverseCompose = _Wrapping Compose . traverse
   |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 }}}

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


More information about the ghc-tickets mailing list