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

How to turn on "-Wall"? #610

Open
capn-freako opened this issue Dec 5, 2015 · 5 comments
Open

How to turn on "-Wall"? #610

capn-freako opened this issue Dec 5, 2015 · 5 comments

Comments

@capn-freako
Copy link

How do I enable warrnings? I would like to achieve the equivalent of "-Wall".

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@ghost
Copy link

ghost commented Dec 5, 2015

IHaskell does support -Wall through its :set command. The only issue is that it leads to extra warnings being displayed, which come from the operations that are internal to IHaskell.

For example:

$ jupyter console --kernel haskell         
Jupyter Console 4.0.2

[ZMQTerminalIPythonApp] Loading IPython extension: storemagic

In [1]: :set -Wall

<interactive>:1:5: Warning: This binding for ‘it’ shadows the existing binding defined at <interactive>:1:1

<interactive>:1:5: Warning: Defined but not used: ‘pipe_var_77748799787913499675’

<interactive>:1:5: Warning: This binding for ‘it_var_77748799787913499675’ shadows the existing binding defined at <interactive>:1:5

<interactive>:1:5: Warning: This binding for ‘it’ shadows the existing binding defined at <interactive>:1:1

In [2]: map (+1) [1..5]

<interactive>:1:5: Warning: This binding for ‘it’ shadows the existing binding defined at <interactive>:1:1

<interactive>:1:5: Warning: Defined but not used: ‘pipe_var_22949703872331401261’

<interactive>:1:1: Warning:
    Defaulting the following constraint(s) to type ‘Integer’
      (Enum b0) arising from a use of ‘it’ at <interactive>:1:1-15
      (Num b0) arising from a use of ‘it’ at <interactive>:1:1-15
      (Show b0) arising from a use of ‘print’ at <interactive>:1:1-15
    In the first argument of ‘print’, namely ‘it’
    In a stmt of an interactive GHCi command: print it

<interactive>:1:5: Warning: This binding for ‘it_var_22949703872331401261’ shadows the existing binding defined at <interactive>:1:5

<interactive>:1:5: Warning: This binding for ‘it’ shadows the existing binding defined at <interactive>:1:1

<interactive>:1:5: Warning: This binding for ‘it’ shadows the existing binding defined at <interactive>:1:1

<interactive>:1:5: Warning: Defined but not used: ‘pipe_var_70387233140126141060’

<interactive>:1:5: Warning: This binding for ‘it_var_70387233140126141060’ shadows the existing binding defined at <interactive>:1:5

<interactive>:1:5: Warning: This binding for ‘it’ shadows the existing binding defined at <interactive>:1:1
[2,3,4,5,6]

@ghost
Copy link

ghost commented Dec 5, 2015

@capn-freako To see why warnings don't show in the notebook, take a look at #612.

@gibiansky
Copy link
Member

In addition to that issue, it seems like we should disable warnings before the IHaskell internal code, and then re-enable warnings afterwards (if they were enabled at all). We'll need to figure out how to do that...

@Eoksni
Copy link

Eoksni commented Jan 14, 2018

I think the vast majority (if not all) of the warnings caused by ihaskell internals are -Wname-shadowing. At least I've only seen those (but I'm using ihaskell for a very little time, so I might be wrong).

But if we could enable all the warnings except -Wname-shadowing and display those warnings in the notebook instead of the console, that already would be super useful and I think it is much easier to implement than disabling/enabling warning for ihaskell internals.

I'd be willing to make a PR if somebody could point me at the file where to start looking from.

@vaibhavsagar
Copy link
Member

This might be a good place to start: Evaluate.hs

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

4 participants