
Hi everyone! Do you know, if there is pragma for warning suppression? I want to implement something like warning suppression related to this ticket in GHC's Trac (https://ghc.haskell.org/trac/ghc/ticket/602). Or i need to implement that kind of pragma by myself? Thanks in advance! Edgar

I just responded to #602, but perhaps you're just looking for the -fno-warn-XXX options listed here: https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/flag-referen...
Richard
On Oct 19, 2015, at 5:22 PM, Эдгар Жаворонков
Hi everyone!
Do you know, if there is pragma for warning suppression? I want to implement something like warning suppression related to this ticket in GHC's Trac (https://ghc.haskell.org/trac/ghc/ticket/602). Or i need to implement that kind of pragma by myself?
Thanks in advance! Edgar _______________________________________________ ghc-devs mailing list ghc-devs@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs

No, i mean exactly pragmas in source code, that i can particulary add to
function or a part of the code for example.
E.g:
{-# BEGIN_SUPPRESS_WARNINGS #-}
foo :: a -> b
#do something that throws warnings
{-# END_SUPPRESS_WARNINGS #-}
2015-10-20 1:10 GMT+03:00 Richard Eisenberg
I just responded to #602, but perhaps you're just looking for the -fno-warn-XXX options listed here: https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/flag-referen...
Richard
On Oct 19, 2015, at 5:22 PM, Эдгар Жаворонков
wrote: Hi everyone!
Do you know, if there is pragma for warning suppression? I want to implement something like warning suppression related to this ticket in GHC's Trac (https://ghc.haskell.org/trac/ghc/ticket/602). Or i need to implement that kind of pragma by myself?
Thanks in advance! Edgar _______________________________________________ ghc-devs mailing list ghc-devs@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs

Hi Edgar,
No, that doesn't exist yet. Would surely be useful, though.
Richard
On Oct 19, 2015, at 6:16 PM, Эдгар Жаворонков
No, i mean exactly pragmas in source code, that i can particulary add to function or a part of the code for example. E.g:
{-# BEGIN_SUPPRESS_WARNINGS #-}
foo :: a -> b #do something that throws warnings
{-# END_SUPPRESS_WARNINGS #-}
2015-10-20 1:10 GMT+03:00 Richard Eisenberg
: I just responded to #602, but perhaps you're just looking for the -fno-warn-XXX options listed here: https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/flag-referen... Richard
On Oct 19, 2015, at 5:22 PM, Эдгар Жаворонков
wrote: Hi everyone!
Do you know, if there is pragma for warning suppression? I want to implement something like warning suppression related to this ticket in GHC's Trac (https://ghc.haskell.org/trac/ghc/ticket/602). Or i need to implement that kind of pragma by myself?
Thanks in advance! Edgar _______________________________________________ ghc-devs mailing list ghc-devs@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs

Hello, Richard,
Do you know something about defining own pragmas in GHC?
---
С уважением,
Жаворонков Эдгар
2015-10-20 1:17 GMT+03:00 Richard Eisenberg
Hi Edgar,
No, that doesn't exist yet. Would surely be useful, though.
Richard
On Oct 19, 2015, at 6:16 PM, Эдгар Жаворонков
wrote: No, i mean exactly pragmas in source code, that i can particulary add to function or a part of the code for example. E.g:
{-# BEGIN_SUPPRESS_WARNINGS #-}
foo :: a -> b #do something that throws warnings
{-# END_SUPPRESS_WARNINGS #-}
2015-10-20 1:10 GMT+03:00 Richard Eisenberg
: I just responded to #602, but perhaps you're just looking for the -fno-warn-XXX options listed here: https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/flag-referen...
Richard
On Oct 19, 2015, at 5:22 PM, Эдгар Жаворонков
wrote: Hi everyone!
Do you know, if there is pragma for warning suppression? I want to implement something like warning suppression related to this ticket in GHC's Trac (https://ghc.haskell.org/trac/ghc/ticket/602). Or i need to implement that kind of pragma by myself?
Thanks in advance! Edgar _______________________________________________ ghc-devs mailing list ghc-devs@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs

Sure. But before thinking about implementation, let's think about specification. Write a wiki page (perhaps https://ghc.haskell.org/trac/ghc/wiki/Design/LocalWarningPragmas ) with the design of how the feature should work, with several examples. Once we know what we're building, then we can talk about how to build it.
Thanks!
Richard
On Oct 19, 2015, at 6:21 PM, Эдгар Жаворонков
Hello, Richard,
Do you know something about defining own pragmas in GHC?
---
С уважением, Жаворонков Эдгар
2015-10-20 1:17 GMT+03:00 Richard Eisenberg
: Hi Edgar, No, that doesn't exist yet. Would surely be useful, though.
Richard
On Oct 19, 2015, at 6:16 PM, Эдгар Жаворонков
wrote: No, i mean exactly pragmas in source code, that i can particulary add to function or a part of the code for example. E.g:
{-# BEGIN_SUPPRESS_WARNINGS #-}
foo :: a -> b #do something that throws warnings
{-# END_SUPPRESS_WARNINGS #-}
2015-10-20 1:10 GMT+03:00 Richard Eisenberg
: I just responded to #602, but perhaps you're just looking for the -fno-warn-XXX options listed here: https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/flag-referen... Richard
On Oct 19, 2015, at 5:22 PM, Эдгар Жаворонков
wrote: Hi everyone!
Do you know, if there is pragma for warning suppression? I want to implement something like warning suppression related to this ticket in GHC's Trac (https://ghc.haskell.org/trac/ghc/ticket/602). Or i need to implement that kind of pragma by myself?
Thanks in advance! Edgar _______________________________________________ ghc-devs mailing list ghc-devs@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs

Oh, okay, sure
---
С уважением,
Жаворонков Эдгар
Yours sincerely,
Zhavornkov Edgar
2015-10-20 1:37 GMT+03:00 Richard Eisenberg
Sure. But before thinking about implementation, let's think about specification. Write a wiki page (perhaps https://ghc.haskell.org/trac/ghc/wiki/Design/LocalWarningPragmas ) with the design of how the feature should work, with several examples. Once we know what we're building, then we can talk about how to build it.
Thanks! Richard
On Oct 19, 2015, at 6:21 PM, Эдгар Жаворонков
wrote: Hello, Richard,
Do you know something about defining own pragmas in GHC?
---
С уважением, Жаворонков Эдгар
2015-10-20 1:17 GMT+03:00 Richard Eisenberg
: Hi Edgar,
No, that doesn't exist yet. Would surely be useful, though.
Richard
On Oct 19, 2015, at 6:16 PM, Эдгар Жаворонков
wrote: No, i mean exactly pragmas in source code, that i can particulary add to function or a part of the code for example. E.g:
{-# BEGIN_SUPPRESS_WARNINGS #-}
foo :: a -> b #do something that throws warnings
{-# END_SUPPRESS_WARNINGS #-}
2015-10-20 1:10 GMT+03:00 Richard Eisenberg
: I just responded to #602, but perhaps you're just looking for the -fno-warn-XXX options listed here: https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/flag-referen...
Richard
On Oct 19, 2015, at 5:22 PM, Эдгар Жаворонков
wrote: Hi everyone!
Do you know, if there is pragma for warning suppression? I want to implement something like warning suppression related to this ticket in GHC's Trac (https://ghc.haskell.org/trac/ghc/ticket/602). Or i need to implement that kind of pragma by myself?
Thanks in advance! Edgar _______________________________________________ ghc-devs mailing list ghc-devs@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs

Hello Richard!
Can you take a look at some sort of specification i wrote week ago?
I placed it here:
https://ghc.haskell.org/trac/ghc/wiki/Design/LocalWarningPragmas
I can imagine only two use cases, and i'm not sure about correcteness of it
---
С уважением,
Жаворонков Эдгар
Best regards,
Edgar A. Zhavoronkov
2015-10-20 1:44 GMT+03:00 Эдгар Жаворонков
Oh, okay, sure
--- С уважением, Жаворонков Эдгар
Yours sincerely, Zhavornkov Edgar
2015-10-20 1:37 GMT+03:00 Richard Eisenberg
: Sure. But before thinking about implementation, let's think about specification. Write a wiki page (perhaps https://ghc.haskell.org/trac/ghc/wiki/Design/LocalWarningPragmas ) with the design of how the feature should work, with several examples. Once we know what we're building, then we can talk about how to build it.
Thanks! Richard
On Oct 19, 2015, at 6:21 PM, Эдгар Жаворонков
wrote: Hello, Richard,
Do you know something about defining own pragmas in GHC?
---
С уважением, Жаворонков Эдгар
2015-10-20 1:17 GMT+03:00 Richard Eisenberg
: Hi Edgar,
No, that doesn't exist yet. Would surely be useful, though.
Richard
On Oct 19, 2015, at 6:16 PM, Эдгар Жаворонков
wrote: No, i mean exactly pragmas in source code, that i can particulary add to function or a part of the code for example. E.g:
{-# BEGIN_SUPPRESS_WARNINGS #-}
foo :: a -> b #do something that throws warnings
{-# END_SUPPRESS_WARNINGS #-}
2015-10-20 1:10 GMT+03:00 Richard Eisenberg
: I just responded to #602, but perhaps you're just looking for the -fno-warn-XXX options listed here: https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/flag-referen...
Richard
On Oct 19, 2015, at 5:22 PM, Эдгар Жаворонков
wrote: Hi everyone!
Do you know, if there is pragma for warning suppression? I want to implement something like warning suppression related to this ticket in GHC's Trac (https://ghc.haskell.org/trac/ghc/ticket/602). Or i need to implement that kind of pragma by myself?
Thanks in advance! Edgar _______________________________________________ ghc-devs mailing list ghc-devs@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs

What is $warning_names$??
From: ghc-devs [mailto:ghc-devs-bounces@haskell.org] On Behalf Of ????? ??????????
Sent: 26 October 2015 14:53
To: Richard Eisenberg
Cc: ghc-devs@haskell.org
Subject: Re: Warning suppression pragmas
Hello Richard!
Can you take a look at some sort of specification i wrote week ago?
I placed it here: https://ghc.haskell.org/trac/ghc/wiki/Design/LocalWarningPragmas
I can imagine only two use cases, and i'm not sure about correcteness of it
---
С уважением,
Жаворонков Эдгар
Best regards,
Edgar A. Zhavoronkov
2015-10-20 1:44 GMT+03:00 Эдгар Жаворонков

Hi Simon!
It is a name of particular warning. By the way, you made me think of more
general idea. So i think it would be enough to suppress all kinds of
warnings that a function can throw(and a bit easier for me as a total
newbee in GHC hacking =) )
---
С уважением,
Жаворонков Эдгар
Best regards,
Edgar A. Zhavoronkov
2015-10-26 18:19 GMT+03:00 Simon Peyton Jones
What is $warning_names$??
*From:* ghc-devs [mailto:ghc-devs-bounces@haskell.org] *On Behalf Of *????? ?????????? *Sent:* 26 October 2015 14:53 *To:* Richard Eisenberg *Cc:* ghc-devs@haskell.org *Subject:* Re: Warning suppression pragmas
Hello Richard!
Can you take a look at some sort of specification i wrote week ago?
I placed it here: https://ghc.haskell.org/trac/ghc/wiki/Design/LocalWarningPragmas
I can imagine only two use cases, and i'm not sure about correcteness of it
---
С уважением,
Жаворонков Эдгар
Best regards,
Edgar A. Zhavoronkov
2015-10-20 1:44 GMT+03:00 Эдгар Жаворонков
: Oh, okay, sure
---
С уважением,
Жаворонков Эдгар
Yours sincerely,
Zhavornkov Edgar
2015-10-20 1:37 GMT+03:00 Richard Eisenberg
: Sure. But before thinking about implementation, let's think about specification. Write a wiki page (perhaps https://ghc.haskell.org/trac/ghc/wiki/Design/LocalWarningPragmas ) with the design of how the feature should work, with several examples. Once we know what we're building, then we can talk about how to build it.
Thanks!
Richard
On Oct 19, 2015, at 6:21 PM, Эдгар Жаворонков
wrote: Hello, Richard,
Do you know something about defining own pragmas in GHC?
---
С уважением,
Жаворонков Эдгар
2015-10-20 1:17 GMT+03:00 Richard Eisenberg
: Hi Edgar,
No, that doesn't exist yet. Would surely be useful, though.
Richard
On Oct 19, 2015, at 6:16 PM, Эдгар Жаворонков
wrote: No, i mean exactly pragmas in source code, that i can particulary add to function or a part of the code for example.
E.g:
{-# BEGIN_SUPPRESS_WARNINGS #-}
foo :: a -> b
#do something that throws warnings
{-# END_SUPPRESS_WARNINGS #-}
2015-10-20 1:10 GMT+03:00 Richard Eisenberg
: I just responded to #602, but perhaps you're just looking for the -fno-warn-XXX options listed here: https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/flag-referen... https://na01.safelinks.protection.outlook.com/?url=https:%2f%2fdownloads.haskell.org%2f~ghc%2flatest%2fdocs%2fhtml%2fusers_guide%2fflag-reference.html%23idp14879296&data=01%7C01%7Csimonpj%40064d.mgd.microsoft.com%7C60e346caf8234d98e51008d2de151984%7C72f988bf86f141af91ab2d7cd011db47%7C1&sdata=%2bBLz9NmZL6LVrVIlnfbLUUSiinyks0%2f5UV%2bzLK1%2biQI%3d
Richard
On Oct 19, 2015, at 5:22 PM, Эдгар Жаворонков
wrote: Hi everyone!
Do you know, if there is pragma for warning suppression? I want to implement something like warning suppression related to this ticket in GHC's Trac (https://ghc.haskell.org/trac/ghc/ticket/602). Or i need to implement that kind of pragma by myself?
Thanks in advance! Edgar
_______________________________________________ ghc-devs mailing list ghc-devs@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs https://na01.safelinks.protection.outlook.com/?url=http%3a%2f%2fmail.haskell.org%2fcgi-bin%2fmailman%2flistinfo%2fghc-devs&data=01%7c01%7csimonpj%40064d.mgd.microsoft.com%7c60e346caf8234d98e51008d2de151984%7c72f988bf86f141af91ab2d7cd011db47%7c1&sdata=Z93rLJn81zFj%2beOq9rX7219D58mmNDEA21HbPfMFAxs%3d

Эдгар Жаворонков
Hello Richard!
Can you take a look at some sort of specification i wrote week ago? I placed it here: https://ghc.haskell.org/trac/ghc/wiki/Design/LocalWarningPragmas I can imagine only two use cases, and i'm not sure about correcteness of it
Thanks for writing this up! The specification is a good start but it really needs more detail. For instance, what syntactic elements do you want this pragma to apply to? Bindings? Expressions? Top-level definitions like classes, types, and instances? Any lexical scope? It would be nice if the use-cases you mention were a bit more concrete. It wouldn't hurt to mention particular warnings that you might imagine that this would be useful for. It would likely be useful to draw inspiration from some of the schemes used by other languages listed on the ticket (Rust and C# IIRC). It wouldn't hurt to draw attention to the similarities and differences to these other schemes in the proposal text. On a more bike-shed-y note, `SUPPRESS_WARNINGS` is arguably a bit on the long side. Personally I would prefer not to see the pragma be bracketed as you propose in your last example as its effect then becomes quite "non-local". This pragma should, in my opinion, be a tool of precision, used sparingly for well-understood reasons. Allowing bracketed regions makes it too easy for definitions to "sneak in" to the supressed region, hiding legitimate warnings. In the interest of keeping the proposal concrete and concise I would either remove this alternative or move it to a dedicated "Alternatives" section. I'm looking forward to seeing what becomes of this. You might consider submitting the next iteration of the proposal to the Haskell subreddit to get a few more eyes on it. Onwards! Cheers, - Ben

Hi Ben!
Thanks for your feedback
I thought a little and fixed some in wiki page
In my opinion SUPPRESS_WARNINGS is not a real long name for pragma, but i
can't come up with whort name that clearly describes purpose of such pragma
=(
Your suggestions are really welcome)
---
С уважением,
Жаворонков Эдгар
Best regards,
Edgar A. Zhavoronkov
2015-10-26 19:45 GMT+03:00 Ben Gamari
Эдгар Жаворонков
writes: Hello Richard!
Can you take a look at some sort of specification i wrote week ago? I placed it here: https://ghc.haskell.org/trac/ghc/wiki/Design/LocalWarningPragmas I can imagine only two use cases, and i'm not sure about correcteness of it
Thanks for writing this up!
The specification is a good start but it really needs more detail. For instance, what syntactic elements do you want this pragma to apply to? Bindings? Expressions? Top-level definitions like classes, types, and instances? Any lexical scope?
It would be nice if the use-cases you mention were a bit more concrete. It wouldn't hurt to mention particular warnings that you might imagine that this would be useful for.
It would likely be useful to draw inspiration from some of the schemes used by other languages listed on the ticket (Rust and C# IIRC). It wouldn't hurt to draw attention to the similarities and differences to these other schemes in the proposal text.
On a more bike-shed-y note, `SUPPRESS_WARNINGS` is arguably a bit on the long side.
Personally I would prefer not to see the pragma be bracketed as you propose in your last example as its effect then becomes quite "non-local". This pragma should, in my opinion, be a tool of precision, used sparingly for well-understood reasons. Allowing bracketed regions makes it too easy for definitions to "sneak in" to the supressed region, hiding legitimate warnings. In the interest of keeping the proposal concrete and concise I would either remove this alternative or move it to a dedicated "Alternatives" section.
I'm looking forward to seeing what becomes of this. You might consider submitting the next iteration of the proposal to the Haskell subreddit to get a few more eyes on it. Onwards!
Cheers,
- Ben

Hi!
I think SUPPRESS could be enough.
Hope this helps
On Mon, Oct 26, 2015 at 8:59 PM, Эдгар Жаворонков
Hi Ben! Thanks for your feedback I thought a little and fixed some in wiki page
In my opinion SUPPRESS_WARNINGS is not a real long name for pragma, but i can't come up with whort name that clearly describes purpose of such pragma =( Your suggestions are really welcome)
--- С уважением, Жаворонков Эдгар
Best regards, Edgar A. Zhavoronkov
2015-10-26 19:45 GMT+03:00 Ben Gamari
: Эдгар Жаворонков
writes: Hello Richard!
Can you take a look at some sort of specification i wrote week ago? I placed it here: https://ghc.haskell.org/trac/ghc/wiki/Design/LocalWarningPragmas I can imagine only two use cases, and i'm not sure about correcteness of it
Thanks for writing this up!
The specification is a good start but it really needs more detail. For instance, what syntactic elements do you want this pragma to apply to? Bindings? Expressions? Top-level definitions like classes, types, and instances? Any lexical scope?
It would be nice if the use-cases you mention were a bit more concrete. It wouldn't hurt to mention particular warnings that you might imagine that this would be useful for.
It would likely be useful to draw inspiration from some of the schemes used by other languages listed on the ticket (Rust and C# IIRC). It wouldn't hurt to draw attention to the similarities and differences to these other schemes in the proposal text.
On a more bike-shed-y note, `SUPPRESS_WARNINGS` is arguably a bit on the long side.
Personally I would prefer not to see the pragma be bracketed as you propose in your last example as its effect then becomes quite "non-local". This pragma should, in my opinion, be a tool of precision, used sparingly for well-understood reasons. Allowing bracketed regions makes it too easy for definitions to "sneak in" to the supressed region, hiding legitimate warnings. In the interest of keeping the proposal concrete and concise I would either remove this alternative or move it to a dedicated "Alternatives" section.
I'm looking forward to seeing what becomes of this. You might consider submitting the next iteration of the proposal to the Haskell subreddit to get a few more eyes on it. Onwards!
Cheers,
- Ben
_______________________________________________ ghc-devs mailing list ghc-devs@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs

On US TV, Archie Bunker said "Stifle!" Howard
On Oct 26, 2015, at 1:59 PM, Alexey Shmalko
wrote: Hi!
I think SUPPRESS could be enough.
Hope this helps
On Mon, Oct 26, 2015 at 8:59 PM, Эдгар Жаворонков
wrote: Hi Ben! Thanks for your feedback I thought a little and fixed some in wiki page
In my opinion SUPPRESS_WARNINGS is not a real long name for pragma, but i can't come up with whort name that clearly describes purpose of such pragma =( Your suggestions are really welcome)
--- С уважением, Жаворонков Эдгар
Best regards, Edgar A. Zhavoronkov
2015-10-26 19:45 GMT+03:00 Ben Gamari
: Эдгар Жаворонков
writes: Hello Richard!
Can you take a look at some sort of specification i wrote week ago? I placed it here: https://ghc.haskell.org/trac/ghc/wiki/Design/LocalWarningPragmas I can imagine only two use cases, and i'm not sure about correcteness of it Thanks for writing this up!
The specification is a good start but it really needs more detail. For instance, what syntactic elements do you want this pragma to apply to? Bindings? Expressions? Top-level definitions like classes, types, and instances? Any lexical scope?
It would be nice if the use-cases you mention were a bit more concrete. It wouldn't hurt to mention particular warnings that you might imagine that this would be useful for.
It would likely be useful to draw inspiration from some of the schemes used by other languages listed on the ticket (Rust and C# IIRC). It wouldn't hurt to draw attention to the similarities and differences to these other schemes in the proposal text.
On a more bike-shed-y note, `SUPPRESS_WARNINGS` is arguably a bit on the long side.
Personally I would prefer not to see the pragma be bracketed as you propose in your last example as its effect then becomes quite "non-local". This pragma should, in my opinion, be a tool of precision, used sparingly for well-understood reasons. Allowing bracketed regions makes it too easy for definitions to "sneak in" to the supressed region, hiding legitimate warnings. In the interest of keeping the proposal concrete and concise I would either remove this alternative or move it to a dedicated "Alternatives" section.
I'm looking forward to seeing what becomes of this. You might consider submitting the next iteration of the proposal to the Haskell subreddit to get a few more eyes on it. Onwards!
Cheers,
- Ben
_______________________________________________ ghc-devs mailing list ghc-devs@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
ghc-devs mailing list ghc-devs@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs

Hi Ben!
I concreted some points in local warnings suppression pragmas wiki page
with specification.
https://ghc.haskell.org/trac/ghc/wiki/Design/LocalWarningPragmas
Do you know something about defining custom pragmas in GHC?
I suppose, i need to add it to the lexer and parser.
In that case, how can i understand, that GHC recognizes my pragma?
I want to try a few things on my local machine
Thanks in advance!
Cheers!
---
С уважением,
Жаворонков Эдгар
Best regards,
Edgar A. Zhavoronkov
2015-10-27 2:35 GMT+03:00 Howard B. Golden
On US TV, Archie Bunker said "Stifle!"
Howard
On Oct 26, 2015, at 1:59 PM, Alexey Shmalko
wrote: Hi!
I think SUPPRESS could be enough.
Hope this helps
Hi Ben! Thanks for your feedback I thought a little and fixed some in wiki page
In my opinion SUPPRESS_WARNINGS is not a real long name for pragma, but i can't come up with whort name that clearly describes purpose of such
=( Your suggestions are really welcome)
--- С уважением, Жаворонков Эдгар
Best regards, Edgar A. Zhavoronkov
2015-10-26 19:45 GMT+03:00 Ben Gamari
: Эдгар Жаворонков
writes: Hello Richard!
Can you take a look at some sort of specification i wrote week ago? I placed it here: https://ghc.haskell.org/trac/ghc/wiki/Design/LocalWarningPragmas I can imagine only two use cases, and i'm not sure about correcteness
of
it Thanks for writing this up!
The specification is a good start but it really needs more detail. For instance, what syntactic elements do you want this pragma to apply to? Bindings? Expressions? Top-level definitions like classes, types, and instances? Any lexical scope?
It would be nice if the use-cases you mention were a bit more concrete. It wouldn't hurt to mention particular warnings that you might imagine that this would be useful for.
It would likely be useful to draw inspiration from some of the schemes used by other languages listed on the ticket (Rust and C# IIRC). It wouldn't hurt to draw attention to the similarities and differences to these other schemes in the proposal text.
On a more bike-shed-y note, `SUPPRESS_WARNINGS` is arguably a bit on
On Mon, Oct 26, 2015 at 8:59 PM, Эдгар Жаворонков
wrote: pragma the long side.
Personally I would prefer not to see the pragma be bracketed as you propose in your last example as its effect then becomes quite "non-local". This pragma should, in my opinion, be a tool of precision, used sparingly for well-understood reasons. Allowing bracketed regions makes it too easy for definitions to "sneak in" to the supressed region, hiding legitimate warnings. In the interest of keeping the proposal concrete and concise I would either remove this alternative or move it to a dedicated "Alternatives" section.
I'm looking forward to seeing what becomes of this. You might consider submitting the next iteration of the proposal to the Haskell subreddit to get a few more eyes on it. Onwards!
Cheers,
- Ben
_______________________________________________ ghc-devs mailing list ghc-devs@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
ghc-devs mailing list ghc-devs@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs

Эдгар Жаворонков
Hi Ben!
I concreted some points in local warnings suppression pragmas wiki page with specification.
Hello! Things are definitely improving! I still think you should be more explicit about the possible uses here. In particular, what pain-points felt by users today does this proposal address? If I were you, I would try to collect some small examples of typical code snippets where you might want to put your pragma to use. The recent monad-of-no-return discussion might be a good place to start looking; you likely have some in your own code as well. Place these in the proposal and describe how your pragma would be employed to satisfy these cases. A few other points, * "... that can perform some unsafe actions(unsafe I/O maybe)": Unsafe I/O currently doesn't trigger any warnings that I can think of so this this might not be the best example to use here. * "... you don't want to read such long warning's texts": This also probably isn't the sort of use-case we'd want to design for. The typical use-case here is that you want to tell the compiler that you know something that it doesn't see. * "{-# SUPPRESS #-}": I'm not yet convinced that we want to allow such a blanket pragma. A specific example showing the benefit of such a large hammer would help. * "{-# SUPPRESS foo #-}" What is "foo" here? Be specific! What are the valid tokens you'd want to see here? You might consider having a look at some of the other proposals (e.g. the Custom Type Errors proposal [1]) for some inspiration on how to structure the document.
https://ghc.haskell.org/trac/ghc/wiki/Design/LocalWarningPragmas Do you know something about defining custom pragmas in GHC? I suppose, i need to add it to the lexer and parser.
Yes, this would be necessary.
In that case, how can i understand, that GHC recognizes my pragma?
I want to try a few things on my local machine
Fair enough. Nevertheless, I would encourage you to take think carefully about the proposal before diving too deeply into the code. A bit of forethought can save substantial effort later on! Thanks again for your efforts! Cheers, - Ben [1] https://ghc.haskell.org/trac/ghc/wiki/Proposal/CustomTypeErrors

Hello everyone once again!
Am i right, that in case in need to define my own pragma in GHC, i need to
add it to lexer?
How can i understand that GHC recognizes my defined pragma?
I am experimenting on my local machine and i want to try something out
---
С уважением,
Жаворонков Эдгар
Best regards,
Edgar A. Zhavoronkov
2015-10-26 21:59 GMT+03:00 Эдгар Жаворонков
Hi Ben! Thanks for your feedback I thought a little and fixed some in wiki page
In my opinion SUPPRESS_WARNINGS is not a real long name for pragma, but i can't come up with whort name that clearly describes purpose of such pragma =( Your suggestions are really welcome)
--- С уважением, Жаворонков Эдгар
Best regards, Edgar A. Zhavoronkov
2015-10-26 19:45 GMT+03:00 Ben Gamari
: Эдгар Жаворонков
writes: Hello Richard!
Can you take a look at some sort of specification i wrote week ago? I placed it here: https://ghc.haskell.org/trac/ghc/wiki/Design/LocalWarningPragmas I can imagine only two use cases, and i'm not sure about correcteness of it
Thanks for writing this up!
The specification is a good start but it really needs more detail. For instance, what syntactic elements do you want this pragma to apply to? Bindings? Expressions? Top-level definitions like classes, types, and instances? Any lexical scope?
It would be nice if the use-cases you mention were a bit more concrete. It wouldn't hurt to mention particular warnings that you might imagine that this would be useful for.
It would likely be useful to draw inspiration from some of the schemes used by other languages listed on the ticket (Rust and C# IIRC). It wouldn't hurt to draw attention to the similarities and differences to these other schemes in the proposal text.
On a more bike-shed-y note, `SUPPRESS_WARNINGS` is arguably a bit on the long side.
Personally I would prefer not to see the pragma be bracketed as you propose in your last example as its effect then becomes quite "non-local". This pragma should, in my opinion, be a tool of precision, used sparingly for well-understood reasons. Allowing bracketed regions makes it too easy for definitions to "sneak in" to the supressed region, hiding legitimate warnings. In the interest of keeping the proposal concrete and concise I would either remove this alternative or move it to a dedicated "Alternatives" section.
I'm looking forward to seeing what becomes of this. You might consider submitting the next iteration of the proposal to the Haskell subreddit to get a few more eyes on it. Onwards!
Cheers,
- Ben
participants (6)
-
Alexey Shmalko
-
Ben Gamari
-
Howard B. Golden
-
Richard Eisenberg
-
Simon Peyton Jones
-
Эдгар Жаворонков