
#12085: Premature defaulting and variable not in scope -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: Type: task | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: | TypeApplications Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by simonpj): For the second, a type signature brings into scope ''only'' the type variables in the ''leading'' or top-level `forall`. So in {{{ foo :: forall (a::Type). (Read a, Show a) => Bool -> String foo b = ...type variable 'a' is in scope here... }}} But for ''non-top-level'' foralls, nothing is brought into scope {{{ bar :: Bool -> forall (a::Type). (Read a, Show a) => Bool -> String bar b = ...type variable 'a' is NOT NOT in scope here... }}} This is again by design, and I think it's documented. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12085#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler