
#9196: Higher-rank constraint treated as type instead -------------------------------------+------------------------------------ Reporter: goldfire | Owner: Type: bug | Status: patch Priority: normal | Milestone: Component: Compiler | Version: 7.8.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Comment (by archblob): The patch passes validation and I hope I understood the problem, even if that's not the case, at least I got to learn something new. Even though the pathological type construction can be detected and stopped earlier when checking the type and transforming from HsType to Type, doing so would yeild very bad error message, so the patch checks for a bad type in `check_valid_type` where the check for the same illegal types happens for classes. Even so, the type is not printed as the user wrote it, and this could be a source of confusion. This could be fixed by considering `ForAllTy` in `isPredTy`, but this will brake code because even though in the comments about `isPredTy` it is said that it is only used for printing, I found it used in places not concerning pretty printing. Even used it in tis patch :-P. Maybe there should really be a variation of this function that is only used for pretty printing. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9196#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler