#4841: TypeSynonymInstances allow some flexible instances
---------------------------------+------------------------------------------
Reporter: benmachine | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 7.0.1
Keywords: | Testcase:
Blockedby: | Difficulty:
Os: Unknown/Multiple | Blocking:
Architecture: Unknown/Multiple | Failure: GHC accepts invalid program
---------------------------------+------------------------------------------
Comment(by simonpj):
You can do it without. If you try
{{{
instance Bounded [Char] where ...
}}}
you get an error message suggesting `-XFlexibleInstances`. And indeed
that does the job.
So the bug is that `TypeSynonymInstances` is being too generous: it is not
properly expanding and checking that the instance is for `(T a b c)` where
a,b,c are type variables. I'll fix that.
I think it also makes sense for `FlexibleInstances` to imply
`TypeSynonymInstances`. (With `FlexibleInstances` it's a bit awkward, and
odd, to check that there are no synonyms anywhere within the type.) I'll
change that and update the manual.
Simon
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/4841#comment:1>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs