[GHC] #11053: Add a warning for pattern synonyms without signatures
#11053: Add a warning for pattern synonyms without signatures -------------------------------------+------------------------------------- Reporter: mpickering | Owner: Type: feature | Status: new request | Priority: normal | Milestone: Component: Compiler | Version: 7.10.2 Keywords: newcomer | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- It is accepted as good style that top-level definitions should have type signatures. Pattern synonyms seem no different to me in this regard so I think it would be good if GHC warned if there was a pattern synonym definition which lacked a type signature. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11053> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11053: Add a warning for pattern synonyms without signatures -------------------------------------+------------------------------------- Reporter: mpickering | Owner: mpickering Type: feature request | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.2 Resolution: | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by mpickering): * owner: => mpickering -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11053#comment:1> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11053: Add a warning for pattern synonyms without signatures -------------------------------------+------------------------------------- Reporter: mpickering | Owner: mpickering Type: feature request | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.2 Resolution: | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by Matthew Pickering <matthewtpickering@…>): In [changeset:"1883afb2eee88c828adf6aa8014bab64dd6e8096/ghc" 1883afb/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="1883afb2eee88c828adf6aa8014bab64dd6e8096" Implement -fwarn-missing-pat-syn-sigs This adds a warning when a pattern synonym is not accompanied by a signature in the style of `-fwarn-missing-sigs`. It is turned on by -Wall. If the user specifies, `-fwarn-missing-exported-signatures` with `-fwarn-missing-pat-syn-sigs` then it will only warn when the pattern synonym is exported. Test Plan: ./validate Reviewers: hvr, austin, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1596 GHC Trac Issues: #11053 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11053#comment:2> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11053: Add a warning for pattern synonyms without signatures -------------------------------------+------------------------------------- Reporter: mpickering | Owner: mpickering Type: feature request | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 7.10.2 Resolution: fixed | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: | patsyns/T11053 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by mpickering): * status: new => closed * testcase: => patsyns/T11053 * resolution: => fixed -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11053#comment:3> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11053: Add a warning for pattern synonyms without signatures -------------------------------------+------------------------------------- Reporter: mpickering | Owner: mpickering Type: feature request | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 7.10.2 Resolution: fixed | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: | patsyns/T11053 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by goldfire): Note that including this in `-Wall` makes it harder for clients to maintain a warning-free library over 3 releases, given that pattern synonyms were available one cycle before their signatures. I'm still not personally entirely convinced about that policy, but it does seem to have traction and we should keep it in mind as we evolve the language. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11053#comment:4> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC