#5957: signatures are too permissive
------------------------------+---------------------------------------------
Reporter: maeder | Owner:
Type: bug | Status: new
Priority: normal | Component: Compiler (Type checker)
Version: 7.4.1 | Keywords:
Os: Unknown/Multiple | Architecture: Unknown/Multiple
Failure: None/Unknown | Testcase:
Blockedby: | Blocking:
Related: |
------------------------------+---------------------------------------------
ghc should reject the following (accidentally mistyped) signature, unless
`-XFlexibleContexts` is used.
{{{
flex :: Int -> Show a => a -> String
flex i a = show a ++ show i
}}}
hugs and ghc version below 7 rejected this correctly:
{{{
All of the type variables in the constraint `Show a'
are already in scope (at least one must be universally quantified
here)
(Use -XFlexibleContexts to lift this restriction)
In the type signature for `flex':
flex :: Int -> (Show a) => a -> String
}}}
It is not Haskell98 nor Haskell2010 (I believe).
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5957>
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