
#15244: Ambiguity checks in QuantifiedConstraints -------------------------------------+------------------------------------- Reporter: bitwiseshiftleft | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.5 Resolution: | Keywords: | QuantifiedConstraints 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 bitwiseshiftleft): Thanks for the quick response Simon. Right, {{{bar}}} is only to help track down the cause. It's the Blah case that's more likely, in particular when the Blah instance comes into scope from a pattern match. Something like (and I didn't test this example): {{{ data GenericBlah t where GB :: (Typeable a, Blah a) => a t -> GenericBlah t instance Eq (GenericBlah t) where (GB (a::ca t)) == (GB (b::cb t)) = case eqT @ca @cb of Nothing -> False Just Refl -> a==b }}} The constraint inside the {{{Eq}}} instance is equivalent to {{{baz}}}. I'm exploring QuantifiedConstraints, and might eventually use them at my job. However, QuantifiedConstraints would only be used in a few places. This pattern would be used rare and the bug isn't difficult to work around, so it's not urgent. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15244#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler