GHC issueshttps://gitlab.haskell.org/ghc/ghc/-/issues2019-07-07T18:39:05Zhttps://gitlab.haskell.org/ghc/ghc/-/issues/9778Namespace collision detection for promoted types2019-07-07T18:39:05ZEric CrockettNamespace collision detection for promoted typesIn the following example
```hs
{-# LANGUAGE DataKinds #-}
module Foo where
data Nat = Z | S Nat
data S
foo :: S n -> S n
foo = id
```
GHC displays the error
```
Foo.hs:12:8:
‘S’ is applied to too many type arguments
In the...In the following example
```hs
{-# LANGUAGE DataKinds #-}
module Foo where
data Nat = Z | S Nat
data S
foo :: S n -> S n
foo = id
```
GHC displays the error
```
Foo.hs:12:8:
‘S’ is applied to too many type arguments
In the type signature for ‘foo’: foo :: S n -> S n
Failed, modules loaded: none.
```
Of course this code compiles without the definition of `data S`. Without namespace collision detection, it is easy to have working code, and then import a module which breaks the code. For example, I made this request after I imported Module1 with type `S` defined and Module2 with the promoted type `S`, which is what I was trying to use.
Can we get namespace collision detection instead? I'm proposing something like:
```
Foo.hs:9:15
Ambiguous occurence ‘S’
It could refer to either Foo.S defined at Foo.hs:7:1
or to Foo.'S promoted from the constructor defined at Foo.hs:5:16
or to `Bar.'S` promoted from the constructor defined at Bar.hs:line#:char#
or to ...
Use 'S to refer to promoted constructors.
```7.10.1carlostomecarlostomehttps://gitlab.haskell.org/ghc/ghc/-/issues/9776-frule-check flag not recognized without parameter2019-07-07T18:39:05ZJan Stolarekjan.stolarek@ed.ac.uk-frule-check flag not recognized without parameter```
$ ghc Foo.hs -frule-check
ghc: on the commandline: unrecognised flag: -frule-check
Usage: For basic information, try the `--help' option.
```
That error message is confusing. `-frule-check` is a valid flag, it's just being used inco...```
$ ghc Foo.hs -frule-check
ghc: on the commandline: unrecognised flag: -frule-check
Usage: For basic information, try the `--help' option.
```
That error message is confusing. `-frule-check` is a valid flag, it's just being used incorrectly. It should be followed by a parameter:
```
$ ghc Foo.hs -frule-check ruleFoo
```
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 7.9 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Driver |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"-frule-check flag not recognized without parameter","status":"New","operating_system":"","component":"Driver","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"7.9","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"{{{\r\n$ ghc Foo.hs -frule-check\r\nghc: on the commandline: unrecognised flag: -frule-check\r\nUsage: For basic information, try the `--help' option.\r\n}}}\r\n\r\nThat error message is confusing. `-frule-check` is a valid flag, it's just being used incorrectly. It should be followed by a parameter:\r\n\r\n{{{\r\n$ ghc Foo.hs -frule-check ruleFoo\r\n}}}\r\n","type_of_failure":"OtherFailure","blocking":[]} -->7.10.1carlostomecarlostomehttps://gitlab.haskell.org/ghc/ghc/-/issues/9293GHCI :unset -XLanguageExtension returns "don't know how to reverse -XLanguage...2019-07-07T18:41:00ZjfeltzGHCI :unset -XLanguageExtension returns "don't know how to reverse -XLanguageExtension"Any language extension tried appears to not work with :unset. To make matters worse, :unset expands to a number of options, misleading the user into thinking that it should (if that is the case). I eventually had to ask someone on IRC \#...Any language extension tried appears to not work with :unset. To make matters worse, :unset expands to a number of options, misleading the user into thinking that it should (if that is the case). I eventually had to ask someone on IRC \#haskell, leading to the :set -XNoLanguageExtension trick to do what I needed. A fix to :unset is suggested, or removing the misleading/non-working command.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ----------------------------------- |
| Version | 7.8.2 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | GHCi |
| Test case | :set -XCPP followed by :unset -XCPP |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | hvr |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"GHCI :unset -XLanguageExtension returns \"don't know how to reverse -XLanguageExtension\"","status":"New","operating_system":"","component":"GHCi","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"7.8.2","keywords":[],"differentials":[],"test_case":":set -XCPP followed by :unset -XCPP","architecture":"","cc":["hvr"],"type":"Bug","description":"Any language extension tried appears to not work with :unset. To make matters worse, :unset expands to a number of options, misleading the user into thinking that it should (if that is the case). I eventually had to ask someone on IRC #haskell, leading to the :set -XNoLanguageExtension trick to do what I needed. A fix to :unset is suggested, or removing the misleading/non-working command.","type_of_failure":"OtherFailure","blocking":[]} -->7.10.1lerouxlerouxhttps://gitlab.haskell.org/ghc/ghc/-/issues/2526Warn about missing signatures only for exported functions2019-07-07T19:08:12ZfergushendersonWarn about missing signatures only for exported functionsThe -fwarn-missing-signatures option results in warnings if signatures are not declared for any top-level functions.
Many Haskell users prefer to declare type signatures only for exported functions, which are part of the module's interf...The -fwarn-missing-signatures option results in warnings if signatures are not declared for any top-level functions.
Many Haskell users prefer to declare type signatures only for exported functions, which are part of the module's interface, not for all functions. It would be nice to have an option that issued warnings iff any exported functions lacked explicit signatures.7.10.1Eric SeidelEric Seidel