
#11339: Possible type-checker regression in GHC 8.0 -------------------------------------+------------------------------------- Reporter: hvr | Owner: simonpj Type: bug | Status: closed Priority: highest | Milestone: 8.0.2 Component: Compiler (Type | Version: 8.0.1-rc1 checker) | Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: | typecheck/should_compile/T11339, | T11339b, T11339c, T11339d; partial- | sigs/should_compile/T11339a Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by simonpj): * status: new => closed * testcase: => typecheck/should_compile/T11339, T11339b, T11339c, T11339d; partial- sigs/should_compile/T11339a * resolution: => fixed Comment: This is a complicated ticket, and I've spent an unreasonably long time on the patch. But I'm very happy with the result. There are a number of separate strands * comment:12, I think `fanout` definitely needs a type signature for `go`. Look at the GADT pattern match on `Refl` in the `Await` branch... GADTs always need a type signature! I have no idea how 7.10 compiled this program; maybe a bug! * Difference between these two bindings: {{{ Bazaar { getBazaar = t } = left sell s t = getBazaar (left sell s) }}} Well, the first falls under the Monomorphism Restriction, while the second does not. Simple as that. * comment:4, item (2). I disagree: {{{ foo :: Show a => a -> String (foo) = show }}} Here the binding falls under the monomorphism restriction, and cannot be rescued by a type signature. Test: `typecheck/should_compile/T11339` {{{ • Overloaded signature conflicts with monomorphism restriction t :: forall (f :: * -> *). Applicative f => (a -> f b) -> f t }}} Adding `-XNoMonomorhismRestriction` makes it fine. Test: `typecheck/should_compile/T11339b` * comment:4, item (5), yes this was a bad bug {{{ foo :: _ (foo) = id }}} Fixed: test is `partial-sigs/should_compile/T11339a` Tricky stuff. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11339#comment:14 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler