ANNOUNCE: GHC 7.0.1 Release Candidate 1

Antoine Latter aslatter at
Wed Sep 29 10:51:35 EDT 2010

On Wed, Sep 29, 2010 at 7:43 AM, Simon Peyton-Jones
<simonpj at> wrote:
> I've  been meaning to write a blog post about this, because it's a significant change.  I'll do this when I get home after ICFP.  Briefly though:
> * If you use -XGADTs or -XTypeFamilies (or -fglasgow-exts, which is deprecated) you get -XMonoLocalBinds, which says that local let/where bindings are not auto-generalised.  There's an extensive discussion of the reason for this decision in our paper "Let should not be generalised" and the journal version
> * One of the main times this matters is in situations like
>        foo = runST (bar 5)
>          where bar x = return x
> Here 'bar' must have a polymorphic type, in order to be mentioned in runST's argument
> * The error message does point out that 'bar' is a possible culprit.  In David's example:
>    The following variables have types that mention s
>      fill0 :: MBUArr s e -> ST s Int
> * The solution is usually to add a type signature for the offending variable (fillO in this case); you can still have polymorphic bindings in let/where, but they need a type signature.
> Simon

Here's a boiled-down equivalent to what the issue is in uvector:

In GHC 6.12, this would have type-checked. In GHC 7, I need to add a
type-signature to the 'helper' function, except I 'm not sure how to
do it.

So the function in uvector might need a larger refactoring.


More information about the Glasgow-haskell-users mailing list