Newtype unwrapping causes GHC panic
Some combination of newtypes and infix operators is causing GHCi to panic.
Steps to reproduce:
- Open a fresh GHCi session.
- Define
Cont
:newtype Cont r a = Cont {(>>-) :: (a -> r) -> r}
- Define a
Functor
instance forCont
:instance Functor (Cont r) where fmap f c = Cont $ \k -> c >>>- f . k
- Observe the following:
ghc: panic! (the 'impossible' happened)
(GHC version 8.0.2 for x86_64-unknown-linux):
get_op >>>-
Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
Discovered here.