[Haskell-cafe] What is the consensus about -fwarn-unused-do-bind ?

Henning Thielemann schlepptop at henning-thielemann.de
Thu Apr 15 07:54:03 EDT 2010


John Meacham schrieb:
> On Fri, Apr 09, 2010 at 09:07:29AM -0700, Bryan O'Sullivan wrote:
>> On Fri, Apr 9, 2010 at 6:44 AM, Ivan Lazar Miljenovic <
>> ivan.miljenovic at gmail.com> wrote:
>>> As of 6.12.1, the new -fwarn-unused-do-bind warning is activated with
>>> -Wall.  This is based off a bug report by Neil Mitchell:
>>> http://hackage.haskell.org/trac/ghc/ticket/3263 .
>>>
>>> However, does it make sense for this to be turned on with -Wall?
>>
>> Personally, I find it to be tremendously noisy and unhelpful, and I always
>> edit my .cabal files to turn it off. I think of it as a usability
>> regression.
> 
> I strongly agree.
> 
> I do not even think it is bad style to ignore the result of a monad,
> depending on the particular monad used, it could be extremely common. If
> anything there should be a pragma one can attach to ceratin functions to
> warn if the result is unused, like 'mapM'. This would be similar to what
> gcc does, where you can specify an attribute saying a functions result
> should be used or the compiler should complain.

The question is: Would people design libraries in a different way, if it
is encouraged to respect monadic results?


More information about the Haskell-Cafe mailing list