GHC issueshttps://gitlab.haskell.org/ghc/ghc/-/issues2019-07-07T18:26:30Zhttps://gitlab.haskell.org/ghc/ghc/-/issues/12464Add `instance Semigroup a => Semigroup (IO a)`2019-07-07T18:26:30ZIcelandjackAdd `instance Semigroup a => Semigroup (IO a)`What the title says
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | -------------- |
| Version | 8.0.1 |
| Type | FeatureRequest...What the title says
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | -------------- |
| Version | 8.0.1 |
| Type | FeatureRequest |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Core Libraries |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | ekmett |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"Add `instance Semigroup a => Semigroup (IO a)`","status":"New","operating_system":"","component":"Core Libraries","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.0.1","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":["ekmett"],"type":"FeatureRequest","description":"What the title says","type_of_failure":"OtherFailure","blocking":[]} -->8.2.1https://gitlab.haskell.org/ghc/ghc/-/issues/12461Document -O32019-07-07T18:26:31ZEric CrockettDocument -O3GHC accepts the flag -O3, but I can't find any documentation on it. What does it do?
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version ...GHC accepts the flag -O3, but I can't find any documentation on it. What does it do?
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 8.0.1 |
| Type | Task |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"Document -O3","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.0.1","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Task","description":"GHC accepts the flag -O3, but I can't find any documentation on it. What does it do?","type_of_failure":"OtherFailure","blocking":[]} -->Giles AndersonGiles Andersonhttps://gitlab.haskell.org/ghc/ghc/-/issues/12460Solaris linker does not recognize option --gc-sections2019-07-07T18:26:31ZherzenSolaris linker does not recognize option --gc-sectionsLinking helloworld.hs fails with the error
```
ld: fatal: unrecognized option '--'
```
If gcc is called by hand to link with "-Wl,--gc-sections" removed, the link succeeds.
```
$ ghc --version
The Glorious Glasgow Haskell Compilation...Linking helloworld.hs fails with the error
```
ld: fatal: unrecognized option '--'
```
If gcc is called by hand to link with "-Wl,--gc-sections" removed, the link succeeds.
```
$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 8.0.1
$ uname -a
SunOS diotima 5.11 11.3 i86pc i386 i86pc
$ gcc --version
gcc (GCC) 4.9.3
$ cat helloworld.hs
main = putStrLn "hello, world"
$ ghc -c helloworld.hs
$ ghc -v -keep-tmp-files -o helloworld helloworld.o
Glasgow Haskell Compiler, Version 8.0.1, stage 2 booted by GHC version 7.10.1
Using binary package database: /usr/lib/ghc-8.0.1/package.conf.d/package.cache
loading package database /usr/lib/ghc-8.0.1/package.conf.d
wired-in package ghc-prim mapped to ghc-prim-0.5.0.0
wired-in package integer-gmp mapped to integer-gmp-1.0.0.1
wired-in package base mapped to base-4.9.0.0
wired-in package rts mapped to rts
wired-in package template-haskell mapped to template-haskell-2.11.0.0
wired-in package ghc mapped to ghc-8.0.1
wired-in package dph-seq not found.
wired-in package dph-par not found.
Hsc static flags:
Created temporary directory: /tmp/ghc5103_0
*** C Compiler:
gcc -U__i686 -fno-stack-protector -DTABLES_NEXT_TO_CODE -c /tmp/ghc5103_0/ghc_1.c -o /tmp/ghc5103_0/ghc_2.o -I/usr/lib/ghc-8.0.1/include
*** Linker:
gcc -U__i686 -fno-stack-protector -DTABLES_NEXT_TO_CODE -o helloworld -Wl,--gc-sections helloworld.o -L/usr/lib/ghc-8.0.1/base-4.9.0.0 -L/usr/lib/ghc-8.0.1/integer-gmp-1.0.0.1 -L/usr/lib/ -L/usr/lib/ghc-8.0.1/ghc-prim-0.5.0.0 -L/usr/lib/ghc-8.0.1/rts /tmp/ghc5103_0/ghc_2.o -Wl,-u,ghczmprim_GHCziTypes_Izh_static_info -Wl,-u,ghczmprim_GHCziTypes_Czh_static_info -Wl,-u,ghczmprim_GHCziTypes_Fzh_static_info -Wl,-u,ghczmprim_GHCziTypes_Dzh_static_info -Wl,-u,base_GHCziPtr_Ptr_static_info -Wl,-u,ghczmprim_GHCziTypes_Wzh_static_info -Wl,-u,base_GHCziInt_I8zh_static_info -Wl,-u,base_GHCziInt_I16zh_static_info -Wl,-u,base_GHCziInt_I32zh_static_info -Wl,-u,base_GHCziInt_I64zh_static_info -Wl,-u,base_GHCziWord_W8zh_static_info -Wl,-u,base_GHCziWord_W16zh_static_info -Wl,-u,base_GHCziWord_W32zh_static_info -Wl,-u,base_GHCziWord_W64zh_static_info -Wl,-u,base_GHCziStable_StablePtr_static_info -Wl,-u,ghczmprim_GHCziTypes_Izh_con_info -Wl,-u,ghczmprim_GHCziTypes_Czh_con_info -Wl,-u,ghczmprim_GHCziTypes_Fzh_con_info -Wl,-u,ghczmprim_GHCziTypes_Dzh_con_info -Wl,-u,base_GHCziPtr_Ptr_con_info -Wl,-u,base_GHCziPtr_FunPtr_con_info -Wl,-u,base_GHCziStable_StablePtr_con_info -Wl,-u,ghczmprim_GHCziTypes_False_closure -Wl,-u,ghczmprim_GHCziTypes_True_closure -Wl,-u,base_GHCziPack_unpackCString_closure -Wl,-u,base_GHCziIOziException_stackOverflow_closure -Wl,-u,base_GHCziIOziException_heapOverflow_closure -Wl,-u,base_ControlziExceptionziBase_nonTermination_closure -Wl,-u,base_GHCziIOziException_blockedIndefinitelyOnMVar_closure -Wl,-u,base_GHCziIOziException_blockedIndefinitelyOnSTM_closure -Wl,-u,base_GHCziIOziException_allocationLimitExceeded_closure -Wl,-u,base_ControlziExceptionziBase_nestedAtomically_closure -Wl,-u,base_GHCziEventziThread_blockedOnBadFD_closure -Wl,-u,base_GHCziWeak_runFinalizzerBatch_closure -Wl,-u,base_GHCziTopHandler_flushStdHandles_closure -Wl,-u,base_GHCziTopHandler_runIO_closure -Wl,-u,base_GHCziTopHandler_runNonIO_closure -Wl,-u,base_GHCziConcziIO_ensureIOManagerIsRunning_closure -Wl,-u,base_GHCziConcziIO_ioManagerCapabilitiesChanged_closure -Wl,-u,base_GHCziConcziSync_runSparks_closure -Wl,-u,base_GHCziConcziSignal_runHandlersPtr_closure -lHSbase-4.9.0.0 -lHSinteger-gmp-1.0.0.1 -lHSghc-prim-0.5.0.0 -lHSrts -lCffi -lgmp -lm -lrt -ldl
ld: fatal: unrecognized option '--'
ld: fatal: use the '-z help' option for usage information
collect2: error: ld returned 1 exit status
`gcc' failed in phase `Linker'. (Exit code: 1)
$ gcc -U__i686 -fno-stack-protector -DTABLES_NEXT_TO_CODE -o helloworld helloworld.o -L/usr/lib/ghc-8.0.1/base-4.9.0.0 -L/usr/lib/ghc-8.0.1/integer-gmp-1.0.0.1 -L/usr/lib/ -L/usr/lib/ghc-8.0.1/ghc-prim-0.5.0.0 -L/usr/lib/ghc-8.0.1/rts /tmp/ghc5103_0/ghc_2.o -Wl,-u,ghczmprim_GHCziTypes_Izh_static_info -Wl,-u,ghczmprim_GHCziTypes_Czh_static_info -Wl,-u,ghczmprim_GHCziTypes_Fzh_static_info -Wl,-u,ghczmprim_GHCziTypes_Dzh_static_info -Wl,-u,base_GHCziPtr_Ptr_static_info -Wl,-u,ghczmprim_GHCziTypes_Wzh_static_info -Wl,-u,base_GHCziInt_I8zh_static_info -Wl,-u,base_GHCziInt_I16zh_static_info -Wl,-u,base_GHCziInt_I32zh_static_info -Wl,-u,base_GHCziInt_I64zh_static_info -Wl,-u,base_GHCziWord_W8zh_static_info -Wl,-u,base_GHCziWord_W16zh_static_info -Wl,-u,base_GHCziWord_W32zh_static_info -Wl,-u,base_GHCziWord_W64zh_static_info -Wl,-u,base_GHCziStable_StablePtr_static_info -Wl,-u,ghczmprim_GHCziTypes_Izh_con_info -Wl,-u,ghczmprim_GHCziTypes_Czh_con_info -Wl,-u,ghczmprim_GHCziTypes_Fzh_con_info -Wl,-u,ghczmprim_GHCziTypes_Dzh_con_info -Wl,-u,base_GHCziPtr_Ptr_con_info -Wl,-u,base_GHCziPtr_FunPtr_con_info -Wl,-u,base_GHCziStable_StablePtr_con_info -Wl,-u,ghczmprim_GHCziTypes_False_closure -Wl,-u,ghczmprim_GHCziTypes_True_closure -Wl,-u,base_GHCziPack_unpackCString_closure -Wl,-u,base_GHCziIOziException_stackOverflow_closure -Wl,-u,base_GHCziIOziException_heapOverflow_closure -Wl,-u,base_ControlziExceptionziBase_nonTermination_closure -Wl,-u,base_GHCziIOziException_blockedIndefinitelyOnMVar_closure -Wl,-u,base_GHCziIOziException_blockedIndefinitelyOnSTM_closure -Wl,-u,base_GHCziIOziException_allocationLimitExceeded_closure -Wl,-u,base_ControlziExceptionziBase_nestedAtomically_closure -Wl,-u,base_GHCziEventziThread_blockedOnBadFD_closure -Wl,-u,base_GHCziWeak_runFinalizzerBatch_closure -Wl,-u,base_GHCziTopHandler_flushStdHandles_closure -Wl,-u,base_GHCziTopHandler_runIO_closure -Wl,-u,base_GHCziTopHandler_runNonIO_closure -Wl,-u,base_GHCziConcziIO_ensureIOManagerIsRunning_closure -Wl,-u,base_GHCziConcziIO_ioManagerCapabilitiesChanged_closure -Wl,-u,base_GHCziConcziSync_runSparks_closure -Wl,-u,base_GHCziConcziSignal_runHandlersPtr_closure -lHSbase-4.9.0.0 -lHSinteger-gmp-1.0.0.1 -lHSghc-prim-0.5.0.0 -lHSrts -lCffi -lgmp -lm -lrt -ldl
$ ./helloworld
hello, world
```https://gitlab.haskell.org/ghc/ghc/-/issues/12459UnboxedTuple makes overloaded labels fail to parse2019-07-07T18:26:32ZIcelandjackUnboxedTuple makes overloaded labels fail to parse[This](https://gist.githubusercontent.com/PkmX/bfb2c5af4317c96282795f8c588fda1c/raw/4e388fae1b87e16dc215613531e54b036736b34c/NamedTuple.hs) works (removing spaces)
```hs
-- user = ( #login := "themoritz", #id := 3522732 )
user :: User
...[This](https://gist.githubusercontent.com/PkmX/bfb2c5af4317c96282795f8c588fda1c/raw/4e388fae1b87e16dc215613531e54b036736b34c/NamedTuple.hs) works (removing spaces)
```hs
-- user = ( #login := "themoritz", #id := 3522732 )
user :: User
user = (#login := "themoritz", #id := 3522732)
```
but it doesn't when `UnboxedTuples` are enabled:
```hs
-- tWKw.hs:63:46: error: parse error on input ‘)’
user = (#login := "themoritz", #id := 3522732)
```
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | -------------------- |
| Version | 8.0.1 |
| Type | Bug |
| TypeOfFailure | ValidProgramRejected |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler (Parser) |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"UnboxedTuple makes overloaded labels fail to parse","status":"New","operating_system":"","component":"Compiler (Parser)","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.0.1","keywords":["orf"],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"[https://gist.githubusercontent.com/PkmX/bfb2c5af4317c96282795f8c588fda1c/raw/4e388fae1b87e16dc215613531e54b036736b34c/NamedTuple.hs This] works (removing spaces)\r\n\r\n{{{#!hs\r\n-- user = ( #login := \"themoritz\", #id := 3522732 )\r\n\r\nuser :: User\r\nuser = (#login := \"themoritz\", #id := 3522732)\r\n}}}\r\n\r\nbut it doesn't when `UnboxedTuples` are enabled:\r\n\r\n{{{#!hs\r\n-- tWKw.hs:63:46: error: parse error on input ‘)’\r\nuser = (#login := \"themoritz\", #id := 3522732)\r\n}}}\r\n\r\n","type_of_failure":"ValidProgramRejected","blocking":[]} -->8.2.1Adam GundryAdam Gundryhttps://gitlab.haskell.org/ghc/ghc/-/issues/12458Segfault in GHCi runtime type reconstruction2019-07-07T18:26:32ZmniipSegfault in GHCi runtime type reconstruction```hs
GHCi, version 8.0.1: http://www.haskell.org/ghc/ :? for help
Prelude> data D a = D
Prelude> d = D
Prelude> :print d
d = (_t1::D a)
Prelude> d `seq` ()
()
Segmentation fault (core dumped)
```
This is unrelated to #12449 because we...```hs
GHCi, version 8.0.1: http://www.haskell.org/ghc/ :? for help
Prelude> data D a = D
Prelude> d = D
Prelude> :print d
d = (_t1::D a)
Prelude> d `seq` ()
()
Segmentation fault (core dumped)
```
This is unrelated to #12449 because we're evaluating `d` which has a proper type and not `_t1`.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 8.0.1 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | GHCi |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"Segfault in GHCi runtime type reconstruction","status":"New","operating_system":"","component":"GHCi","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.0.1","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"{{{#!hs\r\nGHCi, version 8.0.1: http://www.haskell.org/ghc/ :? for help\r\nPrelude> data D a = D\r\nPrelude> d = D\r\nPrelude> :print d\r\nd = (_t1::D a)\r\nPrelude> d `seq` ()\r\n()\r\nSegmentation fault (core dumped)\r\n}}}\r\nThis is unrelated to #12449 because we're evaluating `d` which has a proper type and not `_t1`.","type_of_failure":"OtherFailure","blocking":[]} -->8.0.2mniipmniiphttps://gitlab.haskell.org/ghc/ghc/-/issues/12456Panics when making a quotation as pattern synonym2019-07-07T18:26:33ZIcelandjackPanics when making a quotation as pattern synonym```
$ ghci -XPatternSynonyms -XViewPatterns -ignore-dot-ghci
GHCi, version 8.0.1: http://www.haskell.org/ghc/ :? for help
Prelude> :m + Language.Haskell.TH
Prelude Language.Haskell.TH> pattern A :: ExpQ; pattern A <- (undefined -> ()) w...```
$ ghci -XPatternSynonyms -XViewPatterns -ignore-dot-ghci
GHCi, version 8.0.1: http://www.haskell.org/ghc/ :? for help
Prelude> :m + Language.Haskell.TH
Prelude Language.Haskell.TH> pattern A :: ExpQ; pattern A <- (undefined -> ()) where A = undefined
ghc: panic! (the 'impossible' happened)
(GHC version 8.0.1 for x86_64-unknown-linux):
nameModule system $dIP_a4HS
Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
Prelude Language.Haskell.TH>
```
should we be able to use quotations that are pattern synonyms? I have no use for this.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 8.0.1 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"Panics when making a quotation as pattern synonym","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.0.1","keywords":["PatternSynonyms"],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"{{{\r\n$ ghci -XPatternSynonyms -XViewPatterns -ignore-dot-ghci\r\nGHCi, version 8.0.1: http://www.haskell.org/ghc/ :? for help\r\nPrelude> :m + Language.Haskell.TH\r\nPrelude Language.Haskell.TH> pattern A :: ExpQ; pattern A <- (undefined -> ()) where A = undefined\r\nghc: panic! (the 'impossible' happened)\r\n (GHC version 8.0.1 for x86_64-unknown-linux):\r\n nameModule system $dIP_a4HS\r\n\r\nPlease report this as a GHC bug: http://www.haskell.org/ghc/reportabug\r\n\r\nPrelude Language.Haskell.TH> \r\n}}}\r\n\r\nshould we be able to use quotations that are pattern synonyms? I have no use for this.\r\n","type_of_failure":"OtherFailure","blocking":[]} -->8.0.2https://gitlab.haskell.org/ghc/ghc/-/issues/12455Compact Regions2019-07-07T18:26:33ZSimon MarlowCompact RegionsI'm going to use this task to keep track of what we still need to do around compact regions before 8.2.1, and so I have somewhere to hang diffs.
Here's the current ToDo list:
- compaction should be interruptible by GC, otherwise we blo...I'm going to use this task to keep track of what we still need to do around compact regions before 8.2.1, and so I have somewhere to hang diffs.
Here's the current ToDo list:
- compaction should be interruptible by GC, otherwise we block a multithreaded program while compacting (I know how to do this and have a prototype, just need to finish it).
- Make it work with profiling
- We should have an API that doesn't require specifying a size, just `compact :: NFData a => a -> IO (Compact a)`
- libraries/compact/tests failures with `EXTRA_HC_OPTS="-debug -with-rtsopts=-DS"` (I think this is the static object problem, see below)
- Do we need both `totalW` and `totalDataW`? It looks like one of them is redundant to me.
- What happens if we try to compact something that refers to a large block? One larger than a megablock?
- Static Objects: currently compaction copies static objects into the compact. This violates some invariants (_STATIC objects should not be on the heap), but is important because we would otherwise have pointers from compacts to static objects that would need to be followed during GC, in order to find CAFs. I don't like this at all.
And in general, improve the comments.8.2.1Simon MarlowSimon Marlowhttps://gitlab.haskell.org/ghc/ghc/-/issues/12453Remove setUnfoldingInfoLazily2019-07-07T18:26:33ZMatthew PickeringRemove setUnfoldingInfoLazilyThe definition of `setUnfoldingInfoLazily` is exactly the same as `setUnfoldingInfo` and is only used in one place, `TcInterface`.
They were made equivalent in 2010 in 2ff2497dc374175b8ed81446258baf208d1f3e6e with the commit message.
`...The definition of `setUnfoldingInfoLazily` is exactly the same as `setUnfoldingInfo` and is only used in one place, `TcInterface`.
They were made equivalent in 2010 in 2ff2497dc374175b8ed81446258baf208d1f3e6e with the commit message.
```
commit 2ff2497dc374175b8ed81446258baf208d1f3e6e
Author: Ian Lynagh <igloo@earth.li> Wed Oct 20 15:37:10 2010
Committer: Ian Lynagh <igloo@earth.li> Wed Oct 20 15:37:10 2010
Original File: compiler/basicTypes/IdInfo.lhs
Don't seq unfoldings
We generate intermediate unfoldings which are just thrown away, so
evaluating them is a waste of time.
```
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 8.0.1 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"Remove setUnfoldingInfoLazily","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"OwnedBy","contents":"mpickering"},"version":"8.0.1","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"The definition of `setUnfoldingInfoLazily` is exactly the same as `setUnfoldingInfo` and is only used in one place, `TcInterface`. \r\n\r\nThey were made equivalent in 2010 in 2ff2497dc374175b8ed81446258baf208d1f3e6e with the commit message.\r\n\r\n{{{\r\ncommit 2ff2497dc374175b8ed81446258baf208d1f3e6e\r\nAuthor:\tIan Lynagh <igloo@earth.li> Wed Oct 20 15:37:10 2010\r\nCommitter:\tIan Lynagh <igloo@earth.li> Wed Oct 20 15:37:10 2010\r\nOriginal File:\tcompiler/basicTypes/IdInfo.lhs\r\n\r\nDon't seq unfoldings\r\nWe generate intermediate unfoldings which are just thrown away, so\r\nevaluating them is a waste of time.\r\n}}}","type_of_failure":"OtherFailure","blocking":[]} -->Matthew PickeringMatthew Pickeringhttps://gitlab.haskell.org/ghc/ghc/-/issues/12450Option to suppress GHCi output "Failed, modules loaded"2024-01-22T21:00:27ZEdward Z. YangOption to suppress GHCi output "Failed, modules loaded"For projects with lots of modules, the "modules loaded" message can be considerably long. For example:
```
Failed, modules loaded: Distribution.Client.Check, Distribution.Client.Run, Distribution.Client.Tar, Distribution.Client.Types, D...For projects with lots of modules, the "modules loaded" message can be considerably long. For example:
```
Failed, modules loaded: Distribution.Client.Check, Distribution.Client.Run, Distribution.Client.Tar, Distribution.Client.Types, Distribution.Client.Win32SelfUpgrade, Distribution.Client.Utils, Paths_cabal_install, Distribution.Client.BuildReports.Types, Distribution.Client.Dependency.Types, Distribution.Client.Init.Types, Distribution.Solver.Types.ConstraintSource, Distribution.Solver.Types.Settings, Distribution.Client.GlobalFlags, Distribution.Client.HttpUtils, Distribution.Client.Security.HTTP, Distribution.Solver.Types.PackageIndex, Distribution.Solver.Types.ComponentDeps, Distribution.Solver.Types.OptionalStanza, Distribution.Solver.Types.PackageFixedDeps, Distribution.Solver.Types.SourcePackage, Distribution.Solver.Types.LabeledPackageConstraint, Distribution.Solver.Types.PackageConstraint, Distribution.Client.World, Distribution.Client.FetchUtils, Distribution.Client.GZipUtils, Distribution.Client.Init.Licenses, Distribution.Client.Init.Heuristics, Distribution.Client.Compat.Process, Distribution.Client.JobControl, Distribution.Client.Compat.ExecutablePath, Distribution.Client.Compat.Semaphore, Distribution.Client.ParseUtils, Distribution.Client.Compat.FilePerms, Distribution.Client.Haddock, Distribution.Client.InstallPlan, Distribution.Client.SolverInstallPlan, Distribution.Client.BuildReports.Anonymous, Distribution.Client.BuildReports.Storage, Distribution.Solver.Types.PkgConfigDb, Distribution.Solver.Types.SolverPackage, Distribution.Solver.Types.SolverId, Distribution.Solver.Types.ResolverPackage, Distribution.Solver.Modular, Distribution.Client.PackageUtils, Distribution.Solver.Types.DependencyResolver, Distribution.Solver.Types.InstalledPreference, Distribution.Solver.Types.PackagePath, Distribution.Solver.Types.PackagePreferences, Distribution.Solver.Types.Progress, Distribution.Solver.Types.Variable, Distribution.Solver.Modular.Assignment, Distribution.Solver.Modular.ConfiguredConversion, Distribution.Solver.Modular.IndexConversion, Distribution.Solver.Modular.Log, Distribution.Solver.Modular.Package, Distribution.Solver.Modular.Solver, Distribution.Solver.Modular.Builder, Distribution.Solver.Modular.Cycles, Distribution.Solver.Modular.Dependency, Distribution.Solver.Modular.Explore, Distribution.Solver.Modular.Index, Distribution.Solver.Modular.Message, Distribution.Solver.Modular.Preference, Distribution.Solver.Modular.Validate, Distribution.Solver.Modular.Linking, Distribution.Solver.Modular.PSQ, Distribution.Solver.Modular.Tree, Distribution.Solver.Modular.Flag, Distribution.Solver.Modular.Version, Distribution.Solver.Modular.ConflictSet, Distribution.Solver.Modular.Var, Distribution.Solver.Modular.Configured, Distribution.Solver.Modular.LabeledGraph, Distribution.Client.ProjectPlanning.Types, Distribution.Client.DistDirLayout, Distribution.Client.PackageHash, Distribution.Client.RebuildMonad, Distribution.Client.Glob, Distribution.Client.FileMonitor, Distribution.Client.Utils.Json.
*Distribution.Client.Check>
```
It would be nice if there were a way to suppress this message. If there already is a way, it would be nice if GHCi mentioned this method when the module list gets long.
See also https://stackoverflow.com/questions/11509201/how-can-i-suppress-failed-modules-loaded-in-ghci
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | -------------- |
| Version | 8.0.1 |
| Type | FeatureRequest |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | GHCi |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"Option to suppress GHCi output \"Failed, modules loaded\"","status":"New","operating_system":"","component":"GHCi","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.0.1","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"FeatureRequest","description":"For projects with lots of modules, the \"modules loaded\" message can be considerably long. For example:\r\n\r\n{{{\r\nFailed, modules loaded: Distribution.Client.Check, Distribution.Client.Run, Distribution.Client.Tar, Distribution.Client.Types, Distribution.Client.Win32SelfUpgrade, Distribution.Client.Utils, Paths_cabal_install, Distribution.Client.BuildReports.Types, Distribution.Client.Dependency.Types, Distribution.Client.Init.Types, Distribution.Solver.Types.ConstraintSource, Distribution.Solver.Types.Settings, Distribution.Client.GlobalFlags, Distribution.Client.HttpUtils, Distribution.Client.Security.HTTP, Distribution.Solver.Types.PackageIndex, Distribution.Solver.Types.ComponentDeps, Distribution.Solver.Types.OptionalStanza, Distribution.Solver.Types.PackageFixedDeps, Distribution.Solver.Types.SourcePackage, Distribution.Solver.Types.LabeledPackageConstraint, Distribution.Solver.Types.PackageConstraint, Distribution.Client.World, Distribution.Client.FetchUtils, Distribution.Client.GZipUtils, Distribution.Client.Init.Licenses, Distribution.Client.Init.Heuristics, Distribution.Client.Compat.Process, Distribution.Client.JobControl, Distribution.Client.Compat.ExecutablePath, Distribution.Client.Compat.Semaphore, Distribution.Client.ParseUtils, Distribution.Client.Compat.FilePerms, Distribution.Client.Haddock, Distribution.Client.InstallPlan, Distribution.Client.SolverInstallPlan, Distribution.Client.BuildReports.Anonymous, Distribution.Client.BuildReports.Storage, Distribution.Solver.Types.PkgConfigDb, Distribution.Solver.Types.SolverPackage, Distribution.Solver.Types.SolverId, Distribution.Solver.Types.ResolverPackage, Distribution.Solver.Modular, Distribution.Client.PackageUtils, Distribution.Solver.Types.DependencyResolver, Distribution.Solver.Types.InstalledPreference, Distribution.Solver.Types.PackagePath, Distribution.Solver.Types.PackagePreferences, Distribution.Solver.Types.Progress, Distribution.Solver.Types.Variable, Distribution.Solver.Modular.Assignment, Distribution.Solver.Modular.ConfiguredConversion, Distribution.Solver.Modular.IndexConversion, Distribution.Solver.Modular.Log, Distribution.Solver.Modular.Package, Distribution.Solver.Modular.Solver, Distribution.Solver.Modular.Builder, Distribution.Solver.Modular.Cycles, Distribution.Solver.Modular.Dependency, Distribution.Solver.Modular.Explore, Distribution.Solver.Modular.Index, Distribution.Solver.Modular.Message, Distribution.Solver.Modular.Preference, Distribution.Solver.Modular.Validate, Distribution.Solver.Modular.Linking, Distribution.Solver.Modular.PSQ, Distribution.Solver.Modular.Tree, Distribution.Solver.Modular.Flag, Distribution.Solver.Modular.Version, Distribution.Solver.Modular.ConflictSet, Distribution.Solver.Modular.Var, Distribution.Solver.Modular.Configured, Distribution.Solver.Modular.LabeledGraph, Distribution.Client.ProjectPlanning.Types, Distribution.Client.DistDirLayout, Distribution.Client.PackageHash, Distribution.Client.RebuildMonad, Distribution.Client.Glob, Distribution.Client.FileMonitor, Distribution.Client.Utils.Json.\r\n*Distribution.Client.Check> \r\n}}}\r\n\r\nIt would be nice if there were a way to suppress this message. If there already is a way, it would be nice if GHCi mentioned this method when the module list gets long.\r\n\r\nSee also https://stackoverflow.com/questions/11509201/how-can-i-suppress-failed-modules-loaded-in-ghci","type_of_failure":"OtherFailure","blocking":[]} -->https://gitlab.haskell.org/ghc/ghc/-/issues/12449Broken types in identifiers bound by :print2022-01-20T10:27:34ZmniipBroken types in identifiers bound by :print```hs
GHCi, version 8.0.1: http://www.haskell.org/ghc/ :? for help
Prelude> :print show
show = (_t1::Show a => a -> String)
Prelude> :t _t1
<interactive>:1:1: error:
No instance for (Show a) arising from a use of ‘it’
```
Furtherm...```hs
GHCi, version 8.0.1: http://www.haskell.org/ghc/ :? for help
Prelude> :print show
show = (_t1::Show a => a -> String)
Prelude> :t _t1
<interactive>:1:1: error:
No instance for (Show a) arising from a use of ‘it’
```
Furthermore:
```hs
Prelude> _t1 "foo"
<interactive>:3:5: error:ghc: panic! (the 'impossible' happened)
(GHC version 8.0.1 for x86_64-unknown-linux):
No skolem info: a_a1hz
Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
Prelude>
```
Enabling `-fprint-explicit-foralls`, I think, reveals the issue:
```hs
Prelude> :set -fprint-explicit-foralls
Prelude> :print id
id = (_t2::a1 -> a1)
Prelude> :t id
id :: forall {a}. a -> a
Prelude> :t _t2
_t2 :: a1 -> a1
```
Similar behavior albeit with a different panic message happens on 7.8.4 and 7.10.3 as verified by bennofs over IRC:
```
GHCi, version 7.10.3: http://www.haskell.org/ghc/ :? for help
Prelude> :print print
print = (_t1::Show a => a -> IO ())
Prelude> _t1
ghc: panic! (the 'impossible' happened)
(GHC version 7.10.3 for x86_64-unknown-linux):
tcTyVarDetails a_apc
Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
```
1. 6.3 doesn't exhibit this issue:
```
GHCi, version 7.6.3: http://www.haskell.org/ghc/ :? for help
Prelude> :print id
id = (_t1::forall a. a -> a)
```
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 8.0.1 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"Broken types in identifiers bound by :print","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.0.1","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"{{{#!hs\r\nGHCi, version 8.0.1: http://www.haskell.org/ghc/ :? for help\r\nPrelude> :print show\r\nshow = (_t1::Show a => a -> String)\r\nPrelude> :t _t1\r\n\r\n<interactive>:1:1: error:\r\n No instance for (Show a) arising from a use of ‘it’\r\n}}}\r\nFurthermore:\r\n{{{#!hs\r\nPrelude> _t1 \"foo\"\r\n\r\n<interactive>:3:5: error:ghc: panic! (the 'impossible' happened)\r\n (GHC version 8.0.1 for x86_64-unknown-linux):\r\n\tNo skolem info: a_a1hz\r\n\r\nPlease report this as a GHC bug: http://www.haskell.org/ghc/reportabug\r\n\r\nPrelude> \r\n}}}\r\n\r\nEnabling `-fprint-explicit-foralls`, I think, reveals the issue:\r\n{{{#!hs\r\nPrelude> :set -fprint-explicit-foralls \r\nPrelude> :print id\r\nid = (_t2::a1 -> a1)\r\nPrelude> :t id\r\nid :: forall {a}. a -> a\r\nPrelude> :t _t2\r\n_t2 :: a1 -> a1\r\n}}}\r\n\r\nSimilar behavior albeit with a different panic message happens on 7.8.4 and 7.10.3 as verified by bennofs over IRC:\r\n{{{\r\nGHCi, version 7.10.3: http://www.haskell.org/ghc/ :? for help\r\nPrelude> :print print\r\nprint = (_t1::Show a => a -> IO ())\r\nPrelude> _t1\r\nghc: panic! (the 'impossible' happened)\r\n (GHC version 7.10.3 for x86_64-unknown-linux):\r\n\ttcTyVarDetails a_apc\r\n\r\nPlease report this as a GHC bug: http://www.haskell.org/ghc/reportabug\r\n}}}\r\n\r\n7.6.3 doesn't exhibit this issue:\r\n{{{\r\nGHCi, version 7.6.3: http://www.haskell.org/ghc/ :? for help\r\nPrelude> :print id\r\nid = (_t1::forall a. a -> a)\r\n}}}","type_of_failure":"OtherFailure","blocking":[]} -->Roland SennRoland Sennhttps://gitlab.haskell.org/ghc/ghc/-/issues/12447Pretty-printing of equality `~` without parentheses2019-07-07T18:26:35ZIcelandjackPretty-printing of equality `~` without parenthesesBased off on [Data.Constraint.Deferrable](https://github.com/ekmett/constraints/blob/master/src/Data/Constraint/Deferrable.hs)
```hs
{-# Language RankNTypes, ConstraintKinds #-}
import Data.Typeable
class Deferrable p where
deferE...Based off on [Data.Constraint.Deferrable](https://github.com/ekmett/constraints/blob/master/src/Data/Constraint/Deferrable.hs)
```hs
{-# Language RankNTypes, ConstraintKinds #-}
import Data.Typeable
class Deferrable p where
deferEither :: proxy p -> (p => r) -> Either String r
instance (Typeable a, Typeable b) => Deferrable (a ~ b) where
deferEither = undefined
```
`PolyKinds` aren't enabled so `deferEither @(_ ~ _)` is not enough to select the `Deferrable (a ~ b)` instance, but it is displayed without parentheses
```
$ ghci -XTypeApplications -ignore-dot-ghci tyiS.hs
GHCi, version 8.0.1: http://www.haskell.org/ghc/ :? for help
[1 of 1] Compiling Main ( tyiS.hs, interpreted )
Ok, modules loaded: Main.
*Main> :t deferEither @(_ ~ _)
deferEither @(_ ~ _)
:: Deferrable t ~ t1 =>
proxy t ~ t1 -> (t ~ t1 => r) -> Either String r
```
Instead of a preferable
```hs
deferEither @(_ ~ _) :: Deferrable (t ~ t1) => proxy (t ~ t1) -> (t ~ t1 => r) -> Either String r
```
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 8.0.1 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"Pretty-printing of equality `~` without parentheses","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.0.1","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"Based off on [https://github.com/ekmett/constraints/blob/master/src/Data/Constraint/Deferrable.hs Data.Constraint.Deferrable]\r\n\r\n{{{#!hs\r\n{-# Language RankNTypes, ConstraintKinds #-}\r\n\r\nimport Data.Typeable\r\n\r\nclass Deferrable p where\r\n deferEither :: proxy p -> (p => r) -> Either String r\r\n\r\ninstance (Typeable a, Typeable b) => Deferrable (a ~ b) where\r\n deferEither = undefined\r\n}}}\r\n\r\n`PolyKinds` aren't enabled so `deferEither @(_ ~ _)` is not enough to select the `Deferrable (a ~ b)` instance, but it is displayed without parentheses\r\n\r\n{{{\r\n$ ghci -XTypeApplications -ignore-dot-ghci tyiS.hs \r\nGHCi, version 8.0.1: http://www.haskell.org/ghc/ :? for help\r\n[1 of 1] Compiling Main ( tyiS.hs, interpreted )\r\nOk, modules loaded: Main.\r\n*Main> :t deferEither @(_ ~ _)\r\ndeferEither @(_ ~ _)\r\n :: Deferrable t ~ t1 =>\r\n proxy t ~ t1 -> (t ~ t1 => r) -> Either String r\r\n}}}\r\n\r\nInstead of a preferable \r\n\r\n{{{#!hs\r\ndeferEither @(_ ~ _) :: Deferrable (t ~ t1) => proxy (t ~ t1) -> (t ~ t1 => r) -> Either String r\r\n}}}","type_of_failure":"OtherFailure","blocking":[]} -->https://gitlab.haskell.org/ghc/ghc/-/issues/12446Doesn't suggest TypeApplications when `~` used prefix2020-10-23T10:30:35ZIcelandjackDoesn't suggest TypeApplications when `~` used prefix```
$ ghci -ignore-dot-ghci
GHCi, version 8.0.1: http://www.haskell.org/ghc/ :? for help
Prelude> :t undefined @(_ ~ _)
<interactive>:1:1: error:
Pattern syntax in expression context: undefined@(_ (~(_)))
Did you mean to enable...```
$ ghci -ignore-dot-ghci
GHCi, version 8.0.1: http://www.haskell.org/ghc/ :? for help
Prelude> :t undefined @(_ ~ _)
<interactive>:1:1: error:
Pattern syntax in expression context: undefined@(_ (~(_)))
Did you mean to enable TypeApplications?
```
It is suggested with non-`~` type operators
```
Prelude> :t undefined @((+) _ _)
<interactive>:1:1: error:
Pattern syntax in expression context: undefined@((+) (_) (_))
Did you mean to enable TypeApplications?
```
but not with
```
Prelude> :t undefined @((~) _ _)
<interactive>:1:15: error: parse error on input ‘)’
```
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 8.0.1 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"Doesn't suggest TypeApplications when `~` used prefix","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.0.1","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"{{{\r\n$ ghci -ignore-dot-ghci\r\nGHCi, version 8.0.1: http://www.haskell.org/ghc/ :? for help\r\nPrelude> :t undefined @(_ ~ _)\r\n\r\n<interactive>:1:1: error:\r\n Pattern syntax in expression context: undefined@(_ (~(_)))\r\n Did you mean to enable TypeApplications?\r\n}}}\r\n\r\nIt is suggested with non-`~` type operators\r\n\r\n{{{\r\nPrelude> :t undefined @((+) _ _)\r\n\r\n<interactive>:1:1: error:\r\n Pattern syntax in expression context: undefined@((+) (_) (_))\r\n Did you mean to enable TypeApplications?\r\n}}}\r\n\r\nbut not with\r\n\r\n{{{\r\nPrelude> :t undefined @((~) _ _)\r\n\r\n<interactive>:1:15: error: parse error on input ‘)’\r\n}}}","type_of_failure":"OtherFailure","blocking":[]} -->https://gitlab.haskell.org/ghc/ghc/-/issues/12445showSDocUnsafe generate GHC panic2019-07-07T18:26:35ZBetshowSDocUnsafe generate GHC panicTry in ghci:
```hs
:set -package ghc
:m Outputable
let x = text "SomeDoc"
showSDocUnsafe x
```
The code abobe generate:
"ghc.exe: panic! (the 'impossible' happened)
(GHC version 7.10.3 for x86_64-unknown-mingw32):
> v_unsafeGlobal...Try in ghci:
```hs
:set -package ghc
:m Outputable
let x = text "SomeDoc"
showSDocUnsafe x
```
The code abobe generate:
"ghc.exe: panic! (the 'impossible' happened)
(GHC version 7.10.3 for x86_64-unknown-mingw32):
> v_unsafeGlobalDynFlags: not initialised
Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 7.10.3 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | GHC API |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"showSDocUnsafe generate GHC panic","status":"New","operating_system":"","component":"GHC API","related":[],"milestone":"⊥","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"7.10.3","keywords":["GHC","panic"],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"Try in ghci:\r\n\r\n{{{#!hs\r\n:set -package ghc\r\n:m Outputable\r\nlet x = text \"SomeDoc\"\r\nshowSDocUnsafe x\r\n}}}\r\n\r\nThe code abobe generate:\r\n\r\n\"ghc.exe: panic! (the 'impossible' happened)\r\n (GHC version 7.10.3 for x86_64-unknown-mingw32):\r\n v_unsafeGlobalDynFlags: not initialised\r\n\r\nPlease report this as a GHC bug: http://www.haskell.org/ghc/reportabug","type_of_failure":"OtherFailure","blocking":[]} -->⊥https://gitlab.haskell.org/ghc/ghc/-/issues/12444Regression: panic! on inaccessible code with constraint2019-07-07T18:26:35ZZilin Chenzilin.chen@data61.csiro.auRegression: panic! on inaccessible code with constraintRunning the following program with ghci-8.0.1:
```hs
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
module Prove where
data Nat = Zero | Succ Nat
data SNat (n :: Nat) w...Running the following program with ghci-8.0.1:
```hs
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
module Prove where
data Nat = Zero | Succ Nat
data SNat (n :: Nat) where
SZero :: SNat Zero
SSucc :: SNat n -> SNat (Succ n)
type family (:+:) (a :: Nat) (b :: Nat) :: Nat where
m :+: Zero = m
m :+: (Succ n) = Succ (m :+: n)
sadd :: ((Succ n1 :+: n) ~ Succ (n1 :+: n), (Succ n1) ~ m) => SNat m -> SNat n -> SNat (m :+: n)
sadd SZero n = n
```
-ddump-tc-trace shows:
```
...
dischargeFmv
s_a9qV[fuv:4] = t_a9qW[tau:5]
(1 kicked out)
doTopReactFunEq (occurs)
old_ev: [D] _ :: ((n1_a9qu[sk] :+: 'Succ s_a9qV[fuv:4]) :: Nat)
GHC.Prim.~#
(s_a9qV[fuv:4] :: Nat)ghc: panic! (the 'impossible' happened)
(GHC version 8.0.1 for x86_64-unknown-linux):
ctEvCoercion
[D] _ :: (t_a9qW[tau:5] :: Nat)
~#
('Succ (n1_a9qu[sk] :+: s_a9qV[fuv:4]) :: Nat)
Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
```
It is rightly rejected by ghci-7.10.2:
```
Prove.hs:42:6:
Couldn't match type ‘'Succ n1’ with ‘'Zero’
Inaccessible code in
a pattern with constructor
SZero :: SNat 'Zero,
in an equation for ‘sadd’
In the pattern: SZero
In an equation for ‘sadd’: sadd SZero n = n
Failed, modules loaded: none.
```
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 8.0.1 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"Regression: panic! on inaccessible code with constraint","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.0.1","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"Running the following program with ghci-8.0.1:\r\n{{{#!hs\r\n\r\n{-# LANGUAGE DataKinds #-}\r\n{-# LANGUAGE GADTs #-}\r\n{-# LANGUAGE TypeFamilies #-}\r\n{-# LANGUAGE TypeOperators #-}\r\n\r\nmodule Prove where\r\n\r\n\r\ndata Nat = Zero | Succ Nat\r\n\r\ndata SNat (n :: Nat) where\r\n SZero :: SNat Zero\r\n SSucc :: SNat n -> SNat (Succ n)\r\n\r\ntype family (:+:) (a :: Nat) (b :: Nat) :: Nat where\r\n m :+: Zero = m\r\n m :+: (Succ n) = Succ (m :+: n)\r\n\r\nsadd :: ((Succ n1 :+: n) ~ Succ (n1 :+: n), (Succ n1) ~ m) => SNat m -> SNat n -> SNat (m :+: n)\r\nsadd SZero n = n\r\n}}}\r\n\r\n-ddump-tc-trace shows:\r\n{{{\r\n...\r\ndischargeFmv\r\n s_a9qV[fuv:4] = t_a9qW[tau:5]\r\n (1 kicked out)\r\ndoTopReactFunEq (occurs)\r\n old_ev: [D] _ :: ((n1_a9qu[sk] :+: 'Succ s_a9qV[fuv:4]) :: Nat)\r\n GHC.Prim.~#\r\n (s_a9qV[fuv:4] :: Nat)ghc: panic! (the 'impossible' happened)\r\n (GHC version 8.0.1 for x86_64-unknown-linux):\r\n\tctEvCoercion\r\n [D] _ :: (t_a9qW[tau:5] :: Nat)\r\n ~#\r\n ('Succ (n1_a9qu[sk] :+: s_a9qV[fuv:4]) :: Nat)\r\n\r\nPlease report this as a GHC bug: http://www.haskell.org/ghc/reportabug\r\n\r\n}}}\r\n\r\nIt is rightly rejected by ghci-7.10.2:\r\n{{{\r\nProve.hs:42:6:\r\n Couldn't match type ‘'Succ n1’ with ‘'Zero’\r\n Inaccessible code in\r\n a pattern with constructor\r\n SZero :: SNat 'Zero,\r\n in an equation for ‘sadd’\r\n In the pattern: SZero\r\n In an equation for ‘sadd’: sadd SZero n = n\r\nFailed, modules loaded: none.\r\n\r\n}}}\r\n","type_of_failure":"OtherFailure","blocking":[]} -->https://gitlab.haskell.org/ghc/ghc/-/issues/12443DEFAULT_TMPDIR is documented, but doesn't exist2019-07-07T18:26:35ZrwbartonDEFAULT_TMPDIR is documented, but doesn't existThe user's guide claims
```
Even better idea: Set the :envvar:`DEFAULT_TMPDIR` :command:`make` variable when
building GHC, and never worry about :envvar:`TMPDIR` again. (see the build
documentation).
```
But only vestiges o...The user's guide claims
```
Even better idea: Set the :envvar:`DEFAULT_TMPDIR` :command:`make` variable when
building GHC, and never worry about :envvar:`TMPDIR` again. (see the build
documentation).
```
But only vestiges of this functionality remain in `mk/config.mk.in` and in `nofib`, and it doesn't appear to actually do anything. I suggest removing it from the documentation.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------- |
| Version | 8.0.1 |
| 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":"DEFAULT_TMPDIR is documented, but doesn't exist","status":"New","operating_system":"","component":"Documentation","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.0.1","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"The user's guide claims\r\n{{{\r\n Even better idea: Set the :envvar:`DEFAULT_TMPDIR` :command:`make` variable when\r\n building GHC, and never worry about :envvar:`TMPDIR` again. (see the build\r\n documentation).\r\n}}}\r\nBut only vestiges of this functionality remain in `mk/config.mk.in` and in `nofib`, and it doesn't appear to actually do anything. I suggest removing it from the documentation.","type_of_failure":"OtherFailure","blocking":[]} -->8.2.1https://gitlab.haskell.org/ghc/ghc/-/issues/12442Pure unifier usually doesn't need to unify kinds2019-07-07T18:26:36ZRichard Eisenbergrae@richarde.devPure unifier usually doesn't need to unify kindsThe pure unifier (in `types/Unify.hs`) is used to match up instances with actual types. Since GHC 8, it matches up the kinds with the types in a separate pass. But this is often wasteful, and sometimes downright wrong.
It's wasteful bec...The pure unifier (in `types/Unify.hs`) is used to match up instances with actual types. Since GHC 8, it matches up the kinds with the types in a separate pass. But this is often wasteful, and sometimes downright wrong.
It's wasteful because most invocations of the unifier on a list of types pass in well-kinded arguments to some type constructor. Because the kinds of type constructors are closed, if we process the list left-to-right, we will always unify the kinds of later arguments before we get to them. So we shouldn't take another pass on the kinds.
It's wrong because it's conceivable for the kind to include a type family application, and using a type family application as a template in the pure unifier is very silly, indeed.
I cam across this while trying to translate Idris's algebraic effects library to Haskell. My reduced test case is attached.
Patch on the way.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 8.0.1 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"Pure unifier usually doesn't need to unify kinds","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.0.1","keywords":["TypeInType"],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"The pure unifier (in `types/Unify.hs`) is used to match up instances with actual types. Since GHC 8, it matches up the kinds with the types in a separate pass. But this is often wasteful, and sometimes downright wrong.\r\n\r\nIt's wasteful because most invocations of the unifier on a list of types pass in well-kinded arguments to some type constructor. Because the kinds of type constructors are closed, if we process the list left-to-right, we will always unify the kinds of later arguments before we get to them. So we shouldn't take another pass on the kinds.\r\n\r\nIt's wrong because it's conceivable for the kind to include a type family application, and using a type family application as a template in the pure unifier is very silly, indeed.\r\n\r\nI cam across this while trying to translate Idris's algebraic effects library to Haskell. My reduced test case is attached.\r\n\r\nPatch on the way.","type_of_failure":"OtherFailure","blocking":[]} -->Richard Eisenbergrae@richarde.devRichard Eisenbergrae@richarde.devhttps://gitlab.haskell.org/ghc/ghc/-/issues/12441Conflicting definitions error does not print explicit quantifiers when necessary2019-07-07T18:26:36ZEdward Z. YangConflicting definitions error does not print explicit quantifiers when necessary```hs
-- Y.hs-boot
{-# LANGUAGE ScopedTypeVariables #-}
module Y where
f :: forall a b. (a, b)
-- YY.hs
module YY where
import {-# SOURCE #-} Y
-- Y.hs
{-# LANGUAGE ScopedTypeVariables #-}
module Y where
import YY
f :: forall b a. (a, ...```hs
-- Y.hs-boot
{-# LANGUAGE ScopedTypeVariables #-}
module Y where
f :: forall a b. (a, b)
-- YY.hs
module YY where
import {-# SOURCE #-} Y
-- Y.hs
{-# LANGUAGE ScopedTypeVariables #-}
module Y where
import YY
f :: forall b a. (a, b)
f = undefined
```
I get the following unhelpful error:
```
ezyang@sabre:~$ ghc-8.0 --make Y.hs -fforce-recomp
[1 of 3] Compiling Y[boot] ( Y.hs-boot, Y.o-boot )
[2 of 3] Compiling YY ( YY.hs, YY.o )
[3 of 3] Compiling Y ( Y.hs, Y.o )
Y.hs-boot:3:1: error:
Identifier ‘f’ has conflicting definitions in the module
and its hs-boot file
Main module: f :: (a, b)
Boot file: f :: (a, b)
The two types are different
```
Yes this example is purposely shooting itself in the foot, but in the wild I encountered an un-annotated type which inferred a different quantifier ordering than what I expected, and I subsequently spent a while puzzling over the error message. `-fprint-explicit-foralls` is a sufficient workaround.8.2.1Phil de JouxPhil de Jouxhttps://gitlab.haskell.org/ghc/ghc/-/issues/12439DeriveDataTypeable - deriving Data for several type constructor applications2019-07-07T18:26:36ZlspitznerDeriveDataTypeable - deriving Data for several type constructor applications```hs
{-# LANGUAGE DeriveDataTypeable, StandaloneDeriving #-}
import qualified Data.Data
data Mu f = Mu (f (Mu f))
deriving instance Data.Data.Data (Mu [])
deriving instance Data.Data.Data (Mu IO)
```
produces
```
Multiple declara...```hs
{-# LANGUAGE DeriveDataTypeable, StandaloneDeriving #-}
import qualified Data.Data
data Mu f = Mu (f (Mu f))
deriving instance Data.Data.Data (Mu [])
deriving instance Data.Data.Data (Mu IO)
```
produces
```
Multiple declarations of ‘$t3Ecq4GuAmh1HtkHHwEpyjp’
[..]
Multiple declarations of ‘$c3Ecq4GuAmh1HtkHHwEpyjp’
[..]
Duplicate type signatures for ‘$t3Ecq4GuAmh1HtkHHwEpyjp’
[..]
Duplicate type signatures for ‘$c3Ecq4GuAmh1HtkHHwEpyjp’
[..]
```
As a workaround one can define instances in separate modules.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 8.0.1 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"DeriveDataTypeable - deriving Data for several type constructor applications","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.0.1","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"{{{#!hs\r\n{-# LANGUAGE DeriveDataTypeable, StandaloneDeriving #-}\r\nimport qualified Data.Data\r\n\r\ndata Mu f = Mu (f (Mu f))\r\nderiving instance Data.Data.Data (Mu [])\r\nderiving instance Data.Data.Data (Mu IO)\r\n}}}\r\n\r\nproduces\r\n\r\n{{{\r\n Multiple declarations of ‘$t3Ecq4GuAmh1HtkHHwEpyjp’\r\n [..]\r\n Multiple declarations of ‘$c3Ecq4GuAmh1HtkHHwEpyjp’\r\n [..]\r\n Duplicate type signatures for ‘$t3Ecq4GuAmh1HtkHHwEpyjp’\r\n [..]\r\n Duplicate type signatures for ‘$c3Ecq4GuAmh1HtkHHwEpyjp’\r\n [..]\r\n}}}\r\n\r\nAs a workaround one can define instances in separate modules.","type_of_failure":"OtherFailure","blocking":[]} -->https://gitlab.haskell.org/ghc/ghc/-/issues/12438DeriveDataTypeable - deriving instance Data (Mu (Const ()))2019-07-07T18:26:37ZlspitznerDeriveDataTypeable - deriving instance Data (Mu (Const ()))```hs
{-# LANGUAGE DeriveDataTypeable, StandaloneDeriving #-}
import qualified Data.Data
data Mu f = Mu (f (Mu f))
deriving instance Data.Data.Data (Mu (Const ()))
```
produces
```
• No instance for (Data (Const () (Mu (Const ()))...```hs
{-# LANGUAGE DeriveDataTypeable, StandaloneDeriving #-}
import qualified Data.Data
data Mu f = Mu (f (Mu f))
deriving instance Data.Data.Data (Mu (Const ()))
```
produces
```
• No instance for (Data (Const () (Mu (Const ()))))
arising from a use of ‘k’
• In the expression: (z Mu `k` a1)
In an equation for ‘gfoldl’: gfoldl k z (Mu a1) = (z Mu `k` a1)
When typechecking the code for ‘gfoldl’
in a derived instance for ‘Data (Mu (Const ()))’:
To see the code I am typechecking, use -ddump-deriv
In the instance declaration for ‘Data (Mu (Const ()))’
```
while other type constructors work, e.g.
```hs
deriving instance Data.Data.Data (Mu [])
deriving instance Data.Data.Data (Mu ((,) ()))
```
i am not sure if #10835 is related.8.2.1https://gitlab.haskell.org/ghc/ghc/-/issues/12435Turn "No alternatives for a case scrutinee not known to diverge for sure" int...2019-07-07T18:26:38ZJoachim Breitnermail@joachim-breitner.deTurn "No alternatives for a case scrutinee not known to diverge for sure" into a warningThis was discussed in the context of #10180, #11290 and [D851](https://phabricator.haskell.org/D851); let’s focus on this here.
In changeset:a0678f1f0e62496c108491e1c80d5eef3936474a/ghc we introduced a lint *error* that would abort comp...This was discussed in the context of #10180, #11290 and [D851](https://phabricator.haskell.org/D851); let’s focus on this here.
In changeset:a0678f1f0e62496c108491e1c80d5eef3936474a/ghc we introduced a lint *error* that would abort compilation if there is an empty case with a scrutinee not known to diverge for sure. It is then nature of such a test that it is never complete (we’d solve the halting problem). Occasionally, when working on other parts of the code, together with other transformations (such as CSE), we get Core code that does not pass the test, even though the scrutinee *is* diverging.
Whenever it occurs, we have to find out why needs to be done to make the test pass again, e.g. by ensuring that CSE cse’s things in the right order, or whatnot. This slows down development (e.g. I cannot test my work on #12368 on the auto-builders because of this).
It feels wrong to me to give a necessarily non-complete test such a high priority. I therefore propose to turn this check into a lint *warning*.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 8.1 |
| Type | Task |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | simonpj |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"Turn \"No alternatives for a case scrutinee not known to diverge for sure\" into a warning","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.1","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":["simonpj"],"type":"Task","description":"This was discussed in the context of #10180, #11290 and Phab:D851; let’s focus on this here.\r\n\r\nIn changeset:a0678f1f0e62496c108491e1c80d5eef3936474a/ghc we introduced a lint ''error'' that would abort compilation if there is an empty case with a scrutinee not known to diverge for sure. It is then nature of such a test that it is never complete (we’d solve the halting problem). Occasionally, when working on other parts of the code, together with other transformations (such as CSE), we get Core code that does not pass the test, even though the scrutinee ''is'' diverging.\r\n\r\nWhenever it occurs, we have to find out why needs to be done to make the test pass again, e.g. by ensuring that CSE cse’s things in the right order, or whatnot. This slows down development (e.g. I cannot test my work on #12368 on the auto-builders because of this).\r\n\r\nIt feels wrong to me to give a necessarily non-complete test such a high priority. I therefore propose to turn this check into a lint ''warning''.","type_of_failure":"OtherFailure","blocking":[]} -->8.2.1