[GHC] #12597: -Wmissing-signatures uses forall even when invalid in source

#12597: -Wmissing-signatures uses forall even when invalid in source -------------------------------------+------------------------------------- Reporter: nomeata | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- The `-Wmissing-signatures` warning is great to learn about the signatures that things should have, and is especially useful when teaching Haskell to beginners. Unfortunately, it uses explicit quantification (`forall`) even when in the compiled module, this is not valid: {{{ $ echo 'foo x = x' > Foo.hs $ ghci -Wall Foo.hs GHCi, version 8.0.1: http://www.haskell.org/ghc/ :? for help [1 of 1] Compiling Main ( Foo.hs, interpreted ) Foo.hs:1:1: warning: [-Wmissing-signatures] Top-level binding with no type signature: foo :: forall t. t -> t Ok, modules loaded: Main. *Main> $ echo -e 'foo :: forall t. t -> t\nfoo x = x' > Foo.hs $ ghci -Wall Foo.hs GHCi, version 8.0.1: http://www.haskell.org/ghc/ :? for help [1 of 1] Compiling Main ( Foo.hs, interpreted ) Foo.hs:1:16: error: Illegal symbol '.' in type Perhaps you intended to use RankNTypes or a similar language extension to enable explicit-forall syntax: forall <tvs>. <type> Failed, modules loaded: none. }}} The type signature provided by `-Wmissing-signatures` should be in a form that is valid in the context of the function that is missing the signature. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12597 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12597: -Wmissing-signatures uses forall even when invalid in source -------------------------------------+------------------------------------- Reporter: nomeata | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: 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 simonpj): Good point. Easy fix in-flight. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12597#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12597: -Wmissing-signatures uses forall even when invalid in source
-------------------------------------+-------------------------------------
Reporter: nomeata | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 8.0.1
Resolution: | Keywords:
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 Simon Peyton Jones

#12597: -Wmissing-signatures uses forall even when invalid in source -------------------------------------+------------------------------------- Reporter: nomeata | Owner: Type: bug | Status: merge Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: | rename/should_compile/T12597 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by simonpj): * status: new => merge * testcase: => rename/should_compile/T12597 Comment: Might be worth merging. Cosmetic but useful. Simon -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12597#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12597: -Wmissing-signatures uses forall even when invalid in source -------------------------------------+------------------------------------- Reporter: nomeata | Owner: Type: bug | Status: merge Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: | rename/should_compile/T12597 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by nomeata): Thanks for the quick fix! -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12597#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12597: -Wmissing-signatures uses forall even when invalid in source -------------------------------------+------------------------------------- Reporter: nomeata | Owner: Type: bug | Status: closed Priority: normal | Milestone: 8.0.2 Component: Compiler | Version: 8.0.1 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: | rename/should_compile/T12597 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: merge => closed * resolution: => fixed * milestone: => 8.0.2 Comment: Comment:2 merged to `ghc-8.0` as 906ea0445deab65f4dfcba7473593db048cbacab. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12597#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC