Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

-XNoMonomorphismRestriction: Holes aren't reported #1

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

-XNoMonomorphismRestriction: Holes aren't reported #1

xnyhps opened this issue May 4, 2012 · 1 comment
Assignees

Comments

@xnyhps
Copy link
Owner

xnyhps commented May 4, 2012

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
Copy link
Owner Author

xnyhps commented May 4, 2012

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant