-XNoMonomorphismRestriction: Holes aren't reported #1

Open
xnyhps opened this Issue May 4, 2012 · 1 comment

1 participant

@xnyhps
Owner

Opening the following module with -XNoMonomorphismRestriction:

f = _?h >>= _?g

Causes the holes to not be reported.

One of the differences in the log:

-XNoMonomorphismRestriction on:

solveWanteds finished with
  remaining_unsolved_flats = {}
  subst = [TvSubst In scope: InScope [] Type env: []]
simplifyCheck } unsolved = WC {}

Off:

solveWanteds finished with
  remaining_unsolved_flats = {[W] $dMonad :: Monad
                                               m_b {0} (CDictCan),
                              [W] _?h :: _?h (m_b a_c) {0} (CHoleCan),
                              [W] _?g :: _?g (a_c -> m_b b_d) {0} (CHoleCan)}
  subst = [TvSubst In scope: InScope [] Type env: []]
simplifyCheck }
  unsolved = WC {wc_flat = [W] $dMonad :: Monad m_b {0} (CDictCan)
                           [W] _?h :: _?h (m_b a_c) {0} (CHoleCan)
                           [W] _?g :: _?g (a_c -> m_b b_d) {0} (CHoleCan)}
@xnyhps xnyhps was assigned May 4, 2012
@xnyhps
Owner

However, giving the type signature manually does cause the holes to get reported:

f :: (Monad m) => m b
f = _?h >>= _?g
test.hs:2:5: Warning:
    Found hole _?h with type m a0
    In the first argument of `(>>=)', namely `_?h'
    In the expression: _?h >>= _?g
    In an equation for `f': f = _?h >>= _?g

test.hs:2:13: Warning:
    Found hole _?g with type a0 -> m b
    In the second argument of `(>>=)', namely `_?g'
    In the expression: _?h >>= _?g
    In an equation for `f': f = _?h >>= _?g
Ok, modules loaded: Main.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment