On Wed, Sep 29, 2010 at 7:43 AM, Simon Peyton-Jones
<[email protected]> 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 http://haskell.org/haskellwiki/Simonpj/Talk:OutsideIn
>
> * 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:

http://hpaste.org/40213/doesnt_work_in_ghc_7

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.

Antoine
_______________________________________________
Glasgow-haskell-users mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

Reply via email to