[commit: ghc] master: Use -fno-warn-unused-imports instead of hiding `ord` (c875b08)
Simon Peyton Jones
simonpj at microsoft.com
Mon Jul 6 09:02:07 UTC 2015
Add a comment, please, I beg you! In five years time no one will have a clue why that `-fno-warn-unused-imports` flag is there.
It's a small thing I know, but the principle is: whenever adding a line of code whose purpose is not locally obvious, explain by adding a comment, or Note, or Trac reference, or all three.
Simon
| -----Original Message-----
| From: ghc-commits [mailto:ghc-commits-bounces at haskell.org] On Behalf
| Of git at git.haskell.org
| Sent: 04 July 2015 23:44
| To: ghc-commits at haskell.org
| Subject: [commit: ghc] master: Use -fno-warn-unused-imports instead of
| hiding `ord` (c875b08)
|
| Repository : ssh://git@git.haskell.org/ghc
|
| On branch : master
| Link :
| http://ghc.haskell.org/trac/ghc/changeset/c875b085d95377771a5b3cf0f44b
| b2910dbfe966/ghc
|
| >---------------------------------------------------------------
|
| commit c875b085d95377771a5b3cf0f44bb2910dbfe966
| Author: Thomas Miedema <thomasmiedema at gmail.com>
| Date: Sat Jul 4 18:20:06 2015 +0200
|
| Use -fno-warn-unused-imports instead of hiding `ord`
|
| This is more future proof. Maybe later versions of Alex won't
| `import
| Data.Char (ord)` anymore.
|
|
| >---------------------------------------------------------------
|
| c875b085d95377771a5b3cf0f44bb2910dbfe966
| compiler/cmm/CmmLex.x | 3 ++-
| compiler/parser/Lexer.x | 3 ++-
| 2 files changed, 4 insertions(+), 2 deletions(-)
|
| diff --git a/compiler/cmm/CmmLex.x b/compiler/cmm/CmmLex.x index
| cb71c7d..fca5a1e 100644
| --- a/compiler/cmm/CmmLex.x
| +++ b/compiler/cmm/CmmLex.x
| @@ -13,6 +13,7 @@
| {
| {-# OPTIONS_GHC -fno-warn-unused-matches #-} {-# OPTIONS_GHC -fno-
| warn-unused-binds #-}
| +{-# OPTIONS_GHC -fno-warn-unused-imports #-}
| {-# OPTIONS_GHC -fno-warn-tabs #-}
| {-# OPTIONS_GHC -fno-warn-missing-signatures #-}
| -- The above warning suppression flags are a temporary kludge.
| @@ -37,7 +38,7 @@ import Util
| --import TRACE
|
| import Data.Word
| -import Data.Char hiding (ord)
| +import Data.Char
| }
|
| $whitechar = [\ \t\n\r\f\v\xa0] -- \xa0 is Unicode no-break space
| diff --git a/compiler/parser/Lexer.x b/compiler/parser/Lexer.x index
| 8e6e67d..df7347e 100644
| --- a/compiler/parser/Lexer.x
| +++ b/compiler/parser/Lexer.x
| @@ -45,6 +45,7 @@
| {-# LANGUAGE BangPatterns #-}
| {-# OPTIONS_GHC -fno-warn-unused-matches #-} {-# OPTIONS_GHC -fno-
| warn-unused-binds #-}
| +{-# OPTIONS_GHC -fno-warn-unused-imports #-}
| {-# OPTIONS_GHC -fno-warn-tabs #-}
| {-# OPTIONS_GHC -fno-warn-missing-signatures #-} {-# OPTIONS_GHC -
| fno-warn-overlapping-patterns #-} @@ -84,7 +85,7 @@ import
| Control.Applicative #endif import Control.Monad import Data.Bits -
| import Data.Char hiding (ord)
| +import Data.Char
| import Data.List
| import Data.Maybe
| import Data.Word
|
| _______________________________________________
| ghc-commits mailing list
| ghc-commits at haskell.org
| http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-commits
More information about the ghc-devs
mailing list