
#15593: QuantifiedConstraints: trouble with type family -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.5 Resolution: | Keywords: | QuantifiedConstraints, | ConstraintKinds 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 RyanGlScott): Unfortunately, this is going to work, since you can't quantify over constraints that are headed by `(~)`. See #15359. GHC HEAD at least gives you a slightly more informative error message about this: {{{ $ /opt/ghc/head/bin/ghci Bug.hs GHCi, version 8.7.20180827: http://www.haskell.org/ghc/ :? for help Loaded GHCi configuration from /home/rgscott/.ghci [1 of 1] Compiling Main ( Bug.hs, interpreted ) Bug.hs:11:1: error: • Class ‘~’ does not support user-specified instances • In the quantified constraint ‘forall xx. DeRef (tree xx) ~ TreeF xx’ In the context: forall xx. DeRef (tree xx) ~ TreeF xx While checking the super-classes of class ‘MuRef1’ In the class declaration for ‘MuRef1’ | 11 | class (forall xx. DeRef (tree xx) ~ TreeF xx) => MuRef1 tree | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Bug.hs:12:10: error: • Class ‘~’ does not support user-specified instances • In the quantified constraint ‘forall xx. DeRef (tree xx) ~ TreeF xx’ In the instance declaration for ‘MuRef1 tree’ | 12 | instance (forall xx. DeRef (tree xx) ~ TreeF xx) => MuRef1 tree | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15593#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler