Send Beginners mailing list submissions to
        [email protected]

To subscribe or unsubscribe via the World Wide Web, visit
        http://www.haskell.org/mailman/listinfo/beginners
or, via email, send a message with subject or body 'help' to
        [email protected]

You can reach the person managing the list at
        [email protected]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Beginners digest..."


Today's Topics:

   1.  Warnings from ghc (Manfred Lotz)
   2. Re:  Warnings from ghc (Daniel Fischer)


----------------------------------------------------------------------

Message: 1
Date: Sun, 3 Apr 2011 17:24:52 +0200
From: Manfred Lotz <[email protected]>
Subject: [Haskell-beginners] Warnings from ghc
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=US-ASCII

Hi there,
>From my experiences in programming it is usually a good thing when
a compiler issues warnings because this shows me where in my code there
might be future problems hidden.


I found the following warnings especially important to be turned on:

-fwarn-incomplete-patterns
-fwarn-overlapping-patterns
-fwarn-name-shadowing 
-fwarn-unused-matches 
-fwarn-unused-do-bind 

I see that I could turn on all warnings with -Wall but that is a bit too
much. 


My question: what other options do people recommend to be turned on.



-- 
Manfred





------------------------------

Message: 2
Date: Sun, 3 Apr 2011 17:59:28 +0200
From: Daniel Fischer <[email protected]>
Subject: Re: [Haskell-beginners] Warnings from ghc
To: [email protected]
Cc: Manfred Lotz <[email protected]>
Message-ID: <[email protected]>
Content-Type: Text/Plain;  charset="iso-8859-1"

On Sunday 03 April 2011 17:24:52, Manfred Lotz wrote:
> Hi there,
> From my experiences in programming it is usually a good thing when
> a compiler issues warnings because this shows me where in my code there
> might be future problems hidden.
> 
> 
> I found the following warnings especially important to be turned on:
> 
> -fwarn-incomplete-patterns
> -fwarn-overlapping-patterns
> -fwarn-name-shadowing
> -fwarn-unused-matches

> -fwarn-unused-do-bind

I find that one rather annoying most of the time.
It's good if you write stuff like

do foo
   mapM bar baz
   quux

but it's just superfluous in situations like

do foo
   printf format some vars
   bar
   baz

which I have much more frequently (I don't remember ever having typo'ed 
mapM when I meant mapM_ or similar, doesn't mean it never happened, but 
it's rare - for me, at least)

> 
> I see that I could turn on all warnings with -Wall but that is a bit too
> much.

I tend to use
-Wall -fwarn-tabs -fno-warn-unused-do-bind -fno-warn-type-defaults
(unless I want to be warned on type-defaulting or unused do-binds, of 
course).
Switch on everything and explicitly switch off what you consider okay in 
that module.

> 
> 
> My question: what other options do people recommend to be turned on.

-fwarn-tabs
-fwarn-missing-signatures
-fwarn-orphans



------------------------------

_______________________________________________
Beginners mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/beginners


End of Beginners Digest, Vol 34, Issue 5
****************************************

Reply via email to