
#8268: Local annotations ignored in ambiguity check ----------------------------------------------+---------------------------- Reporter: maxs | Owner: Type: bug | Status: closed Priority: highest | Milestone: Component: Compiler (Type checker) | Version: 7.7 Resolution: invalid | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: GHC rejects valid program | Unknown/Multiple Test Case: | Difficulty: Unknown Blocking: | Blocked By: | Related Tickets: ----------------------------------------------+---------------------------- Changes (by simonpj): * status: new => closed * resolution: => invalid Comment: I'm afraid the error is quite right: `fst`'s type is ambiguous. Suppose we accepted its type. Then we said: {{{ fst2 :: forall f a b. Unlift f (f a, f b) => f (Plain (f a), Plain (f b)) -> f a fst2 = fst }}} The type sig for `fst2` is identical to `fst`, and `fst2 = fst`, so obviously it should typecheck. But it won't for the reason specified: there is no way to fix `b` in the call to `fst` inside `fst2`, because it only appears under a type function. In a more general context you'll find `fst` very hard to call. Does that make sense? Simon -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8268#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler