
#11977: ghc doesn't agree with its own inferred pattern type -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by goldfire): * cc: mpickering, cactus (added) Comment: Very interesting test case! You've discovered that, once again, we've misunderstood pattern types. If you assign a pattern the type `a -> b -> c` (where `a`, `b`, and `c` are arbitrary types, not necessarily variables; that is, they are metavariables), we've been saying that `a` and `b` are arguments to the pattern and `c` is the result type. But in your case, the type is `a -> Char -> a`, and `Char -> a` is the result type. Yet there is no way to indicate this in a type signature. I even tried `a -> (Char -> a)` to no avail. I have no suggestions (other than parentheses, which would be awkward) for how to fix this. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11977#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler