[GHC] #15687: Type synonym unused binds no warning?

GHC ghc-devs at haskell.org
Sat Sep 29 22:05:58 UTC 2018


#15687: Type synonym unused binds no warning?
-------------------------------------+-------------------------------------
        Reporter:  AntC              |                Owner:  (none)
            Type:  feature request   |               Status:  new
        Priority:  normal            |            Milestone:  8.6.1
       Component:  Compiler          |              Version:  8.6.1
  (Parser)                           |
      Resolution:                    |             Keywords:
Operating System:  Windows           |         Architecture:
 Type of failure:  GHC accepts       |  Unknown/Multiple
  invalid program                    |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by AntC):

 > Note that this behavior is not new.

 Indeed. Probably been there forever: there's nothing in the Report
 requiring all type vars to appear on rhs.

 I can't see there would ever be any sense in it, though; unlike unused
 vars in other places, for which there's `-fwarn-unused-binds`.

 > we don't warn about ...

 There's sense to not using all the arguments at term level. Never the less
 it's sufficiently unusual for GHC to recognise a special form. You can (I
 usually do) write

 {{{#!hs
 const x _ = x
 const x _y = x
 }}}

 (Yes I could use `_a` for `Silly`, but I can still see no sense to it.)

 In some contexs, using `_` avoids getting a warning. (I'm thinking this
 for `type` could be a small tweak/enhancement for somebody starting GHC
 development: steal the logic from checking bidirectional patterns.)

-- 
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15687#comment:3>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list