#2494: Panic in tcSimplifyRuleLhs
------------------------+---------------------------------------------------
    Reporter:  rl       |       Owner:          
        Type:  bug      |      Status:  new     
    Priority:  normal   |   Component:  Compiler
     Version:  6.8.3    |    Severity:  normal  
    Keywords:           |    Testcase:          
Architecture:  Unknown  |          Os:  Unknown 
------------------------+---------------------------------------------------
 With this module, both 6.8.3 and the HEAD panic in `tcSimplifyRuleLhs`:

 {{{
 {-# LANGUAGE Rank2Types, ScopedTypeVariables #-}
 module Foo where

 foo :: (forall m. Monad m => Maybe (m a) -> Maybe (m a)) -> Maybe a ->
 Maybe a
 foo _ x = x

 {-# RULES

 "foo/foo"
   forall (f :: forall m. Monad m => Maybe (m a) -> Maybe (m a))
          (g :: forall m. Monad m => Maybe (m b) -> Maybe (m b)) x.
   foo f (foo g x) = foo (f . g) x
  #-}
 }}}

 Note that the rule is incorrectly typed; with the correct types, no panic
 happens.

 Incidentially, I'm not sure if `ScopedTypeVariables` should be required
 here.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/2494>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to