Add warning for probable identities (fromIntegral and friends)
authorsimonpj@microsoft.com <unknown>
Tue, 16 Nov 2010 17:15:10 +0000 (17:15 +0000)
committersimonpj@microsoft.com <unknown>
Tue, 16 Nov 2010 17:15:10 +0000 (17:15 +0000)
commit0656c72a8f4fda30c348bdf40449d105e4ce00ce
tree95c2c8ff9110ae91423c1abf7f106d4b5fd14460
parente21c922fcdd1dac193bd8ff5670787daa3c21a12
Add warning for probable identities (fromIntegral and friends)

See Trac #4488.  The basic idea is to check for

    fun :: ty -> ty

where fun is one of
  toIntegerName     toRationalName
  fromIntegralName  realToFracName

There's a (documented) flag to control it -fwarn-identities.
Currently -Wall switches it on.
compiler/deSugar/Desugar.lhs
compiler/deSugar/DsExpr.lhs
compiler/main/DynFlags.hs
compiler/prelude/PrelNames.lhs
docs/users_guide/flags.xml
docs/users_guide/using.xml