ImplicitParams and MonoLocalBinds

Roman Cheplyaka roma at ro-che.info
Fri Mar 22 09:39:45 CET 2013


The value of the following expression

  let ?y = 2  in
  let  p = ?y in
  let ?y = 1  in
  p

depends on whether the second binding is generalised.

MonomorphismRestriction makes it not generalise, hence the value is 2.

What surprises me is that MonoLocalBinds doesn't have this effect.

  Prelude> :set -XImplicitParams -XNoMonomorphismRestriction -XMonoLocalBinds 
  Prelude> let ?y = 2 in let p = ?y in let ?y = 1 in p
  1

What's going on here?

Roman



More information about the Glasgow-haskell-users mailing list