[GHC] #10447: DeriveFoldable rejects instances with constraints in last argument of data type
GHC
ghc-devs at haskell.org
Thu May 28 01:58:12 UTC 2015
#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:
-------------------------------------+-------------------------------------
Comment (by RyanGlScott):
I'm probably making an assumption about how robust GHC's equality
constraint solver is, but I would think that it'd be capable enough to
infer whether an argument's type is equal to the type parameter. If it
were undecidable, then wouldn't this (legal) code have to be rejected?
{{{#!hs
data S a b where
MkS :: (a ~ Int) => Int -> S a b
deriving instance Foldable (S a)
}}}
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10447#comment:9>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list