
#15351: QuantifiedConstraints ignore FunctionalDependencies -------------------------------------+------------------------------------- Reporter: aaronvargo | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler (Type | Version: 8.5 checker) | Keywords: Resolution: | QuantifiedConstraints Operating System: Unknown/Multiple | Architecture: Type of failure: GHC rejects | Unknown/Multiple valid program | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by AntC): Replying to [comment:3 goldfire]:
Quantified constraints do not need a constraint -- just a `forall` is fine.
Then the github proposal's [https://github.com/Gertjan423/ghc- proposals/blob/quantified-constraints/proposals/0000-quantified- constraints.rst#id8 syntax changes] are wrongly described. (And the same text has gone into the Users guide.) The `=>` is the defining syntax for the extension; the `forall` is optional (although often needed in practice). @aaron, perhaps you could take out the `QuantifiedConstraints` flag (but put in `ExplicitForAll`) and try re-compiling. Does GHC complain you need to switch on the extension? (Sorry I can't try that from here.)
I do think the original program should be accepted.
Then what does it mean? At a guess: for some `f0` being the type constructor in an argument to `bar`, there's an `instance C (f0 a') Int`? Note that `a'` is quantified within the constraint, so is distinct from the `a1` argument to the constructor `f0`. There is no such instance declared, whereas for the `baz` example there is an `instance C [a] Int`. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15351#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler