GHC issueshttps://gitlab.haskell.org/ghc/ghc/-/issues2019-07-07T18:13:23Zhttps://gitlab.haskell.org/ghc/ghc/-/issues/15296Sentence is about Complex type but mentions Simple constructor2019-07-07T18:13:23ZSasha Bogicevicsasa.bogicevic@pm.meSentence is about Complex type but mentions Simple constructorThere is a mistype in one of the sentences regarding Roles in the documentation :
https://ghc.readthedocs.io/en/latest/glasgow_exts.html\#nominal-representational-and-phantom
```
Here are some examples:
data Simple a = MkSimple a ...There is a mistype in one of the sentences regarding Roles in the documentation :
https://ghc.readthedocs.io/en/latest/glasgow_exts.html\#nominal-representational-and-phantom
```
Here are some examples:
data Simple a = MkSimple a -- a has role representational
type family F
type instance F Int = Bool
type instance F Age = Char
data Complex a = MkComplex (F a) -- a has role nominal
data Phant a = MkPhant Bool -- a has role phantom
```
The type Simple has its parameter at role representational, which is generally the most common case. Simple Age would have the same representation as Simple Int. The type Complex, on the other hand, has its parameter at role nominal, because Simple Age and Simple Int are not the same. Lastly, Phant Age and Phant Bool have the same representation, even though Age and Bool are unrelated.
The wrong sentence is `The type Complex, on the other hand, has its parameter at role nominal, because Simple Age and Simple Int are not the same. `
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------- |
| Version | 8.4.3 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Documentation |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"Sentence is about Complex type but mentions Simple constructor","status":"New","operating_system":"","component":"Documentation","related":[],"milestone":"8.6.1","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.4.3","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"There is a mistype in one of the sentences regarding Roles in the documentation :\r\nhttps://ghc.readthedocs.io/en/latest/glasgow_exts.html#nominal-representational-and-phantom\r\n\r\n{{{\r\nHere are some examples:\r\n\r\ndata Simple a = MkSimple a -- a has role representational\r\n\r\ntype family F\r\ntype instance F Int = Bool\r\ntype instance F Age = Char\r\n\r\ndata Complex a = MkComplex (F a) -- a has role nominal\r\n\r\ndata Phant a = MkPhant Bool -- a has role phantom\r\n}}}\r\nThe type Simple has its parameter at role representational, which is generally the most common case. Simple Age would have the same representation as Simple Int. The type Complex, on the other hand, has its parameter at role nominal, because Simple Age and Simple Int are not the same. Lastly, Phant Age and Phant Bool have the same representation, even though Age and Bool are unrelated.\r\n\r\n\r\nThe wrong sentence is `The type Complex, on the other hand, has its parameter at role nominal, because Simple Age and Simple Int are not the same. `\r\n","type_of_failure":"OtherFailure","blocking":[]} -->8.8.1Sasha Bogicevicsasa.bogicevic@pm.meSasha Bogicevicsasa.bogicevic@pm.mehttps://gitlab.haskell.org/ghc/ghc/-/issues/13600surprising error message with bang pattern2020-12-18T15:20:30ZAndrew U. Franksurprising error message with bang patternthe following code
```
f3 :: [Int] -> IO Int
f3 x = return (sum x)
f4 :: [Int] -> IO Int
f4 !x = return (sum x)
```
gives `The type signature for ‘f4’ lacks an accompanying binding` for the second function (the two functions are...the following code
```
f3 :: [Int] -> IO Int
f3 x = return (sum x)
f4 :: [Int] -> IO Int
f4 !x = return (sum x)
```
gives `The type signature for ‘f4’ lacks an accompanying binding` for the second function (the two functions are exactly the same except for the added bang). I do not understand bang patterns well, but would expect a more instructive error message. without the type definition, the second function f4 compiles with the bang).
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | -------------- |
| Version | 8.0.2 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | Linux |
| Architecture | x86_64 (amd64) |
</details>
<!-- {"blocked_by":[],"summary":"surprising error message with bang pattern","status":"New","operating_system":"Linux","component":"Compiler","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.0.2","keywords":[],"differentials":[],"test_case":"","architecture":"x86_64 (amd64)","cc":[""],"type":"Bug","description":"the following code \r\n\r\n{{{\r\nf3 :: [Int] -> IO Int \r\nf3 x = return (sum x) \r\n\r\nf4 :: [Int] -> IO Int \r\nf4 !x = return (sum x) \r\n}}}\r\n\r\ngives `The type signature for ‘f4’ lacks an accompanying binding` for the second function (the two functions are exactly the same except for the added bang). I do not understand bang patterns well, but would expect a more instructive error message. without the type definition, the second function f4 compiles with the bang). ","type_of_failure":"OtherFailure","blocking":[]} -->8.8.1Sasha Bogicevicsasa.bogicevic@pm.meSasha Bogicevicsasa.bogicevic@pm.me