
#10447: DeriveFoldable rejects instances with constraints in last argument of data type -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: GHC rejects | Unknown/Multiple valid program | Test Case: Blocked By: | Blocking: Related Tickets: #8678 | Differential Revisions: -------------------------------------+------------------------------------- Changes (by simonpj): * cc: core-libraries-committee@… (added) Comment: Copying the Core Libraries Committee. What conditions ''are'' ok? For example, is this OK? {{{ data T a where MkT :: (a~Int) => a -> T a }}} or this (which is equivalent) {{{ data T a where MkT :: Int -> T Int }}} I think that the 'deriving' code for `Functor`, `Foldable` etc behaves specially when it comes across the universally-quantified type variable (`a` above), so it might get confused if it was `Int` and not `a`. Disabling the test is easy: the question is whether that's the right thing to do. Simon -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10447#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler