GHC issueshttps://gitlab.haskell.org/ghc/ghc/-/issues2019-07-07T18:03:32Zhttps://gitlab.haskell.org/ghc/ghc/-/issues/15666Dependent type synonym in recursive type family causes GHC to panic2019-07-07T18:03:32ZtydeuDependent type synonym in recursive type family causes GHC to panic# Background
I had written the following code in Haskell (GHC):
```hs
{-# LANGUAGE
NoImplicitPrelude,
TypeInType, PolyKinds, DataKinds,
ScopedTypeVariables,
TypeFamilies,
UndecidableInstances
#-}
import Data.Kind(Type)
dat...# Background
I had written the following code in Haskell (GHC):
```hs
{-# LANGUAGE
NoImplicitPrelude,
TypeInType, PolyKinds, DataKinds,
ScopedTypeVariables,
TypeFamilies,
UndecidableInstances
#-}
import Data.Kind(Type)
data PolyType k (t :: k)
type Wrap (t :: k) = PolyType k t
type Unwrap pt = (GetType pt :: GetKind pt)
type family GetKind (pt :: Type) :: Type where
GetKind (PolyType k t) = k
type family GetType (pt :: Type) :: k where
GetType (PolyType k t) = t
```
The intention of this code is to allow me to wrap a type of an arbitrary kind
into a type (namely `PolyType`) of a single kind (namely `Type`) and then
reverse the process (i.e. unwrap it) later.
# Problem
I wanted to define a function that would recursively operate on a composite type like so:
```hs
data Composite :: a -> b -> Type
type family RecursiveWrap expr where
RecursiveWrap (Composite a b) =
Wrap (Composite (Unwrap (RecursiveWrap a)) (Unwrap (RecursiveWrap b)))
RecursiveWrap x = Wrap x
```
However, the above definition causes GHC to panic:
```
ghc.exe: panic! (the 'impossible' happened)
(GHC version 8.4.3 for x86_64-unknown-mingw32):
cyclic evaluation in fixIO
```
# Ideas
If we inline the the `Unwrap` synoynm into the defintion of the type family
above like so:
```hs
type family RecursiveWrap expr where
RecursiveWrap (Composite a b) =
Wrap (Composite
(GetType (RecursiveWrap a) :: GetKind (RecursiveWrap a))
(GetType (RecursiveWrap a) :: GetKind (RecursiveWrap a))
)
RecursiveWrap x = Wrap x
```
GHC instead simply produces an error:
```
* Type constructor `RecursiveWrap' cannot be used here
(it is defined and used in the same recursive group)
* In the first argument of `GetKind', namely `(RecursiveWrap a)'
In the kind `GetKind (RecursiveWrap a)'
In the first argument of `Composite', namely
`(GetType (RecursiveWrap a) :: GetKind (RecursiveWrap a))'
```
As such, I suspect this has to do with the recursive type family appearing in
the kind signature when the `Unwrap` type synonym is expanded.
However, it strikes me as odd that even the above code errors. Since with the
`UndecidableInstances` extension turned on, I think that I should be able to
write recursive type families like the above. Especially given that the above
family would not loop indefinitely and thus be reducible.8.6.1https://gitlab.haskell.org/ghc/ghc/-/issues/15647ghc: panic! (the 'impossible' happened)2019-07-07T18:03:36Zmonomonghc: panic! (the 'impossible' happened)```
ghc: panic! (the 'impossible' happened)
(GHC version 8.0.2 for x86_64-unknown-linux):
initTc: unsolved constraints
WC {wc_insol =
[W] ask_an9K :: t_an9J[tau:1] (CHoleCan: ask)
[W] put_an9Q :: t_an9P[tau:1] (CHole...```
ghc: panic! (the 'impossible' happened)
(GHC version 8.0.2 for x86_64-unknown-linux):
initTc: unsolved constraints
WC {wc_insol =
[W] ask_an9K :: t_an9J[tau:1] (CHoleCan: ask)
[W] put_an9Q :: t_an9P[tau:1] (CHoleCan: put)}
```
So this code derives an instance of the Decimal type incorrectly, but not sure if this is causing the error.
I have some nested records, which contain a few Decimals. I am trying to make them acidic.
```hs
instance SafeCopy (DecimalRaw a) where
putCopy (Decimal d) = contain $ safePut d
getCopy = contain $ Decimal <$> safeGet
deriveSafeCopy 0 'base ''Client
deriveSafeCopy 0 'base ''Article
deriveSafeCopy 0 'base ''ServerData
makeLenses ''ServerData
writeState :: String -> Update ServerData ()
writeState newValue
= put (ServerData newValue)
queryState :: Update ServerData String
queryState = do ServerData string <- ask
return string
makeAcidic ''ServerData ['writeState 'queryState]
```
<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 | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"ghc: panic! (the 'impossible' happened)","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"8.6.1","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.0.2","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"{{{\r\nghc: panic! (the 'impossible' happened)\r\n (GHC version 8.0.2 for x86_64-unknown-linux):\r\n\tinitTc: unsolved constraints\r\n WC {wc_insol =\r\n [W] ask_an9K :: t_an9J[tau:1] (CHoleCan: ask)\r\n [W] put_an9Q :: t_an9P[tau:1] (CHoleCan: put)}\r\n}}}\r\n\r\nSo this code derives an instance of the Decimal type incorrectly, but not sure if this is causing the error.\r\n\r\nI have some nested records, which contain a few Decimals. I am trying to make them acidic.\r\n\r\n{{{#!hs\r\ninstance SafeCopy (DecimalRaw a) where\r\n putCopy (Decimal d) = contain $ safePut d\r\n getCopy = contain $ Decimal <$> safeGet\r\n\r\nderiveSafeCopy 0 'base ''Client\r\nderiveSafeCopy 0 'base ''Article\r\n\r\n\r\nderiveSafeCopy 0 'base ''ServerData\r\nmakeLenses ''ServerData\r\n\r\nwriteState :: String -> Update ServerData ()\r\nwriteState newValue\r\n = put (ServerData newValue)\r\nqueryState :: Update ServerData String\r\nqueryState = do ServerData string <- ask\r\n return string\r\n\r\nmakeAcidic ''ServerData ['writeState 'queryState]\r\n}}}\r\n","type_of_failure":"OtherFailure","blocking":[]} -->8.6.1https://gitlab.haskell.org/ghc/ghc/-/issues/15586Compilation panic! (the 'impossible' happened)2019-07-07T18:04:01ZsubaruruCompilation panic! (the 'impossible' happened)See attached zip for entire project causing error. I'd imagine it's pretty reproducible, just call stack build. I'm running standard lts-12.8 and it's just two small files that don't do anything yet!
Also included is panicmessage.txt sho...See attached zip for entire project causing error. I'd imagine it's pretty reproducible, just call stack build. I'm running standard lts-12.8 and it's just two small files that don't do anything yet!
Also included is panicmessage.txt showing the exact output, crucially:
```
ghc: panic! (the 'impossible' happened)
(GHC version 8.4.3 for x86_64-unknown-linux):
piResultTy
*
v_XabT
Call stack:
CallStack (from HasCallStack):
callStackDoc, called at compiler/utils/Outputable.hs:1150:37 in ghc:Outputable
pprPanic, called at compiler/types/Type.hs:947:35 in ghc:Type
```
Oh and sysinfo
```
uname -a
Linux @@@ 4.16.11-100.fc26.x86_64 #1 SMP Tue May 22 20:02:12 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
```
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | -------------- |
| Version | 8.4.3 |
| 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":"Compilation panic! (the 'impossible' happened)","status":"New","operating_system":"Linux","component":"Compiler","related":[],"milestone":"8.6.1","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.4.3","keywords":[],"differentials":[],"test_case":"","architecture":"x86_64 (amd64)","cc":[""],"type":"Bug","description":"See attached zip for entire project causing error. I'd imagine it's pretty reproducible, just call stack build. I'm running standard lts-12.8 and it's just two small files that don't do anything yet!\r\nAlso included is panicmessage.txt showing the exact output, crucially:\r\n\r\n{{{\r\nghc: panic! (the 'impossible' happened)\r\n (GHC version 8.4.3 for x86_64-unknown-linux):\r\n\tpiResultTy\r\n *\r\n v_XabT\r\n Call stack:\r\n CallStack (from HasCallStack):\r\n callStackDoc, called at compiler/utils/Outputable.hs:1150:37 in ghc:Outputable\r\n pprPanic, called at compiler/types/Type.hs:947:35 in ghc:Type\r\n\r\n}}}\r\n\r\nOh and sysinfo \r\n\r\n\r\n{{{\r\nuname -a\r\nLinux @@@ 4.16.11-100.fc26.x86_64 #1 SMP Tue May 22 20:02:12 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux\r\n}}}\r\n\r\n\r\n","type_of_failure":"OtherFailure","blocking":[]} -->8.6.1https://gitlab.haskell.org/ghc/ghc/-/issues/15537Panic when building Crucible2019-07-07T18:04:15ZLangston BarrettPanic when building CrucibleI've encountered a panic, which GHC has asked me to report:
```
[19 of 21] Compiling Lang.Crucible.LLVM.Translation ( src/Lang/Crucible/LLVM/Translation.hs, dist/build/Lang/Crucible/LLVM/Translation.p_o )
<no location info>: error:
...I've encountered a panic, which GHC has asked me to report:
```
[19 of 21] Compiling Lang.Crucible.LLVM.Translation ( src/Lang/Crucible/LLVM/Translation.hs, dist/build/Lang/Crucible/LLVM/Translation.p_o )
<no location info>: error:
ghc: panic! (the 'impossible' happened)
(GHC version 8.4.3 for x86_64-unknown-linux):
isUnliftedType
r_a4Zsg :: TYPE rep_a4Zsf
Call stack:
CallStack (from HasCallStack):
callStackDoc, called at compiler/utils/Outputable.hs:1150:37 in ghc:Outputable
pprPanic, called at compiler/types/Type.hs:1939:10 in ghc:Type
Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
```
This was when compiling [crucible-llvm](https://github.com/GaloisInc/crucible/tree/master/crucible-llvm) revision 186mfb7wlz with GHC 8.4.3.
I'm building in Nix with a sandbox, so this should be easily reproducible. The Nix files are available here: https://github.com/siddharthist/galois-haskell-nix/tree/ghc-bug. Just run nix-build -A haskellPackages.crucible-llvm.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 8.4.3 |
| 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":"Panic when building Crucible","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"8.6.1","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.4.3","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"I've encountered a panic, which GHC has asked me to report:\r\n{{{\r\n[19 of 21] Compiling Lang.Crucible.LLVM.Translation ( src/Lang/Crucible/LLVM/Translation.hs, dist/build/Lang/Crucible/LLVM/Translation.p_o )\r\n\r\n<no location info>: error:\r\n ghc: panic! (the 'impossible' happened)\r\n (GHC version 8.4.3 for x86_64-unknown-linux):\r\n isUnliftedType\r\n r_a4Zsg :: TYPE rep_a4Zsf\r\n Call stack:\r\n CallStack (from HasCallStack):\r\n callStackDoc, called at compiler/utils/Outputable.hs:1150:37 in ghc:Outputable\r\n pprPanic, called at compiler/types/Type.hs:1939:10 in ghc:Type\r\n\r\nPlease report this as a GHC bug: http://www.haskell.org/ghc/reportabug\r\n\r\n}}}\r\nThis was when compiling [https://github.com/GaloisInc/crucible/tree/master/crucible-llvm crucible-llvm] revision 186mfb7wlz with GHC 8.4.3.\r\n\r\nI'm building in Nix with a sandbox, so this should be easily reproducible. The Nix files are available here: https://github.com/siddharthist/galois-haskell-nix/tree/ghc-bug. Just run nix-build -A haskellPackages.crucible-llvm.\r\n","type_of_failure":"OtherFailure","blocking":[]} -->8.6.1https://gitlab.haskell.org/ghc/ghc/-/issues/15516ghci: dynamic linking fails on osx2022-05-15T03:33:26Zkfizghci: dynamic linking fails on osx```
ghc: panic! (the 'impossible' happened)
(GHC version 8.4.3 for x86_64-apple-darwin):
Loading temp shared object failed: dlopen(/var/folders/vj/cm0c8jrs739_t411zdcx72240000gp/T/ghc24522_0/libghc_9.dylib, 5): Symbol not found: _Data...```
ghc: panic! (the 'impossible' happened)
(GHC version 8.4.3 for x86_64-apple-darwin):
Loading temp shared object failed: dlopen(/var/folders/vj/cm0c8jrs739_t411zdcx72240000gp/T/ghc24522_0/libghc_9.dylib, 5): Symbol not found: _DataziCsvUtils_rowBy_closure
Referenced from: /var/folders/vj/cm0c8jrs739_t411zdcx72240000gp/T/ghc24522_0/libghc_9.dylib
Expected in: flat namespace
in /var/folders/vj/cm0c8jrs739_t411zdcx72240000gp/T/ghc24522_0/libghc_9.dylib
Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
```8.6.1https://gitlab.haskell.org/ghc/ghc/-/issues/15428Oversaturated type family application panicks GHC (piResultTys2)2019-07-07T18:04:56ZRyan ScottOversaturated type family application panicks GHC (piResultTys2)The following program panics when compiled with GHC 8.6.1 or HEAD:
```hs
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeInType #-}
{-# LANGUAGE TypeOperators #-}
module Bug where
import Data.Kind
im...The following program panics when compiled with GHC 8.6.1 or HEAD:
```hs
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeInType #-}
{-# LANGUAGE TypeOperators #-}
module Bug where
import Data.Kind
import Data.Proxy
import Data.Type.Equality
type family Flurmp :: k
type family Pure (x :: a) :: f a
wat :: forall (f :: Type -> Type) (p :: Type).
Proxy (f p) -> ()
wat _ =
let s :: (Flurmp :: f p)
:~: Pure (Flurmp :: p -> p) (Flurmp :: p)
s = undefined
in ()
```
```
$ /opt/ghc/8.6.1/bin/ghc Bug.hs
[1 of 1] Compiling Bug ( Bug.hs, Bug.o )
ghc: panic! (the 'impossible' happened)
(GHC version 8.6.0.20180714 for x86_64-unknown-linux):
piResultTys2
f_aAT a_aAU
[(->) p_a1uI[sk:1], p_a1uI[sk:1] -> p_a1uI[sk:1], Flurmp, Flurmp]
[Flurmp]
Call stack:
CallStack (from HasCallStack):
callStackDoc, called at compiler/utils/Outputable.hs:1164:37 in ghc:Outputable
pprPanic, called at compiler/types/Type.hs:1041:9 in ghc:Type
```
On GHC 8.4 and earlier, this simply gives an error message:
```
$ /opt/ghc/8.4.3/bin/ghc Bug.hs
[1 of 1] Compiling Bug ( Bug.hs, Bug.o )
Bug.hs:18:16: error:
• Expecting one more argument to ‘Pure (Flurmp :: p -> p)’
Expected kind ‘p -> f p’,
but ‘Pure (Flurmp :: p -> p)’ has kind ‘p -> p -> p’
• In the second argument of ‘(:~:)’, namely
‘Pure (Flurmp :: p -> p) (Flurmp :: p)’
In the type signature:
s :: (Flurmp :: f p) :~: Pure (Flurmp :: p -> p) (Flurmp :: p)
In the expression:
let
s :: (Flurmp :: f p) :~: Pure (Flurmp :: p -> p) (Flurmp :: p)
s = undefined
in ()
• Relevant bindings include
wat :: Proxy (f p) -> () (bound at Bug.hs:16:1)
|
18 | :~: Pure (Flurmp :: p -> p) (Flurmp :: p)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
```
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 8.5 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | high |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"GHC 8.6+ panics (piResultTys2), older GHCs don't","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"8.6.1","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.5","keywords":["TypeFamilies","TypeInType,"],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"The following program panics when compiled with GHC 8.6.1 or HEAD:\r\n\r\n{{{#!hs\r\n{-# LANGUAGE ScopedTypeVariables #-}\r\n{-# LANGUAGE TypeFamilies #-}\r\n{-# LANGUAGE TypeInType #-}\r\n{-# LANGUAGE TypeOperators #-}\r\nmodule Bug where\r\n\r\nimport Data.Kind\r\nimport Data.Proxy\r\nimport Data.Type.Equality\r\n\r\ntype family Flurmp :: k\r\ntype family Pure (x :: a) :: f a\r\n\r\nwat :: forall (f :: Type -> Type) (p :: Type).\r\n Proxy (f p) -> ()\r\nwat _ =\r\n let s :: (Flurmp :: f p)\r\n :~: Pure (Flurmp :: p -> p) (Flurmp :: p)\r\n s = undefined\r\n in ()\r\n}}}\r\n{{{\r\n$ /opt/ghc/8.6.1/bin/ghc Bug.hs\r\n[1 of 1] Compiling Bug ( Bug.hs, Bug.o )\r\nghc: panic! (the 'impossible' happened)\r\n (GHC version 8.6.0.20180714 for x86_64-unknown-linux):\r\n piResultTys2\r\n f_aAT a_aAU\r\n [(->) p_a1uI[sk:1], p_a1uI[sk:1] -> p_a1uI[sk:1], Flurmp, Flurmp]\r\n [Flurmp]\r\n Call stack:\r\n CallStack (from HasCallStack):\r\n callStackDoc, called at compiler/utils/Outputable.hs:1164:37 in ghc:Outputable\r\n pprPanic, called at compiler/types/Type.hs:1041:9 in ghc:Type\r\n}}}\r\n\r\nOn GHC 8.4 and earlier, this simply gives an error message:\r\n\r\n{{{\r\n$ /opt/ghc/8.4.3/bin/ghc Bug.hs\r\n[1 of 1] Compiling Bug ( Bug.hs, Bug.o )\r\n\r\nBug.hs:18:16: error:\r\n • Expecting one more argument to ‘Pure (Flurmp :: p -> p)’\r\n Expected kind ‘p -> f p’,\r\n but ‘Pure (Flurmp :: p -> p)’ has kind ‘p -> p -> p’\r\n • In the second argument of ‘(:~:)’, namely\r\n ‘Pure (Flurmp :: p -> p) (Flurmp :: p)’\r\n In the type signature:\r\n s :: (Flurmp :: f p) :~: Pure (Flurmp :: p -> p) (Flurmp :: p)\r\n In the expression:\r\n let\r\n s :: (Flurmp :: f p) :~: Pure (Flurmp :: p -> p) (Flurmp :: p)\r\n s = undefined\r\n in ()\r\n • Relevant bindings include\r\n wat :: Proxy (f p) -> () (bound at Bug.hs:16:1)\r\n |\r\n18 | :~: Pure (Flurmp :: p -> p) (Flurmp :: p)\r\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n}}}","type_of_failure":"OtherFailure","blocking":[]} -->8.6.1https://gitlab.haskell.org/ghc/ghc/-/issues/15419GHC 8.6.1 regression (buildKindCoercion)2019-07-07T18:04:59ZRyan ScottGHC 8.6.1 regression (buildKindCoercion)The following program typechecks on GHC 8.4.1, but panics on GHC 8.6.1 and HEAD:
```hs
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE DefaultSignatures #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE RankNTypes ...The following program typechecks on GHC 8.4.1, but panics on GHC 8.6.1 and HEAD:
```hs
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE DefaultSignatures #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE TypeInType #-}
{-# LANGUAGE UndecidableInstances #-}
module Bug where
import Data.Kind
data family Sing :: forall k. k -> Type
data TyFun :: Type -> Type -> Type
type a ~> b = TyFun a b -> Type
infixr 0 ~>
type family Apply (f :: k1 ~> k2) (x :: k1) :: k2
data instance Sing :: forall a b. (a, b) -> Type where
STuple2 :: Sing x -> Sing y -> Sing '(x, y)
newtype instance Sing (f :: k1 ~> k2) =
SLambda { applySing :: forall t. Sing t -> Sing (f `Apply` t) }
-----
newtype Par1 p = Par1 p
newtype K1 c p = K1 c
data (f :*: g) p = f p :*: g p
data instance Sing :: forall p. Par1 p -> Type where
SPar1 :: Sing x -> Sing ('Par1 x)
data instance Sing :: forall k c (p :: k). K1 c p -> Type where
SK1 :: Sing x -> Sing ('K1 x)
data instance Sing :: forall k (f :: k -> Type) (g :: k -> Type) (p :: k).
(f :*: g) p -> Type where
(:%*:) :: Sing x -> Sing y -> Sing (x ':*: y)
class Generic1 (f :: k -> Type) where
type Rep1 f :: k -> Type
from1 :: f a -> Rep1 f a
to1 :: Rep1 f a -> f a
class PGeneric1 (f :: k -> Type) where
type From1 (z :: f a) :: Rep1 f a
type To1 (z :: Rep1 f a) :: f a
class SGeneric1 (f :: k -> Type) where
sFrom1 :: forall (a :: k) (z :: f a). Sing z -> Sing (From1 z)
sTo1 :: forall (a :: k) (r :: Rep1 f a). Sing r -> Sing (To1 r :: f a)
instance Generic1 ((,) a) where
type Rep1 ((,) a) = K1 a :*: Par1
from1 (x, y) = K1 x :*: Par1 y
to1 (K1 x :*: Par1 y) = (x, y)
instance PGeneric1 ((,) a) where
type From1 '(x, y) = 'K1 x ':*: 'Par1 y
type To1 ('K1 x ':*: 'Par1 y) = '(x, y)
instance SGeneric1 ((,) a) where
sFrom1 (STuple2 x y) = SK1 x :%*: SPar1 y
sTo1 (SK1 x :%*: SPar1 y) = STuple2 x y
-----
type family GenericFmap (g :: a ~> b) (x :: f a) :: f b where
GenericFmap g x = To1 (Fmap g (From1 x))
class PFunctor (f :: Type -> Type) where
type Fmap (g :: a ~> b) (x :: f a) :: f b
type Fmap g x = GenericFmap g x
class SFunctor (f :: Type -> Type) where
sFmap :: forall a b (g :: a ~> b) (x :: f a).
Sing g -> Sing x -> Sing (Fmap g x)
default sFmap :: forall a b (g :: a ~> b) (x :: f a).
( SGeneric1 f, SFunctor (Rep1 f)
, Fmap g x ~ GenericFmap g x )
=> Sing g -> Sing x -> Sing (Fmap g x)
sFmap sg sx = sTo1 (sFmap sg (sFrom1 sx))
-----
instance PFunctor Par1 where
type Fmap f ('Par1 x) = 'Par1 (f `Apply` x)
instance PFunctor (K1 c) where
type Fmap _ ('K1 x) = 'K1 x
instance PFunctor (f :*: g) where
type Fmap h (x ':*: y) = Fmap h x ':*: Fmap h y
instance SFunctor Par1 where
sFmap sf (SPar1 sx) = SPar1 (sf `applySing` sx)
instance SFunctor (K1 c) where
sFmap _ (SK1 sx) = SK1 sx
instance (SFunctor f, SFunctor g) => SFunctor (f :*: g) where
sFmap sh (sx :%*: sy) = sFmap sh sx :%*: sFmap sh sy
-----
instance PFunctor ((,) a)
-- The line below causes the panic
instance SFunctor ((,) a)
```
```
$ /opt/ghc/8.6.1/bin/ghc Bug.hs
[1 of 1] Compiling Bug ( Bug.hs, Bug.o )
ghc: panic! (the 'impossible' happened)
(GHC version 8.6.0.20180714 for x86_64-unknown-linux):
buildKindCoercion
K1 a_a1Nj :*: Par1
Rep1 ((,) a_a1Nj)
*
a_a1Nj
Call stack:
CallStack (from HasCallStack):
callStackDoc, called at compiler/utils/Outputable.hs:1164:37 in ghc:Outputable
pprPanic, called at compiler/types/Coercion.hs:2069:9 in ghc:Coercion
```
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ----------------------- |
| Version | 8.5 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | highest |
| Resolution | Unresolved |
| Component | Compiler (Type checker) |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"GHC 8.6.1 regression (buildKindCoercion)","status":"New","operating_system":"","component":"Compiler (Type checker)","related":[],"milestone":"8.6.1","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.5","keywords":["TypeInType"],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"The following program typechecks on GHC 8.4.1, but panics on GHC 8.6.1 and HEAD:\r\n\r\n{{{#!hs\r\n{-# LANGUAGE ConstraintKinds #-}\r\n{-# LANGUAGE DefaultSignatures #-}\r\n{-# LANGUAGE FlexibleContexts #-}\r\n{-# LANGUAGE GADTs #-}\r\n{-# LANGUAGE RankNTypes #-}\r\n{-# LANGUAGE TypeFamilies #-}\r\n{-# LANGUAGE TypeOperators #-}\r\n{-# LANGUAGE TypeInType #-}\r\n{-# LANGUAGE UndecidableInstances #-}\r\nmodule Bug where\r\n\r\nimport Data.Kind\r\n\r\ndata family Sing :: forall k. k -> Type\r\ndata TyFun :: Type -> Type -> Type\r\ntype a ~> b = TyFun a b -> Type\r\ninfixr 0 ~>\r\ntype family Apply (f :: k1 ~> k2) (x :: k1) :: k2\r\n\r\ndata instance Sing :: forall a b. (a, b) -> Type where\r\n STuple2 :: Sing x -> Sing y -> Sing '(x, y)\r\nnewtype instance Sing (f :: k1 ~> k2) =\r\n SLambda { applySing :: forall t. Sing t -> Sing (f `Apply` t) }\r\n\r\n-----\r\n\r\nnewtype Par1 p = Par1 p\r\nnewtype K1 c p = K1 c\r\ndata (f :*: g) p = f p :*: g p\r\n\r\ndata instance Sing :: forall p. Par1 p -> Type where\r\n SPar1 :: Sing x -> Sing ('Par1 x)\r\ndata instance Sing :: forall k c (p :: k). K1 c p -> Type where\r\n SK1 :: Sing x -> Sing ('K1 x)\r\ndata instance Sing :: forall k (f :: k -> Type) (g :: k -> Type) (p :: k).\r\n (f :*: g) p -> Type where\r\n (:%*:) :: Sing x -> Sing y -> Sing (x ':*: y)\r\n\r\nclass Generic1 (f :: k -> Type) where\r\n type Rep1 f :: k -> Type\r\n from1 :: f a -> Rep1 f a\r\n to1 :: Rep1 f a -> f a\r\n\r\nclass PGeneric1 (f :: k -> Type) where\r\n type From1 (z :: f a) :: Rep1 f a\r\n type To1 (z :: Rep1 f a) :: f a\r\n\r\nclass SGeneric1 (f :: k -> Type) where\r\n sFrom1 :: forall (a :: k) (z :: f a). Sing z -> Sing (From1 z)\r\n sTo1 :: forall (a :: k) (r :: Rep1 f a). Sing r -> Sing (To1 r :: f a)\r\n\r\ninstance Generic1 ((,) a) where\r\n type Rep1 ((,) a) = K1 a :*: Par1\r\n from1 (x, y) = K1 x :*: Par1 y\r\n to1 (K1 x :*: Par1 y) = (x, y)\r\n\r\ninstance PGeneric1 ((,) a) where\r\n type From1 '(x, y) = 'K1 x ':*: 'Par1 y\r\n type To1 ('K1 x ':*: 'Par1 y) = '(x, y)\r\n\r\ninstance SGeneric1 ((,) a) where\r\n sFrom1 (STuple2 x y) = SK1 x :%*: SPar1 y\r\n sTo1 (SK1 x :%*: SPar1 y) = STuple2 x y\r\n\r\n-----\r\n\r\ntype family GenericFmap (g :: a ~> b) (x :: f a) :: f b where\r\n GenericFmap g x = To1 (Fmap g (From1 x))\r\n\r\nclass PFunctor (f :: Type -> Type) where\r\n type Fmap (g :: a ~> b) (x :: f a) :: f b\r\n type Fmap g x = GenericFmap g x\r\n\r\nclass SFunctor (f :: Type -> Type) where\r\n sFmap :: forall a b (g :: a ~> b) (x :: f a).\r\n Sing g -> Sing x -> Sing (Fmap g x)\r\n default sFmap :: forall a b (g :: a ~> b) (x :: f a).\r\n ( SGeneric1 f, SFunctor (Rep1 f)\r\n , Fmap g x ~ GenericFmap g x )\r\n => Sing g -> Sing x -> Sing (Fmap g x)\r\n sFmap sg sx = sTo1 (sFmap sg (sFrom1 sx))\r\n\r\n-----\r\n\r\ninstance PFunctor Par1 where\r\n type Fmap f ('Par1 x) = 'Par1 (f `Apply` x)\r\ninstance PFunctor (K1 c) where\r\n type Fmap _ ('K1 x) = 'K1 x\r\ninstance PFunctor (f :*: g) where\r\n type Fmap h (x ':*: y) = Fmap h x ':*: Fmap h y\r\n\r\ninstance SFunctor Par1 where\r\n sFmap sf (SPar1 sx) = SPar1 (sf `applySing` sx)\r\ninstance SFunctor (K1 c) where\r\n sFmap _ (SK1 sx) = SK1 sx\r\ninstance (SFunctor f, SFunctor g) => SFunctor (f :*: g) where\r\n sFmap sh (sx :%*: sy) = sFmap sh sx :%*: sFmap sh sy\r\n\r\n-----\r\n\r\ninstance PFunctor ((,) a)\r\n-- The line below causes the panic\r\ninstance SFunctor ((,) a)\r\n}}}\r\n{{{\r\n$ /opt/ghc/8.6.1/bin/ghc Bug.hs\r\n[1 of 1] Compiling Bug ( Bug.hs, Bug.o )\r\nghc: panic! (the 'impossible' happened)\r\n (GHC version 8.6.0.20180714 for x86_64-unknown-linux):\r\n buildKindCoercion\r\n K1 a_a1Nj :*: Par1\r\n Rep1 ((,) a_a1Nj)\r\n *\r\n a_a1Nj\r\n Call stack:\r\n CallStack (from HasCallStack):\r\n callStackDoc, called at compiler/utils/Outputable.hs:1164:37 in ghc:Outputable\r\n pprPanic, called at compiler/types/Coercion.hs:2069:9 in ghc:Coercion\r\n}}}","type_of_failure":"OtherFailure","blocking":[]} -->8.6.1Richard Eisenbergrae@richarde.devRichard Eisenbergrae@richarde.devhttps://gitlab.haskell.org/ghc/ghc/-/issues/15396-staticlib is broken on GHC 8.4.3 on Linux under certain conditions2019-07-07T18:05:17ZRyan Scott-staticlib is broken on GHC 8.4.3 on Linux under certain conditionsWhen compiling this simple program:
```hs
main = pure ()
```
Using the `-staticlib` flag on GHC 8.4.3 on Linux, it panics if using a certain toolchain:
```
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Descript...When compiling this simple program:
```hs
main = pure ()
```
Using the `-staticlib` flag on GHC 8.4.3 on Linux, it panics if using a certain toolchain:
```
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 14.04.5 LTS
Release: 14.04
Codename: trusty
$ /opt/ghc/8.4.3/bin/ghc -fforce-recomp -staticlib Bug.hs
[1 of 1] Compiling Main ( Bug.hs, Bug.o )
Linking Bug.a ...
ghc: panic! (the 'impossible' happened)
(GHC version 8.4.3 for x86_64-unknown-linux):
Data.Binary.Get.runGet at position 27462987: Invalid archive header end marker
CallStack (from HasCallStack):
error, called at libraries/binary/src/Data/Binary/Get.hs:351:5 in binary-0.8.5.1:Data.Binary.Get
```
I say "certain toolchain" since I am able to reproduce this issue on Ubuntu 14.04, but not 18.04:
```
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04 LTS
Release: 18.04
Codename: bionic
$ /opt/ghc/8.4.3/bin/ghc -fforce-recomp -staticlib Bug.hs
[1 of 1] Compiling Main ( Bug.hs, Bug.o )
Linking Bug.a ...
```
This issue does not occur on GHC 8.2 and earlier:
```
$ /opt/ghc/8.2.2/bin/ghc -staticlib Bug.hs
[1 of 1] Compiling Main ( Bug.hs, Bug.o )
Linking Bug.a ...
Static archive creation only supported on Darwin/OS X/iOS
```
Commit b8f33bc6b738b0378976e42b79369f0e53b680c7 allowed the use of `-staticlib` on all platforms. angerman, do you know what might be happening here?8.6.1https://gitlab.haskell.org/ghc/ghc/-/issues/15370Typed hole panic on GHC 8.6 (tcTyVarDetails)2019-07-07T18:12:57ZRyan ScottTyped hole panic on GHC 8.6 (tcTyVarDetails)The following program panics on GHC 8.6 and HEAD:
```hs
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeInType #-}
{-# LANGUAGE TypeOperat...The following program panics on GHC 8.6 and HEAD:
```hs
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeInType #-}
{-# LANGUAGE TypeOperators #-}
module Bug where
import Data.Kind
import Data.Type.Equality
import Data.Void
data family Sing :: forall k. k -> Type
data (~>) :: Type -> Type -> Type
infixr 0 ~>
type family Apply (f :: k1 ~> k2) (x :: k1) :: k2
newtype instance Sing (f :: k1 ~> k2) =
SLambda { applySing :: forall t. Sing t -> Sing (Apply f t) }
mkRefl :: n :~: j
mkRefl = Refl
right :: forall (r :: (x :~: y) ~> z).
Sing r -> ()
right no =
case mkRefl @x @y of
Refl -> applySing no _
```
```
$ /opt/ghc/8.6.1/bin/ghc Bug.hs
[1 of 1] Compiling Bug ( Bug.hs, Bug.o )
ghc: panic! (the 'impossible' happened)
(GHC version 8.6.0.20180627 for x86_64-unknown-linux):
tcTyVarDetails
co_a1BG :: y_a1Bz[sk:1] ~# x_a1By[sk:1]
Call stack:
CallStack (from HasCallStack):
callStackDoc, called at compiler/utils/Outputable.hs:1164:37 in ghc:Outputable
pprPanic, called at compiler/basicTypes/Var.hs:497:22 in ghc:Var
```
On GHC 8.4, this simply errors:
```
$ /opt/ghc/8.4.3/bin/ghc Bug.hs
[1 of 1] Compiling Bug ( Bug.hs, Bug.o )
Bug.hs:23:10: error:
• Couldn't match type ‘n’ with ‘j’
‘n’ is a rigid type variable bound by
the type signature for:
mkRefl :: forall k1 (n :: k1) (j :: k1). n :~: j
at Bug.hs:22:1-17
‘j’ is a rigid type variable bound by
the type signature for:
mkRefl :: forall k1 (n :: k1) (j :: k1). n :~: j
at Bug.hs:22:1-17
Expected type: n :~: j
Actual type: n :~: n
• In the expression: Refl
In an equation for ‘mkRefl’: mkRefl = Refl
• Relevant bindings include
mkRefl :: n :~: j (bound at Bug.hs:23:1)
|
23 | mkRefl = Refl
| ^^^^
Bug.hs:29:13: error:
• Couldn't match type ‘Sing (Apply r t0)’ with ‘()’
Expected type: ()
Actual type: Sing (Apply r t0)
• In the expression: applySing no _
In a case alternative: Refl -> applySing no _
In the expression: case mkRefl @x @y of { Refl -> applySing no _ }
• Relevant bindings include
no :: Sing r (bound at Bug.hs:27:7)
right :: Sing r -> () (bound at Bug.hs:27:1)
|
29 | Refl -> applySing no _
| ^^^^^^^^^^^^^^
Bug.hs:29:26: error:
• Found hole: _ :: Sing t0
Where: ‘t0’ is an ambiguous type variable
‘y’, ‘x’, ‘k’ are rigid type variables bound by
the type signature for:
right :: forall k1 (x1 :: k1) (y1 :: k1) z (r :: (x1 :~: y1) ~> z).
Sing r -> ()
at Bug.hs:(25,1)-(26,21)
• In the second argument of ‘applySing’, namely ‘_’
In the expression: applySing no _
In a case alternative: Refl -> applySing no _
• Relevant bindings include
no :: Sing r (bound at Bug.hs:27:7)
right :: Sing r -> () (bound at Bug.hs:27:1)
Valid substitutions include
undefined :: forall (a :: TYPE r).
GHC.Stack.Types.HasCallStack =>
a
(imported from ‘Prelude’ at Bug.hs:7:8-10
(and originally defined in ‘GHC.Err’))
|
29 | Refl -> applySing no _
| ^
```
Note that this is distinct from #15142, as this is still reproducible on HEAD, even after commit 030211d21207dabb7a4bf21cc9af6fa5eb066db1.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ----------------------- |
| Version | 8.4.3 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | high |
| Resolution | Unresolved |
| Component | Compiler (Type checker) |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"Typed hole panic on GHC 8.6 (tcTyVarDetails)","status":"New","operating_system":"","component":"Compiler (Type checker)","related":[],"milestone":"8.6.1","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.4.3","keywords":["TypeInType,","TypedHoles"],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"The following program panics on GHC 8.6 and HEAD:\r\n\r\n{{{#!hs\r\n{-# LANGUAGE RankNTypes #-}\r\n{-# LANGUAGE ScopedTypeVariables #-}\r\n{-# LANGUAGE TypeApplications #-}\r\n{-# LANGUAGE TypeFamilies #-}\r\n{-# LANGUAGE TypeInType #-}\r\n{-# LANGUAGE TypeOperators #-}\r\nmodule Bug where\r\n\r\nimport Data.Kind\r\nimport Data.Type.Equality\r\nimport Data.Void\r\n\r\ndata family Sing :: forall k. k -> Type\r\n\r\ndata (~>) :: Type -> Type -> Type\r\ninfixr 0 ~>\r\ntype family Apply (f :: k1 ~> k2) (x :: k1) :: k2\r\n\r\nnewtype instance Sing (f :: k1 ~> k2) =\r\n SLambda { applySing :: forall t. Sing t -> Sing (Apply f t) }\r\n\r\nmkRefl :: n :~: j\r\nmkRefl = Refl\r\n\r\nright :: forall (r :: (x :~: y) ~> z).\r\n Sing r -> ()\r\nright no =\r\n case mkRefl @x @y of\r\n Refl -> applySing no _\r\n}}}\r\n{{{\r\n$ /opt/ghc/8.6.1/bin/ghc Bug.hs\r\n[1 of 1] Compiling Bug ( Bug.hs, Bug.o )\r\nghc: panic! (the 'impossible' happened)\r\n (GHC version 8.6.0.20180627 for x86_64-unknown-linux):\r\n tcTyVarDetails\r\n co_a1BG :: y_a1Bz[sk:1] ~# x_a1By[sk:1]\r\n Call stack:\r\n CallStack (from HasCallStack):\r\n callStackDoc, called at compiler/utils/Outputable.hs:1164:37 in ghc:Outputable\r\n pprPanic, called at compiler/basicTypes/Var.hs:497:22 in ghc:Var\r\n}}}\r\n\r\nOn GHC 8.4, this simply errors:\r\n\r\n{{{\r\n$ /opt/ghc/8.4.3/bin/ghc Bug.hs \r\n[1 of 1] Compiling Bug ( Bug.hs, Bug.o )\r\n\r\nBug.hs:23:10: error:\r\n • Couldn't match type ‘n’ with ‘j’\r\n ‘n’ is a rigid type variable bound by\r\n the type signature for:\r\n mkRefl :: forall k1 (n :: k1) (j :: k1). n :~: j\r\n at Bug.hs:22:1-17\r\n ‘j’ is a rigid type variable bound by\r\n the type signature for:\r\n mkRefl :: forall k1 (n :: k1) (j :: k1). n :~: j\r\n at Bug.hs:22:1-17\r\n Expected type: n :~: j\r\n Actual type: n :~: n\r\n • In the expression: Refl\r\n In an equation for ‘mkRefl’: mkRefl = Refl\r\n • Relevant bindings include\r\n mkRefl :: n :~: j (bound at Bug.hs:23:1)\r\n |\r\n23 | mkRefl = Refl\r\n | ^^^^\r\n\r\nBug.hs:29:13: error:\r\n • Couldn't match type ‘Sing (Apply r t0)’ with ‘()’\r\n Expected type: ()\r\n Actual type: Sing (Apply r t0)\r\n • In the expression: applySing no _\r\n In a case alternative: Refl -> applySing no _\r\n In the expression: case mkRefl @x @y of { Refl -> applySing no _ }\r\n • Relevant bindings include\r\n no :: Sing r (bound at Bug.hs:27:7)\r\n right :: Sing r -> () (bound at Bug.hs:27:1)\r\n |\r\n29 | Refl -> applySing no _\r\n | ^^^^^^^^^^^^^^\r\n\r\nBug.hs:29:26: error:\r\n • Found hole: _ :: Sing t0\r\n Where: ‘t0’ is an ambiguous type variable\r\n ‘y’, ‘x’, ‘k’ are rigid type variables bound by\r\n the type signature for:\r\n right :: forall k1 (x1 :: k1) (y1 :: k1) z (r :: (x1 :~: y1) ~> z).\r\n Sing r -> ()\r\n at Bug.hs:(25,1)-(26,21)\r\n • In the second argument of ‘applySing’, namely ‘_’\r\n In the expression: applySing no _\r\n In a case alternative: Refl -> applySing no _\r\n • Relevant bindings include\r\n no :: Sing r (bound at Bug.hs:27:7)\r\n right :: Sing r -> () (bound at Bug.hs:27:1)\r\n Valid substitutions include\r\n undefined :: forall (a :: TYPE r).\r\n GHC.Stack.Types.HasCallStack =>\r\n a\r\n (imported from ‘Prelude’ at Bug.hs:7:8-10\r\n (and originally defined in ‘GHC.Err’))\r\n |\r\n29 | Refl -> applySing no _\r\n | ^\r\n}}}\r\n\r\nNote that this is distinct from #15142, as this is still reproducible on HEAD, even after commit 030211d21207dabb7a4bf21cc9af6fa5eb066db1.","type_of_failure":"OtherFailure","blocking":[]} -->8.6.1Matthías Páll GissurarsonMatthías Páll Gissurarsonhttps://gitlab.haskell.org/ghc/ghc/-/issues/15346Core Lint error in GHC 8.6.1: From-type of Cast differs from type of enclosed...2019-07-07T18:13:04ZRyan ScottCore Lint error in GHC 8.6.1: From-type of Cast differs from type of enclosed expressionThe following program typechecks on GHC 8.6.1-alpha1:
```hs
{-# LANGUAGE AllowAmbiguousTypes #-}
{-# LANGUAGE DefaultSignatures #-}
{-# LANGUAGE EmptyCase #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE ScopedT...The following program typechecks on GHC 8.6.1-alpha1:
```hs
{-# LANGUAGE AllowAmbiguousTypes #-}
{-# LANGUAGE DefaultSignatures #-}
{-# LANGUAGE EmptyCase #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeInType #-}
{-# LANGUAGE TypeOperators #-}
module SGenerics where
import Data.Kind
import Data.Type.Equality
import Data.Void
-----
-- singletons machinery
-----
data family Sing :: forall k. k -> Type
data instance Sing :: () -> Type where
STuple0 :: Sing '()
type Refuted a = a -> Void
data Decision a = Proved a | Disproved (Refuted a)
-----
-- A stripped down version of GHC.Generics
-----
data U1 = MkU1
data instance Sing (z :: U1) where
SMkU1 :: Sing MkU1
-----
class Generic (a :: Type) where
type Rep a :: Type
from :: a -> Rep a
to :: Rep a -> a
class PGeneric (a :: Type) where
type PFrom (x :: a) :: Rep a
type PTo (x :: Rep a) :: a
class SGeneric k where
sFrom :: forall (a :: k). Sing a -> Sing (PFrom a)
sTo :: forall (a :: Rep k). Sing a -> Sing (PTo a :: k)
sTof :: forall (a :: k). Sing a -> PTo (PFrom a) :~: a
sFot :: forall (a :: Rep k). Sing a -> PFrom (PTo a :: k) :~: a
-----
instance Generic () where
type Rep () = U1
from () = MkU1
to MkU1 = ()
instance PGeneric () where
type PFrom '() = MkU1
type PTo 'MkU1 = '()
instance SGeneric () where
sFrom STuple0 = SMkU1
sTo SMkU1 = STuple0
sTof STuple0 = Refl
sFot SMkU1 = Refl
-----
class SDecide k where
-- | Compute a proof or disproof of equality, given two singletons.
(%~) :: forall (a :: k) (b :: k). Sing a -> Sing b -> Decision (a :~: b)
default (%~) :: forall (a :: k) (b :: k). (SGeneric k, SDecide (Rep k))
=> Sing a -> Sing b -> Decision (a :~: b)
s1 %~ s2 = case sFrom s1 %~ sFrom s2 of
Proved (Refl :: PFrom a :~: PFrom b) ->
let r :: PTo (PFrom a) :~: PTo (PFrom b)
r = Refl
sTof1 :: PTo (PFrom a) :~: a
sTof1 = sTof s1
sTof2 :: PTo (PFrom b) :~: b
sTof2 = sTof s2
in Proved (sym sTof1 `trans` r `trans` sTof2)
Disproved contra -> Disproved (\Refl -> contra Refl)
instance SDecide U1 where
SMkU1 %~ SMkU1 = Proved Refl
instance SDecide ()
```
However, it throws a Core Lint error with `-dcore-lint`. The full error is absolutely massive, so I'll attach it separately. Here is the top-level bit:
```
*** Core Lint errors : in result of Simplifier ***
<no location info>: warning:
In the expression: <elided>
From-type of Cast differs from type of enclosed expression
From-type: U1
Type of enclosed expr: Rep ()
Actual enclosed expr: PFrom a_a1Fm
Coercion used in cast: Sym (D:R:Rep()[0])
```
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ----------------------- |
| Version | 8.5 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler (Type checker) |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"Core Lint error in GHC 8.6.1: From-type of Cast differs from type of enclosed expression","status":"New","operating_system":"","component":"Compiler (Type checker)","related":[],"milestone":"8.6.1","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.5","keywords":["TypeInType"],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"The following program typechecks on GHC 8.6.1-alpha1:\r\n\r\n{{{#!hs\r\n{-# LANGUAGE AllowAmbiguousTypes #-}\r\n{-# LANGUAGE DefaultSignatures #-}\r\n{-# LANGUAGE EmptyCase #-}\r\n{-# LANGUAGE FlexibleContexts #-}\r\n{-# LANGUAGE GADTs #-}\r\n{-# LANGUAGE ScopedTypeVariables #-}\r\n{-# LANGUAGE TypeFamilies #-}\r\n{-# LANGUAGE TypeInType #-}\r\n{-# LANGUAGE TypeOperators #-}\r\nmodule SGenerics where\r\n\r\nimport Data.Kind\r\nimport Data.Type.Equality\r\nimport Data.Void\r\n\r\n-----\r\n-- singletons machinery\r\n-----\r\n\r\ndata family Sing :: forall k. k -> Type\r\n\r\ndata instance Sing :: () -> Type where\r\n STuple0 :: Sing '()\r\n\r\ntype Refuted a = a -> Void\r\ndata Decision a = Proved a | Disproved (Refuted a)\r\n\r\n-----\r\n-- A stripped down version of GHC.Generics\r\n-----\r\n\r\ndata U1 = MkU1\r\ndata instance Sing (z :: U1) where\r\n SMkU1 :: Sing MkU1\r\n\r\n-----\r\n\r\nclass Generic (a :: Type) where\r\n type Rep a :: Type\r\n from :: a -> Rep a\r\n to :: Rep a -> a\r\n\r\nclass PGeneric (a :: Type) where\r\n type PFrom (x :: a) :: Rep a\r\n type PTo (x :: Rep a) :: a\r\n\r\nclass SGeneric k where\r\n sFrom :: forall (a :: k). Sing a -> Sing (PFrom a)\r\n sTo :: forall (a :: Rep k). Sing a -> Sing (PTo a :: k)\r\n sTof :: forall (a :: k). Sing a -> PTo (PFrom a) :~: a\r\n sFot :: forall (a :: Rep k). Sing a -> PFrom (PTo a :: k) :~: a\r\n\r\n-----\r\n\r\ninstance Generic () where\r\n type Rep () = U1\r\n from () = MkU1\r\n to MkU1 = ()\r\n\r\ninstance PGeneric () where\r\n type PFrom '() = MkU1\r\n type PTo 'MkU1 = '()\r\n\r\ninstance SGeneric () where\r\n sFrom STuple0 = SMkU1\r\n sTo SMkU1 = STuple0\r\n sTof STuple0 = Refl\r\n sFot SMkU1 = Refl\r\n\r\n-----\r\n\r\nclass SDecide k where\r\n -- | Compute a proof or disproof of equality, given two singletons.\r\n (%~) :: forall (a :: k) (b :: k). Sing a -> Sing b -> Decision (a :~: b)\r\n default (%~) :: forall (a :: k) (b :: k). (SGeneric k, SDecide (Rep k))\r\n => Sing a -> Sing b -> Decision (a :~: b)\r\n s1 %~ s2 = case sFrom s1 %~ sFrom s2 of\r\n Proved (Refl :: PFrom a :~: PFrom b) ->\r\n let r :: PTo (PFrom a) :~: PTo (PFrom b)\r\n r = Refl\r\n\r\n sTof1 :: PTo (PFrom a) :~: a\r\n sTof1 = sTof s1\r\n\r\n sTof2 :: PTo (PFrom b) :~: b\r\n sTof2 = sTof s2\r\n in Proved (sym sTof1 `trans` r `trans` sTof2)\r\n Disproved contra -> Disproved (\\Refl -> contra Refl)\r\n\r\ninstance SDecide U1 where\r\n SMkU1 %~ SMkU1 = Proved Refl\r\n\r\ninstance SDecide ()\r\n}}}\r\n\r\nHowever, it throws a Core Lint error with `-dcore-lint`. The full error is absolutely massive, so I'll attach it separately. Here is the top-level bit:\r\n\r\n{{{\r\n*** Core Lint errors : in result of Simplifier ***\r\n<no location info>: warning:\r\n In the expression: <elided>\r\n From-type of Cast differs from type of enclosed expression\r\n From-type: U1\r\n Type of enclosed expr: Rep ()\r\n Actual enclosed expr: PFrom a_a1Fm\r\n Coercion used in cast: Sym (D:R:Rep()[0])\r\n}}}","type_of_failure":"OtherFailure","blocking":[]} -->8.6.1https://gitlab.haskell.org/ghc/ghc/-/issues/15343Implicitly quantifying a kind variable causes GHC 8.6 to panic (coercionKind)2019-07-07T18:13:05ZRyan ScottImplicitly quantifying a kind variable causes GHC 8.6 to panic (coercionKind)The following program panics on GHC 8.6 and later:
```hs
{-# LANGUAGE AllowAmbiguousTypes #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE TypeFam...The following program panics on GHC 8.6 and later:
```hs
{-# LANGUAGE AllowAmbiguousTypes #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeInType #-}
{-# LANGUAGE TypeOperators #-}
module Bug where
import Data.Kind
import Data.Type.Equality
data family Sing :: forall k. k -> Type
data SomeSing :: Type -> Type where
SomeSing :: Sing (a :: k) -> SomeSing k
class SingKind k where
type Demote k :: Type
fromSing :: Sing (a :: k) -> Demote k
toSing :: Demote k -> SomeSing k
data instance Sing (z :: a :~~: b) where
SHRefl :: Sing HRefl
instance SingKind (a :~~: b) where
type Demote (a :~~: b) = a :~~: b
fromSing SHRefl = HRefl
toSing HRefl = SomeSing SHRefl
data TyFun :: Type -> Type -> Type
type a ~> b = TyFun a b -> Type
infixr 0 ~>
type family Apply (f :: k1 ~> k2) (x :: k1) :: k2
(~>:~~:) :: forall (j :: Type) (k :: Type) (a :: j) (b :: k)
(p :: forall (z :: Type) (y :: z). (a :~~: y) ~> Type)
(r :: a :~~: b).
Sing r
-> Apply p HRefl
-> Apply p r
(~>:~~:) SHRefl pHRefl = pHRefl
type family Why (a :: j) (e :: a :~~: (y :: z)) :: Type where
Why a (_ :: a :~~: y) = y :~~: a
data WhySym (a :: j) :: forall (y :: z). (a :~~: y) ~> Type
-- data WhySym (a :: j) :: forall z (y :: z). (a :~~: y) ~> Type
-- The version above does NOT panic
type instance Apply (WhySym a) e = Why a e
hsym :: forall (j :: Type) (k :: Type) (a :: j) (b :: k).
a :~~: b -> b :~~: a
hsym eq = case toSing eq of
SomeSing (singEq :: Sing r) ->
(~>:~~:) @j @k @a @b @(WhySym a) @r singEq HRefl
```
```
$ /opt/ghc/8.6.1/bin/ghc Bug.hs
[1 of 1] Compiling Bug ( Bug.hs, Bug.o )
ghc: panic! (the 'impossible' happened)
(GHC version 8.6.0.20180627 for x86_64-unknown-linux):
coercionKind
Nth:3
(Inst {co_a1jI} (Coh <k_a1js[sk:1]>_N (Nth:0 (Sym {co_a1jI}))))
Call stack:
CallStack (from HasCallStack):
callStackDoc, called at compiler/utils/Outputable.hs:1164:37 in ghc:Outputable
pprPanic, called at compiler/types/Coercion.hs:1887:9 in ghc:Coercion
```
As noted in the comments, replacing `WhySym` with a version that explicitly quantifies `z` avoids the panic.
This is a regression from GHC 8.4.3, in which the program simply errored:
```
$ /opt/ghc/8.4.3/bin/ghc Bug.hs
[1 of 1] Compiling Bug ( Bug.hs, Bug.o )
Bug.hs:56:38: error:
• Expected kind ‘forall z (y :: z). (a1 :~~: y) ~> *’,
but ‘WhySym a’ has kind ‘forall (y :: z0).
TyFun (a1 :~~: y) * -> *’
• In the type ‘(WhySym a)’
In the expression: (~>:~~:) @j @k @a @b @(WhySym a) @r singEq HRefl
In a case alternative:
SomeSing (singEq :: Sing r)
-> (~>:~~:) @j @k @a @b @(WhySym a) @r singEq HRefl
• Relevant bindings include
singEq :: Sing a2 (bound at Bug.hs:55:23)
eq :: a1 :~~: b (bound at Bug.hs:54:6)
hsym :: (a1 :~~: b) -> b :~~: a1 (bound at Bug.hs:54:1)
|
56 | (~>:~~:) @j @k @a @b @(WhySym a) @r singEq HRefl
| ^^^^^^^^
```
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ----------------------- |
| Version | 8.5 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | high |
| Resolution | Unresolved |
| Component | Compiler (Type checker) |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"Implicitly quantifying a kind variable causes GHC 8.6 to panic (coercionKind)","status":"New","operating_system":"","component":"Compiler (Type checker)","related":[],"milestone":"8.6.1","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.5","keywords":["TypeInType"],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"The following program panics on GHC 8.6 and later:\r\n\r\n{{{#!hs\r\n{-# LANGUAGE AllowAmbiguousTypes #-}\r\n{-# LANGUAGE GADTs #-}\r\n{-# LANGUAGE RankNTypes #-}\r\n{-# LANGUAGE ScopedTypeVariables #-}\r\n{-# LANGUAGE TypeApplications #-}\r\n{-# LANGUAGE TypeFamilies #-}\r\n{-# LANGUAGE TypeInType #-}\r\n{-# LANGUAGE TypeOperators #-}\r\nmodule Bug where\r\n\r\nimport Data.Kind\r\nimport Data.Type.Equality\r\n\r\ndata family Sing :: forall k. k -> Type\r\ndata SomeSing :: Type -> Type where\r\n SomeSing :: Sing (a :: k) -> SomeSing k\r\n\r\nclass SingKind k where\r\n type Demote k :: Type\r\n fromSing :: Sing (a :: k) -> Demote k\r\n toSing :: Demote k -> SomeSing k\r\n\r\ndata instance Sing (z :: a :~~: b) where\r\n SHRefl :: Sing HRefl\r\n\r\ninstance SingKind (a :~~: b) where\r\n type Demote (a :~~: b) = a :~~: b\r\n fromSing SHRefl = HRefl\r\n toSing HRefl = SomeSing SHRefl\r\n\r\ndata TyFun :: Type -> Type -> Type\r\ntype a ~> b = TyFun a b -> Type\r\ninfixr 0 ~>\r\ntype family Apply (f :: k1 ~> k2) (x :: k1) :: k2\r\n\r\n(~>:~~:) :: forall (j :: Type) (k :: Type) (a :: j) (b :: k)\r\n (p :: forall (z :: Type) (y :: z). (a :~~: y) ~> Type)\r\n (r :: a :~~: b).\r\n Sing r\r\n -> Apply p HRefl\r\n -> Apply p r\r\n(~>:~~:) SHRefl pHRefl = pHRefl\r\n\r\ntype family Why (a :: j) (e :: a :~~: (y :: z)) :: Type where\r\n Why a (_ :: a :~~: y) = y :~~: a\r\n\r\ndata WhySym (a :: j) :: forall (y :: z). (a :~~: y) ~> Type\r\n-- data WhySym (a :: j) :: forall z (y :: z). (a :~~: y) ~> Type\r\n-- The version above does NOT panic\r\ntype instance Apply (WhySym a) e = Why a e\r\n\r\nhsym :: forall (j :: Type) (k :: Type) (a :: j) (b :: k).\r\n a :~~: b -> b :~~: a\r\nhsym eq = case toSing eq of\r\n SomeSing (singEq :: Sing r) ->\r\n (~>:~~:) @j @k @a @b @(WhySym a) @r singEq HRefl\r\n}}}\r\n\r\n{{{\r\n$ /opt/ghc/8.6.1/bin/ghc Bug.hs\r\n[1 of 1] Compiling Bug ( Bug.hs, Bug.o )\r\nghc: panic! (the 'impossible' happened)\r\n (GHC version 8.6.0.20180627 for x86_64-unknown-linux):\r\n coercionKind\r\n Nth:3\r\n (Inst {co_a1jI} (Coh <k_a1js[sk:1]>_N (Nth:0 (Sym {co_a1jI}))))\r\n Call stack:\r\n CallStack (from HasCallStack):\r\n callStackDoc, called at compiler/utils/Outputable.hs:1164:37 in ghc:Outputable\r\n pprPanic, called at compiler/types/Coercion.hs:1887:9 in ghc:Coercion\r\n}}}\r\n\r\nAs noted in the comments, replacing `WhySym` with a version that explicitly quantifies `z` avoids the panic.\r\n\r\nThis is a regression from GHC 8.4.3, in which the program simply errored:\r\n\r\n{{{\r\n$ /opt/ghc/8.4.3/bin/ghc Bug.hs\r\n[1 of 1] Compiling Bug ( Bug.hs, Bug.o )\r\n\r\nBug.hs:56:38: error:\r\n • Expected kind ‘forall z (y :: z). (a1 :~~: y) ~> *’,\r\n but ‘WhySym a’ has kind ‘forall (y :: z0).\r\n TyFun (a1 :~~: y) * -> *’\r\n • In the type ‘(WhySym a)’\r\n In the expression: (~>:~~:) @j @k @a @b @(WhySym a) @r singEq HRefl\r\n In a case alternative:\r\n SomeSing (singEq :: Sing r)\r\n -> (~>:~~:) @j @k @a @b @(WhySym a) @r singEq HRefl\r\n • Relevant bindings include\r\n singEq :: Sing a2 (bound at Bug.hs:55:23)\r\n eq :: a1 :~~: b (bound at Bug.hs:54:6)\r\n hsym :: (a1 :~~: b) -> b :~~: a1 (bound at Bug.hs:54:1)\r\n |\r\n56 | (~>:~~:) @j @k @a @b @(WhySym a) @r singEq HRefl\r\n | ^^^^^^^^\r\n}}}","type_of_failure":"OtherFailure","blocking":[]} -->8.6.1https://gitlab.haskell.org/ghc/ghc/-/issues/15318Core Lint error involving newtype family instances with wrappers2019-07-07T18:13:18ZRyan ScottCore Lint error involving newtype family instances with wrappersThe following program gives a Core Lint error on GHC 8.4 and later:
```hs
{-# LANGUAGE GADTs #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeFamilies #-}
module Bug where
data family Sn a
newtype instance Sn (Either a b) wher...The following program gives a Core Lint error on GHC 8.4 and later:
```hs
{-# LANGUAGE GADTs #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeFamilies #-}
module Bug where
data family Sn a
newtype instance Sn (Either a b) where
SnC :: forall b a. Char -> Sn (Either a b)
```
```
$ /opt/ghc/8.4.3/bin/ghc -dcore-lint Bug.hs
[1 of 1] Compiling Bug ( Bug.hs, Bug.o )
*** Core Lint errors : in result of Tidy Core ***
<no location info>: warning:
[in body of lambda with binder dt_aZm :: Char]
From-type of Cast differs from type of enclosed expression
From-type: R:SnEither a_auS b_auR
Type of enclosed expr: Sn (Either a_auS b_auR)
Actual enclosed expr: dt_aZm
`cast` (Sym (N:R:SnEither[0]
<a_auS>_N <b_auR>_N) ; Sym (D:R:SnEither0[0]
<a_auS>_N <b_auR>_N)
:: (Char :: *) ~R# (Sn (Either a_auS b_auR) :: *))
Coercion used in cast: Sym (D:R:SnEither0[0] <a_auS>_N <b_auR>_N)
*** Offending Program ***
$WSnC [InlPrag=INLINE[2]] :: forall b a. Char -> Sn (Either a b)
[GblId[DataConWrapper],
Arity=1,
Caf=NoCafRefs,
Str=<L,U>,
Unf=Unf{Src=InlineStable, TopLvl=True, Value=True, ConLike=True,
WorkFree=True, Expandable=True,
Guidance=ALWAYS_IF(arity=1,unsat_ok=True,boring_ok=True)
Tmpl= \ (@ b_auR) (@ a_auS) (dt_aZm [Occ=Once] :: Char) ->
(dt_aZm
`cast` (Sym (N:R:SnEither[0]
<a_auS>_N <b_auR>_N) ; Sym (D:R:SnEither0[0] <a_auS>_N <b_auR>_N)
:: (Char :: *) ~R# (Sn (Either a_auS b_auR) :: *)))
`cast` (Sym (D:R:SnEither0[0] <a_auS>_N <b_auR>_N)
:: (R:SnEither a_auS b_auR :: *)
~R# (Sn (Either a_auS b_auR) :: *))}]
$WSnC
= \ (@ b_auR) (@ a_auS) (dt_aZm [Occ=Once] :: Char) ->
(dt_aZm
`cast` (Sym (N:R:SnEither[0]
<a_auS>_N <b_auR>_N) ; Sym (D:R:SnEither0[0] <a_auS>_N <b_auR>_N)
:: (Char :: *) ~R# (Sn (Either a_auS b_auR) :: *)))
`cast` (Sym (D:R:SnEither0[0] <a_auS>_N <b_auR>_N)
:: (R:SnEither a_auS b_auR :: *)
~R# (Sn (Either a_auS b_auR) :: *))
$trModule1_r10g :: Addr#
[GblId, Caf=NoCafRefs]
$trModule1_r10g = "main"#
$trModule2_r10D :: TrName
[GblId, Caf=NoCafRefs]
$trModule2_r10D = TrNameS $trModule1_r10g
$trModule3_r10E :: Addr#
[GblId, Caf=NoCafRefs]
$trModule3_r10E = "Bug"#
$trModule4_r10F :: TrName
[GblId, Caf=NoCafRefs]
$trModule4_r10F = TrNameS $trModule3_r10E
$trModule :: Module
[GblId, Caf=NoCafRefs]
$trModule = Module $trModule2_r10D $trModule4_r10F
$krep_r10G :: KindRep
[GblId]
$krep_r10G = KindRepTyConApp $tcChar ([] @ KindRep)
$krep1_r10H :: KindRep
[GblId, Caf=NoCafRefs]
$krep1_r10H = KindRepVar 1#
$krep2_r10I :: KindRep
[GblId, Caf=NoCafRefs]
$krep2_r10I = KindRepVar 0#
$krep3_r10J :: [KindRep]
[GblId, Caf=NoCafRefs]
$krep3_r10J = : @ KindRep $krep2_r10I ([] @ KindRep)
$krep4_r10K :: [KindRep]
[GblId, Caf=NoCafRefs]
$krep4_r10K = : @ KindRep $krep1_r10H $krep3_r10J
$krep5_r10L :: KindRep
[GblId]
$krep5_r10L = KindRepTyConApp $tcEither $krep4_r10K
$tcSn1_r10M :: Addr#
[GblId, Caf=NoCafRefs]
$tcSn1_r10M = "Sn"#
$tcSn2_r10N :: TrName
[GblId, Caf=NoCafRefs]
$tcSn2_r10N = TrNameS $tcSn1_r10M
$tcSn :: TyCon
[GblId]
$tcSn
= TyCon
461968091845555535##
16320521938866097056##
$trModule
$tcSn2_r10N
0#
krep$*Arr*
$krep6_r10O :: [KindRep]
[GblId]
$krep6_r10O = : @ KindRep $krep5_r10L ([] @ KindRep)
$krep7_r10P :: KindRep
[GblId]
$krep7_r10P = KindRepTyConApp $tcSn $krep6_r10O
$krep8_r10Q :: KindRep
[GblId]
$krep8_r10Q = KindRepFun $krep_r10G $krep7_r10P
$tc'SnC1_r10R :: Addr#
[GblId, Caf=NoCafRefs]
$tc'SnC1_r10R = "'SnC"#
$tc'SnC2_r10S :: TrName
[GblId, Caf=NoCafRefs]
$tc'SnC2_r10S = TrNameS $tc'SnC1_r10R
$tc'SnC :: TyCon
[GblId]
$tc'SnC
= TyCon
3818830880305712792##
17484539998814842835##
$trModule
$tc'SnC2_r10S
2#
$krep8_r10Q
*** End of Offense ***
<no location info>: error:
Compilation had errors
```
If we look at the Core for `$WSnC`, we see the culprit:
```
$WSnC
= \ (@ b_auR) (@ a_auS) (dt_aZm [Occ=Once] :: Char) ->
(dt_aZm
`cast` (Sym (N:R:SnEither[0]
<a_auS>_N <b_auR>_N) ; Sym (D:R:SnEither0[0] <a_auS>_N <b_auR>_N)
:: (Char :: *) ~R# (Sn (Either a_auS b_auR) :: *)))
`cast` (Sym (D:R:SnEither0[0] <a_auS>_N <b_auR>_N)
:: (R:SnEither a_auS b_auR :: *)
~R# (Sn (Either a_auS b_auR) :: *))
```
The inner cast goes from `Char` to `Sn (Either a b)`, but then the outer cast goes from `R:SnEither a b` to `Sn (Either a b)`, which is not transitive.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ----------------------- |
| Version | 8.4.3 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler (Type checker) |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | mpickering |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"Core Lint error involving newtype family instances with wrappers","status":"New","operating_system":"","component":"Compiler (Type checker)","related":[],"milestone":"8.6.1","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.4.3","keywords":["TypeFamilies"],"differentials":[],"test_case":"","architecture":"","cc":["mpickering"],"type":"Bug","description":"The following program gives a Core Lint error on GHC 8.4 and later:\r\n\r\n{{{#!hs\r\n{-# LANGUAGE GADTs #-}\r\n{-# LANGUAGE ScopedTypeVariables #-}\r\n{-# LANGUAGE TypeFamilies #-}\r\nmodule Bug where\r\n\r\ndata family Sn a\r\nnewtype instance Sn (Either a b) where\r\n SnC :: forall b a. Char -> Sn (Either a b)\r\n}}}\r\n{{{\r\n$ /opt/ghc/8.4.3/bin/ghc -dcore-lint Bug.hs\r\n[1 of 1] Compiling Bug ( Bug.hs, Bug.o )\r\n*** Core Lint errors : in result of Tidy Core ***\r\n<no location info>: warning:\r\n [in body of lambda with binder dt_aZm :: Char]\r\n From-type of Cast differs from type of enclosed expression\r\n From-type: R:SnEither a_auS b_auR\r\n Type of enclosed expr: Sn (Either a_auS b_auR)\r\n Actual enclosed expr: dt_aZm\r\n `cast` (Sym (N:R:SnEither[0]\r\n <a_auS>_N <b_auR>_N) ; Sym (D:R:SnEither0[0]\r\n <a_auS>_N <b_auR>_N)\r\n :: (Char :: *) ~R# (Sn (Either a_auS b_auR) :: *))\r\n Coercion used in cast: Sym (D:R:SnEither0[0] <a_auS>_N <b_auR>_N)\r\n*** Offending Program ***\r\n$WSnC [InlPrag=INLINE[2]] :: forall b a. Char -> Sn (Either a b)\r\n[GblId[DataConWrapper],\r\n Arity=1,\r\n Caf=NoCafRefs,\r\n Str=<L,U>,\r\n Unf=Unf{Src=InlineStable, TopLvl=True, Value=True, ConLike=True,\r\n WorkFree=True, Expandable=True,\r\n Guidance=ALWAYS_IF(arity=1,unsat_ok=True,boring_ok=True)\r\n Tmpl= \\ (@ b_auR) (@ a_auS) (dt_aZm [Occ=Once] :: Char) ->\r\n (dt_aZm\r\n `cast` (Sym (N:R:SnEither[0]\r\n <a_auS>_N <b_auR>_N) ; Sym (D:R:SnEither0[0] <a_auS>_N <b_auR>_N)\r\n :: (Char :: *) ~R# (Sn (Either a_auS b_auR) :: *)))\r\n `cast` (Sym (D:R:SnEither0[0] <a_auS>_N <b_auR>_N)\r\n :: (R:SnEither a_auS b_auR :: *)\r\n ~R# (Sn (Either a_auS b_auR) :: *))}]\r\n$WSnC\r\n = \\ (@ b_auR) (@ a_auS) (dt_aZm [Occ=Once] :: Char) ->\r\n (dt_aZm\r\n `cast` (Sym (N:R:SnEither[0]\r\n <a_auS>_N <b_auR>_N) ; Sym (D:R:SnEither0[0] <a_auS>_N <b_auR>_N)\r\n :: (Char :: *) ~R# (Sn (Either a_auS b_auR) :: *)))\r\n `cast` (Sym (D:R:SnEither0[0] <a_auS>_N <b_auR>_N)\r\n :: (R:SnEither a_auS b_auR :: *)\r\n ~R# (Sn (Either a_auS b_auR) :: *))\r\n\r\n$trModule1_r10g :: Addr#\r\n[GblId, Caf=NoCafRefs]\r\n$trModule1_r10g = \"main\"#\r\n\r\n$trModule2_r10D :: TrName\r\n[GblId, Caf=NoCafRefs]\r\n$trModule2_r10D = TrNameS $trModule1_r10g\r\n\r\n$trModule3_r10E :: Addr#\r\n[GblId, Caf=NoCafRefs]\r\n$trModule3_r10E = \"Bug\"#\r\n\r\n$trModule4_r10F :: TrName\r\n[GblId, Caf=NoCafRefs]\r\n$trModule4_r10F = TrNameS $trModule3_r10E\r\n\r\n$trModule :: Module\r\n[GblId, Caf=NoCafRefs]\r\n$trModule = Module $trModule2_r10D $trModule4_r10F\r\n\r\n$krep_r10G :: KindRep\r\n[GblId]\r\n$krep_r10G = KindRepTyConApp $tcChar ([] @ KindRep)\r\n\r\n$krep1_r10H :: KindRep\r\n[GblId, Caf=NoCafRefs]\r\n$krep1_r10H = KindRepVar 1#\r\n\r\n$krep2_r10I :: KindRep\r\n[GblId, Caf=NoCafRefs]\r\n$krep2_r10I = KindRepVar 0#\r\n\r\n$krep3_r10J :: [KindRep]\r\n[GblId, Caf=NoCafRefs]\r\n$krep3_r10J = : @ KindRep $krep2_r10I ([] @ KindRep)\r\n\r\n$krep4_r10K :: [KindRep]\r\n[GblId, Caf=NoCafRefs]\r\n$krep4_r10K = : @ KindRep $krep1_r10H $krep3_r10J\r\n\r\n$krep5_r10L :: KindRep\r\n[GblId]\r\n$krep5_r10L = KindRepTyConApp $tcEither $krep4_r10K\r\n\r\n$tcSn1_r10M :: Addr#\r\n[GblId, Caf=NoCafRefs]\r\n$tcSn1_r10M = \"Sn\"#\r\n\r\n$tcSn2_r10N :: TrName\r\n[GblId, Caf=NoCafRefs]\r\n$tcSn2_r10N = TrNameS $tcSn1_r10M\r\n\r\n$tcSn :: TyCon\r\n[GblId]\r\n$tcSn\r\n = TyCon\r\n 461968091845555535##\r\n 16320521938866097056##\r\n $trModule\r\n $tcSn2_r10N\r\n 0#\r\n krep$*Arr*\r\n\r\n$krep6_r10O :: [KindRep]\r\n[GblId]\r\n$krep6_r10O = : @ KindRep $krep5_r10L ([] @ KindRep)\r\n\r\n$krep7_r10P :: KindRep\r\n[GblId]\r\n$krep7_r10P = KindRepTyConApp $tcSn $krep6_r10O\r\n\r\n$krep8_r10Q :: KindRep\r\n[GblId]\r\n$krep8_r10Q = KindRepFun $krep_r10G $krep7_r10P\r\n\r\n$tc'SnC1_r10R :: Addr#\r\n[GblId, Caf=NoCafRefs]\r\n$tc'SnC1_r10R = \"'SnC\"#\r\n\r\n$tc'SnC2_r10S :: TrName\r\n[GblId, Caf=NoCafRefs]\r\n$tc'SnC2_r10S = TrNameS $tc'SnC1_r10R\r\n\r\n$tc'SnC :: TyCon\r\n[GblId]\r\n$tc'SnC\r\n = TyCon\r\n 3818830880305712792##\r\n 17484539998814842835##\r\n $trModule\r\n $tc'SnC2_r10S\r\n 2#\r\n $krep8_r10Q\r\n\r\n*** End of Offense ***\r\n\r\n\r\n<no location info>: error: \r\nCompilation had errors\r\n}}}\r\n\r\nIf we look at the Core for `$WSnC`, we see the culprit:\r\n\r\n{{{\r\n$WSnC\r\n = \\ (@ b_auR) (@ a_auS) (dt_aZm [Occ=Once] :: Char) ->\r\n (dt_aZm\r\n `cast` (Sym (N:R:SnEither[0]\r\n <a_auS>_N <b_auR>_N) ; Sym (D:R:SnEither0[0] <a_auS>_N <b_auR>_N)\r\n :: (Char :: *) ~R# (Sn (Either a_auS b_auR) :: *)))\r\n `cast` (Sym (D:R:SnEither0[0] <a_auS>_N <b_auR>_N)\r\n :: (R:SnEither a_auS b_auR :: *)\r\n ~R# (Sn (Either a_auS b_auR) :: *))\r\n}}}\r\n\r\nThe inner cast goes from `Char` to `Sn (Either a b)`, but then the outer cast goes from `R:SnEither a b` to `Sn (Either a b)`, which is not transitive.","type_of_failure":"OtherFailure","blocking":[]} -->8.6.1https://gitlab.haskell.org/ghc/ghc/-/issues/15289isUnliftedType GHC panic on pattern with True :: Maybe2019-07-07T18:13:25ZRemiisUnliftedType GHC panic on pattern with True :: Maybe```hs
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ScopedTypeVariables #-}
module Oops where
pattern What = True :: Maybe
```
Fails on 8.4.3 with:
```
ghc: panic! (the 'impossible' happened)
(GHC version 8.4.3 for x86_64-unknown-li...```hs
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ScopedTypeVariables #-}
module Oops where
pattern What = True :: Maybe
```
Fails on 8.4.3 with:
```
ghc: panic! (the 'impossible' happened)
(GHC version 8.4.3 for x86_64-unknown-linux):
isUnliftedType
(Maybe |> {co_a1Dg3}) :: TYPE t_a1Dg9[tau:1]
Call stack:
CallStack (from HasCallStack):
callStackDoc, called at compiler/utils/Outputable.hs:1150:37 in ghc:Outputable
pprPanic, called at compiler/types/Type.hs:1939:10 in ghc:Type
Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
```
I'm currently cloning from git, and will try to get around to check it with HEAD over the next days. BTW, it's not a show-stopper for me.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ----------------------- |
| Version | 8.4.3 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | low |
| Resolution | Unresolved |
| Component | Compiler (Type checker) |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | aarch64 |
</details>
<!-- {"blocked_by":[],"summary":"isUnliftedType GHC panic on pattern with True :: Maybe","status":"New","operating_system":"","component":"Compiler (Type checker)","related":[],"milestone":"8.6.1","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.4.3","keywords":[],"differentials":[],"test_case":"","architecture":"aarch64","cc":[""],"type":"Bug","description":"{{{#!hs\r\n{-# LANGUAGE PatternSynonyms #-}\r\n{-# LANGUAGE ScopedTypeVariables #-}\r\nmodule Oops where\r\n\r\npattern What = True :: Maybe\r\n}}}\r\n\r\nFails on 8.4.3 with:\r\n{{{\r\nghc: panic! (the 'impossible' happened)\r\n (GHC version 8.4.3 for x86_64-unknown-linux):\r\n\tisUnliftedType\r\n (Maybe |> {co_a1Dg3}) :: TYPE t_a1Dg9[tau:1]\r\n Call stack:\r\n CallStack (from HasCallStack):\r\n callStackDoc, called at compiler/utils/Outputable.hs:1150:37 in ghc:Outputable\r\n pprPanic, called at compiler/types/Type.hs:1939:10 in ghc:Type\r\n\r\nPlease report this as a GHC bug: http://www.haskell.org/ghc/reportabug\r\n}}}\r\n\r\nI'm currently cloning from git, and will try to get around to check it with HEAD over the next days. BTW, it's not a show-stopper for me.","type_of_failure":"OtherFailure","blocking":[]} -->8.6.1https://gitlab.haskell.org/ghc/ghc/-/issues/15215GHC HEAD internal error when FlexibleContexts isn't enabled2019-07-07T18:13:45ZRyan ScottGHC HEAD internal error when FlexibleContexts isn't enabledThe following code produces a GHC internal error on GHC HEAD:
```hs
{-# LANGUAGE GADTs #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeInType #-}
module Bug where
import Data.Kind
data A :: Type -> Type where
MkA :: Show (...The following code produces a GHC internal error on GHC HEAD:
```hs
{-# LANGUAGE GADTs #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeInType #-}
module Bug where
import Data.Kind
data A :: Type -> Type where
MkA :: Show (Maybe a) => A a
data SA :: forall a. A a -> Type where
SMkA :: SA MkA
```
```
$ ~/Software/ghc5/inplace/bin/ghc-stage2 Bug.hs[1 of 1] Compiling Bug ( Bug.hs, Bug.o )
Bug.hs:9:3: error:
• Non type-variable argument in the constraint: Show (Maybe a)
(Use FlexibleContexts to permit this)
• In the definition of data constructor ‘MkA’
In the data type declaration for ‘A’
|
9 | MkA :: Show (Maybe a) => A a
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Bug.hs:12:14: error:
• GHC internal error: ‘MkA’ is not in scope during type checking, but it passed the renamer
tcl_env of environment: [rqU :-> ATcTyCon SA :: forall a. A a -> *,
rsV :-> APromotionErr RecDataConPE]
• In the first argument of ‘SA’, namely ‘MkA’
In the type ‘SA MkA’
In the definition of data constructor ‘SMkA’
|
12 | SMkA :: SA MkA
| ^^^
```
Enabling `FlexibleContexts` causes the internal error to go away.
This is a regression from GHC 8.4, which does not give an internal error.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ----------------------- |
| Version | 8.4.3 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler (Type checker) |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"GHC HEAD internal error when FlexibleContexts isn't enabled","status":"New","operating_system":"","component":"Compiler (Type checker)","related":[],"milestone":"8.6.1","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.4.3","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"The following code produces a GHC internal error on GHC HEAD:\r\n\r\n{{{#!hs\r\n{-# LANGUAGE GADTs #-}\r\n{-# LANGUAGE ScopedTypeVariables #-}\r\n{-# LANGUAGE TypeInType #-}\r\nmodule Bug where\r\n\r\nimport Data.Kind\r\n\r\ndata A :: Type -> Type where\r\n MkA :: Show (Maybe a) => A a\r\n\r\ndata SA :: forall a. A a -> Type where\r\n SMkA :: SA MkA\r\n}}}\r\n{{{\r\n$ ~/Software/ghc5/inplace/bin/ghc-stage2 Bug.hs[1 of 1] Compiling Bug ( Bug.hs, Bug.o )\r\n\r\nBug.hs:9:3: error:\r\n • Non type-variable argument in the constraint: Show (Maybe a)\r\n (Use FlexibleContexts to permit this)\r\n • In the definition of data constructor ‘MkA’\r\n In the data type declaration for ‘A’\r\n |\r\n9 | MkA :: Show (Maybe a) => A a\r\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n\r\nBug.hs:12:14: error:\r\n • GHC internal error: ‘MkA’ is not in scope during type checking, but it passed the renamer\r\n tcl_env of environment: [rqU :-> ATcTyCon SA :: forall a. A a -> *,\r\n rsV :-> APromotionErr RecDataConPE]\r\n • In the first argument of ‘SA’, namely ‘MkA’\r\n In the type ‘SA MkA’\r\n In the definition of data constructor ‘SMkA’\r\n |\r\n12 | SMkA :: SA MkA\r\n | ^^^\r\n}}}\r\n\r\nEnabling `FlexibleContexts` causes the internal error to go away.\r\n\r\nThis is a regression from GHC 8.4, which does not give an internal error.","type_of_failure":"OtherFailure","blocking":[]} -->8.6.1https://gitlab.haskell.org/ghc/ghc/-/issues/15202Internal error showing typed hole in GHCi2019-07-07T18:13:49ZDavid FeuerInternal error showing typed hole in GHCiRun `ghc --interactive`, and at the prompt type
```hs
default ()
fish :: Eq a => a; fish = undefined
foo :: String; foo = show _
```
The following error appears:
```
<interactive>:1:1: error:
GHC internal error: ‘Ghci1.$trModule’ ...Run `ghc --interactive`, and at the prompt type
```hs
default ()
fish :: Eq a => a; fish = undefined
foo :: String; foo = show _
```
The following error appears:
```
<interactive>:1:1: error:
GHC internal error: ‘Ghci1.$trModule’ is not in scope during type checking, but it passed the renamer
tcl_env of environment: [r2CZ :-> Identifier[foo::String, TopLevelLet]]
```
I have not yet been able to reproduce this loading a module; it seems to need to be on the command line.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ----------------------- |
| Version | 8.5 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler (Type checker) |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"Internal error showing typed hole in GHCi","status":"New","operating_system":"","component":"Compiler (Type checker)","related":[],"milestone":"8.6.1","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.5","keywords":["TypedHoles"],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"Run `ghc --interactive`, and at the prompt type\r\n\r\n{{{#!hs\r\ndefault ()\r\nfish :: Eq a => a; fish = undefined\r\nfoo :: String; foo = show _\r\n}}}\r\n\r\nThe following error appears:\r\n\r\n{{{\r\n<interactive>:1:1: error:\r\n GHC internal error: ‘Ghci1.$trModule’ is not in scope during type checking, but it passed the renamer\r\n tcl_env of environment: [r2CZ :-> Identifier[foo::String, TopLevelLet]]\r\n}}}\r\n\r\nI have not yet been able to reproduce this loading a module; it seems to need to be on the command line.","type_of_failure":"OtherFailure","blocking":[]} -->8.6.1https://gitlab.haskell.org/ghc/ghc/-/issues/15186ghc 8.4.2 panic in profiling build2019-07-07T18:13:52Zkquickghc 8.4.2 panic in profiling buildWhen building our crucible-llvm library (https://github.com/GaloisInc/crucible) with profiling enabled, we encounter the following:
```
[19 of 21] Compiling Lang.Crucible.LLVM.Translation ( src/Lang/Crucible/LLVM/Translation.hs, dist/bu...When building our crucible-llvm library (https://github.com/GaloisInc/crucible) with profiling enabled, we encounter the following:
```
[19 of 21] Compiling Lang.Crucible.LLVM.Translation ( src/Lang/Crucible/LLVM/Translation.hs, dist/build/Lang/Crucible/LLVM/Translation.p_o )
ghc: panic! (the 'impossible' happened)
(GHC version 8.4.2 for x86_64-unknown-linux):
isUnliftedType
r_a4IqS :: TYPE rep_a4IqR
Call stack:
CallStack (from HasCallStack):
callStackDoc, called at compiler/utils/Outputable.hs:1150:37 in ghc:Outputable
pprPanic, called at compiler/types/Type.hs:1939:10 in ghc:Type
Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
```
Procedure to reproduce:
```
$ git clone https://github.com/GaloisInc/crucible
$ cd crucible/crucible-llvm
$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 8.4.2
$ cabal --version
cabal-install version 2.0.0.1
compiled using version 2.0.1.0 of the Cabal library
$ cabal configure --enable-library-profiling
$ cabal build
```
Note: the llvm-pretty dependency on Hackage is not compatible with GHC 8.4.2; use the latest from the github repo at http://github.com/elliottt/llvm-pretty. The crucible and what4 dependencies come from sibling subdirectories in the same crucible checkout.
This builds successfully when using GHC 8.2.2 instead.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 8.4.2 |
| 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":"ghc 8.4.2 panic in profiling build","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.4.2","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"When building our crucible-llvm library (https://github.com/GaloisInc/crucible) with profiling enabled, we encounter the following:\r\n\r\n{{{\r\n[19 of 21] Compiling Lang.Crucible.LLVM.Translation ( src/Lang/Crucible/LLVM/Translation.hs, dist/build/Lang/Crucible/LLVM/Translation.p_o )\r\nghc: panic! (the 'impossible' happened)\r\n (GHC version 8.4.2 for x86_64-unknown-linux):\r\n isUnliftedType\r\n r_a4IqS :: TYPE rep_a4IqR\r\n Call stack:\r\n CallStack (from HasCallStack):\r\n callStackDoc, called at compiler/utils/Outputable.hs:1150:37 in ghc:Outputable\r\n pprPanic, called at compiler/types/Type.hs:1939:10 in ghc:Type\r\n\r\nPlease report this as a GHC bug: http://www.haskell.org/ghc/reportabug\r\n}}}\r\n\r\nProcedure to reproduce:\r\n{{{\r\n$ git clone https://github.com/GaloisInc/crucible\r\n$ cd crucible/crucible-llvm\r\n$ ghc --version\r\nThe Glorious Glasgow Haskell Compilation System, version 8.4.2\r\n$ cabal --version\r\ncabal-install version 2.0.0.1\r\ncompiled using version 2.0.1.0 of the Cabal library\r\n$ cabal configure --enable-library-profiling\r\n$ cabal build\r\n}}}\r\n\r\nNote: the llvm-pretty dependency on Hackage is not compatible with GHC 8.4.2; use the latest from the github repo at http://github.com/elliottt/llvm-pretty. The crucible and what4 dependencies come from sibling subdirectories in the same crucible checkout.\r\n\r\nThis builds successfully when using GHC 8.2.2 instead.\r\n","type_of_failure":"OtherFailure","blocking":[]} -->8.6.1Ben GamariBen Gamarihttps://gitlab.haskell.org/ghc/ghc/-/issues/15170GHC HEAD panic (dischargeFmv)2019-07-07T18:13:56ZRyan ScottGHC HEAD panic (dischargeFmv)The following program panics on GHC HEAD:
```hs
{-# LANGUAGE AllowAmbiguousTypes #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ScopedTypeVariable...The following program panics on GHC HEAD:
```hs
{-# LANGUAGE AllowAmbiguousTypes #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE TypeFamilyDependencies #-}
{-# LANGUAGE TypeInType #-}
{-# LANGUAGE TypeOperators #-}
module Bug where
import Data.Kind
import Data.Proxy
data family Sing (a :: k)
data SomeSing :: Type -> Type where
SomeSing :: Sing (a :: k) -> SomeSing k
class SingKind k where
type Demote k = (r :: Type) | r -> k
fromSing :: Sing (a :: k) -> Demote k
toSing :: Demote k -> SomeSing k
withSomeSing :: forall k r
. SingKind k
=> Demote k
-> (forall (a :: k). Sing a -> r)
-> r
withSomeSing x f =
case toSing x of
SomeSing x' -> f x'
newtype instance Sing (f :: k1 ~> k2) =
SLambda { applySing :: forall t. Sing t -> Sing (f @@ t) }
instance (SingKind k1, SingKind k2) => SingKind (k1 ~> k2) where
type Demote (k1 ~> k2) = Demote k1 -> Demote k2
fromSing sFun x = withSomeSing x (fromSing . applySing sFun)
toSing = undefined
data TyFun :: Type -> Type -> Type
type a ~> b = TyFun a b -> Type
infixr 0 ~>
type family Apply (f :: k1 ~> k2) (x :: k1) :: k2
type f @@ x = Apply f x
infixl 9 @@
dcomp :: forall (a :: Type)
(b :: a ~> Type)
(c :: forall (x :: a). Proxy x ~> b @@ x ~> Type)
(f :: forall (x :: a) (y :: b @@ x). Proxy x ~> Proxy y ~> c @@ ('Proxy :: Proxy x) @@ y)
(g :: forall (x :: a). Proxy x ~> b @@ x)
(x :: a).
SingKind (c @@ ('Proxy :: Proxy x) @@ (g @@ ('Proxy :: Proxy x)))
=> (forall (xx :: a) (yy :: b @@ xx). Sing (f @@ ('Proxy :: Proxy xx) @@ ('Proxy :: Proxy yy)))
-> Sing g
-> Sing a
-> Demote (c @@ ('Proxy :: Proxy x) @@ (g @@ ('Proxy :: Proxy x)))
dcomp _sf _ _ = undefined
```
```
$ /opt/ghc/head/bin/ghc Bug2.hs
[1 of 1] Compiling Bug ( Bug2.hs, Bug2.o )
ghc: panic! (the 'impossible' happened)
(GHC version 8.5.20180501 for x86_64-unknown-linux):
dischargeFmv
[D] _ {0}:: (Apply
(f_a1ih[sk:2] xx_a1iA[tau:3] yy_a1iB[tau:3] |> Sym ((TyFun
<Proxy xx_a1iA[tau:3]>_N
((TyFun
(Proxy
(Sym {co_a1jm})
(Coh <yy_a1iB[tau:3]>_N
{co_a1jm}))_N
(Sym {co_a1jB} ; (Apply
(Sym {co_a1jm})
<*>_N
(Coh ((Coh <s_a1jn[fmv:0]>_N
((TyFun
(Sym {co_a1jm})
<*>_N)_N
->_N <*>_N) ; Sym {co_a1jA}) ; (Apply
<Proxy
xx_a1iA[tau:3]>_N
((TyFun
(Sym {co_a1jm})
<*>_N)_N
->_N <*>_N)
(Coh <c_a1ig[sk:2] xx_a1iA[tau:3]>_N
(Sym ((TyFun
<Proxy
xx_a1iA[tau:3]>_N
((TyFun
(Sym {co_a1jm})
<*>_N)_N
->_N <*>_N))_N
->_N <*>_N)))
<'Proxy>_N)_N)
(Sym ((TyFun
(Sym {co_a1jm})
<*>_N)_N
->_N <*>_N)))
(Coh <yy_a1iB[tau:3]>_N
{co_a1jm}))_N))_N
->_N <*>_N))_N
->_N <*>_N))
'Proxy :: (Proxy (yy_a1iB[tau:3] |> {co_a1jm}) ~> s_a1jp[fmv:0]))
~# (s_a1jQ[fmv:0] :: (Proxy (yy_a1iB[tau:3] |> {co_a1jm})
~> s_a1jp[fmv:0]))
Call stack:
CallStack (from HasCallStack):
callStackDoc, called at compiler/utils/Outputable.hs:1162:37 in ghc:Outputable
pprPanic, called at compiler/typecheck/TcSMonad.hs:3047:25 in ghc:TcSMonad
```
On GHC 8.4.2, it simply throws an error:
```
$ /opt/ghc/8.4.2/bin/ghci Bug2.hs
GHCi, version 8.4.2: http://www.haskell.org/ghc/ :? for help
Loaded GHCi configuration from /home/rgscott/.ghci
[1 of 1] Compiling Bug ( Bug2.hs, interpreted )
Bug2.hs:53:71: error:
• Expected kind ‘Apply b xx’, but ‘y’ has kind ‘b @@ x’
• In the first argument of ‘Proxy’, namely ‘y’
In the first argument of ‘(~>)’, namely ‘Proxy y’
In the second argument of ‘(~>)’, namely
‘Proxy y ~> c @@ ( 'Proxy :: Proxy x) @@ y’
|
53 | (f :: forall (x :: a) (y :: b @@ x). Proxy x ~> Proxy y ~> c @@ ('Proxy :: Proxy x) @@ y)
| ^
```
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ----------------------- |
| Version | 8.5 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler (Type checker) |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"GHC HEAD panic (dischargeFmv)","status":"New","operating_system":"","component":"Compiler (Type checker)","related":[],"milestone":"8.6.1","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.5","keywords":["TypeInType"],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"The following program panics on GHC HEAD:\r\n\r\n{{{#!hs\r\n{-# LANGUAGE AllowAmbiguousTypes #-}\r\n{-# LANGUAGE FlexibleContexts #-}\r\n{-# LANGUAGE FlexibleInstances #-}\r\n{-# LANGUAGE GADTs #-}\r\n{-# LANGUAGE RankNTypes #-}\r\n{-# LANGUAGE ScopedTypeVariables #-}\r\n{-# LANGUAGE TypeApplications #-}\r\n{-# LANGUAGE TypeFamilyDependencies #-}\r\n{-# LANGUAGE TypeInType #-}\r\n{-# LANGUAGE TypeOperators #-}\r\nmodule Bug where\r\n\r\nimport Data.Kind\r\nimport Data.Proxy\r\n\r\ndata family Sing (a :: k)\r\ndata SomeSing :: Type -> Type where\r\n SomeSing :: Sing (a :: k) -> SomeSing k\r\n\r\nclass SingKind k where\r\n type Demote k = (r :: Type) | r -> k\r\n fromSing :: Sing (a :: k) -> Demote k\r\n toSing :: Demote k -> SomeSing k\r\n\r\nwithSomeSing :: forall k r\r\n . SingKind k\r\n => Demote k\r\n -> (forall (a :: k). Sing a -> r)\r\n -> r\r\nwithSomeSing x f =\r\n case toSing x of\r\n SomeSing x' -> f x'\r\n\r\nnewtype instance Sing (f :: k1 ~> k2) =\r\n SLambda { applySing :: forall t. Sing t -> Sing (f @@ t) }\r\n\r\ninstance (SingKind k1, SingKind k2) => SingKind (k1 ~> k2) where\r\n type Demote (k1 ~> k2) = Demote k1 -> Demote k2\r\n fromSing sFun x = withSomeSing x (fromSing . applySing sFun)\r\n toSing = undefined\r\n\r\ndata TyFun :: Type -> Type -> Type\r\ntype a ~> b = TyFun a b -> Type\r\ninfixr 0 ~>\r\n\r\ntype family Apply (f :: k1 ~> k2) (x :: k1) :: k2\r\ntype f @@ x = Apply f x\r\ninfixl 9 @@\r\n\r\ndcomp :: forall (a :: Type)\r\n (b :: a ~> Type)\r\n (c :: forall (x :: a). Proxy x ~> b @@ x ~> Type)\r\n (f :: forall (x :: a) (y :: b @@ x). Proxy x ~> Proxy y ~> c @@ ('Proxy :: Proxy x) @@ y)\r\n (g :: forall (x :: a). Proxy x ~> b @@ x)\r\n (x :: a).\r\n SingKind (c @@ ('Proxy :: Proxy x) @@ (g @@ ('Proxy :: Proxy x)))\r\n => (forall (xx :: a) (yy :: b @@ xx). Sing (f @@ ('Proxy :: Proxy xx) @@ ('Proxy :: Proxy yy)))\r\n -> Sing g\r\n -> Sing a\r\n -> Demote (c @@ ('Proxy :: Proxy x) @@ (g @@ ('Proxy :: Proxy x)))\r\ndcomp _sf _ _ = undefined\r\n}}}\r\n{{{\r\n$ /opt/ghc/head/bin/ghc Bug2.hs\r\n[1 of 1] Compiling Bug ( Bug2.hs, Bug2.o )\r\nghc: panic! (the 'impossible' happened)\r\n (GHC version 8.5.20180501 for x86_64-unknown-linux):\r\n dischargeFmv\r\n [D] _ {0}:: (Apply\r\n (f_a1ih[sk:2] xx_a1iA[tau:3] yy_a1iB[tau:3] |> Sym ((TyFun\r\n <Proxy xx_a1iA[tau:3]>_N\r\n ((TyFun\r\n (Proxy\r\n (Sym {co_a1jm})\r\n (Coh <yy_a1iB[tau:3]>_N\r\n {co_a1jm}))_N\r\n (Sym {co_a1jB} ; (Apply\r\n (Sym {co_a1jm})\r\n <*>_N\r\n (Coh ((Coh <s_a1jn[fmv:0]>_N\r\n ((TyFun\r\n (Sym {co_a1jm})\r\n <*>_N)_N\r\n ->_N <*>_N) ; Sym {co_a1jA}) ; (Apply\r\n <Proxy\r\n xx_a1iA[tau:3]>_N\r\n ((TyFun\r\n (Sym {co_a1jm})\r\n <*>_N)_N\r\n ->_N <*>_N)\r\n (Coh <c_a1ig[sk:2] xx_a1iA[tau:3]>_N\r\n (Sym ((TyFun\r\n <Proxy\r\n xx_a1iA[tau:3]>_N\r\n ((TyFun\r\n (Sym {co_a1jm})\r\n <*>_N)_N\r\n ->_N <*>_N))_N\r\n ->_N <*>_N)))\r\n <'Proxy>_N)_N)\r\n (Sym ((TyFun\r\n (Sym {co_a1jm})\r\n <*>_N)_N\r\n ->_N <*>_N)))\r\n (Coh <yy_a1iB[tau:3]>_N\r\n {co_a1jm}))_N))_N\r\n ->_N <*>_N))_N\r\n ->_N <*>_N))\r\n 'Proxy :: (Proxy (yy_a1iB[tau:3] |> {co_a1jm}) ~> s_a1jp[fmv:0]))\r\n ~# (s_a1jQ[fmv:0] :: (Proxy (yy_a1iB[tau:3] |> {co_a1jm})\r\n ~> s_a1jp[fmv:0]))\r\n Call stack:\r\n CallStack (from HasCallStack):\r\n callStackDoc, called at compiler/utils/Outputable.hs:1162:37 in ghc:Outputable\r\n pprPanic, called at compiler/typecheck/TcSMonad.hs:3047:25 in ghc:TcSMonad\r\n}}}\r\n\r\nOn GHC 8.4.2, it simply throws an error:\r\n\r\n{{{\r\n$ /opt/ghc/8.4.2/bin/ghci Bug2.hs\r\nGHCi, version 8.4.2: http://www.haskell.org/ghc/ :? for help\r\nLoaded GHCi configuration from /home/rgscott/.ghci\r\n[1 of 1] Compiling Bug ( Bug2.hs, interpreted )\r\n\r\nBug2.hs:53:71: error:\r\n • Expected kind ‘Apply b xx’, but ‘y’ has kind ‘b @@ x’\r\n • In the first argument of ‘Proxy’, namely ‘y’\r\n In the first argument of ‘(~>)’, namely ‘Proxy y’\r\n In the second argument of ‘(~>)’, namely\r\n ‘Proxy y ~> c @@ ( 'Proxy :: Proxy x) @@ y’\r\n |\r\n53 | (f :: forall (x :: a) (y :: b @@ x). Proxy x ~> Proxy y ~> c @@ ('Proxy :: Proxy x) @@ y)\r\n | ^\r\n}}}","type_of_failure":"OtherFailure","blocking":[]} -->8.6.1https://gitlab.haskell.org/ghc/ghc/-/issues/15168GHC HEAD crashes on Windows 64 after the SRT overhaul (May 16, 2018 and newer)2019-07-07T18:13:57ZawsonGHC HEAD crashes on Windows 64 after the SRT overhaul (May 16, 2018 and newer)After the series of SRT overhaul patches GHC doesn't work on Windows 64-bit.
GHC executable crashes (AV) on any attempt to compile anything or even to start in interactive mode. When crashed it report crash address which may look not as...After the series of SRT overhaul patches GHC doesn't work on Windows 64-bit.
GHC executable crashes (AV) on any attempt to compile anything or even to start in interactive mode. When crashed it report crash address which may look not as a real address at all (e.g. 0x800 or 0xffffffffffffffff) and may report either reading from or executing such an address.
OTOH, when started with, e.g. `+RTS -A256m -RTS` it is able to compile some programs (`haddock` at least).
Reverting all related commits down to eb8e692cab7970c495681e14721d05ecadd21581 make things work again.
I have no proof that things went bad exactly at eb8e692cab7970c495681e14721d05ecadd21581. Perhaps, this happened later on, but I have a proof that things were good immediately before.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 8.5 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | high |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"GHC HEAD crashes on Windows 64 after the SRT overhaul (May 16, 2018 and newer)","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"8.6.1","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.5","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"After the series of SRT overhaul patches GHC doesn't work on Windows 64-bit.\r\n\r\nGHC executable crashes (AV) on any attempt to compile anything or even to start in interactive mode. When crashed it report crash address which may look not as a real address at all (e.g. 0x800 or 0xffffffffffffffff) and may report either reading from or executing such an address.\r\n\r\nOTOH, when started with, e.g. `+RTS -A256m -RTS` it is able to compile some programs (`haddock` at least).\r\n\r\nReverting all related commits down to eb8e692cab7970c495681e14721d05ecadd21581 make things work again.\r\n\r\nI have no proof that things went bad exactly at eb8e692cab7970c495681e14721d05ecadd21581. Perhaps, this happened later on, but I have a proof that things were good immediately before.","type_of_failure":"OtherFailure","blocking":[]} -->8.6.1https://gitlab.haskell.org/ghc/ghc/-/issues/15154Segmentation fault of ghc-pkg.exe from 32-bit distribution of ghc-8.2.2 on Wi...2019-07-07T18:14:01Zki11men0wSegmentation fault of ghc-pkg.exe from 32-bit distribution of ghc-8.2.2 on Windows 7On `Windows 7` call of `ghc-pkg` utility from `32-bit` `ghc-8.2.2` distribution is always ended with `Segmentation fault` error.
With use of `Cygwin` the error can be reproduced this way: run `cmd.exe` and in the appeared console window...On `Windows 7` call of `ghc-pkg` utility from `32-bit` `ghc-8.2.2` distribution is always ended with `Segmentation fault` error.
With use of `Cygwin` the error can be reproduced this way: run `cmd.exe` and in the appeared console window execute the following commands
```bash
c:\Users\user.name\wrk> bash
$ mkdir ghc-pkg-check
$ cd ghc-pkg-check
$ curl https://downloads.haskell.org/~ghc/8.2.2/ghc-8.2.2-i386-unknown-mingw32.tar.xz > ghc-8.2.2-i386-unknown-mingw32.tar.xz
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 163M 100 163M 0 0 3669k 0 0:00:45 0:00:45 --:--:-- 4776k
$ xz -dc ghc-8.2.2-i386-unknown-mingw32.tar.xz | tar -xf -
$ cd ghc-8.2.2/bin/
$ ./ghc-pkg.exe --version
GHC package manager version 8.2.2
Segmentation fault
```
The error arises irrespective of how and with what arguments to call `ghc-pkg` utility. For example, firstly I has faced the problem using `stack` from Windows console:
```bat
> stack build --arch=i386 --resolver=11.9
```
I checked another distributions of GHC for presence of this bug on `Windows 7`. 64-bit version of ghc-8.2.2, 32-bit and 64-bit versions of ghc-8.0.2 and ghc-8.4.2 are free of the problem. I \*\*did not check\*\* the problem \*\*on another versions\*\* of MS Windows.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 8.2.2 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | ghc-pkg |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"Segmentation fault of ghc-pkg.exe from 32-bit distribution of ghc-8.2.2 on Windows 7","status":"New","operating_system":"","component":"ghc-pkg","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.2.2","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"On `Windows 7` call of `ghc-pkg` utility from `32-bit` `ghc-8.2.2` distribution is always ended with `Segmentation fault` error.\r\n\r\nWith use of `Cygwin` the error can be reproduced this way: run `cmd.exe` and in the appeared console window execute the following commands\r\n{{{#!bash\r\nc:\\Users\\user.name\\wrk> bash\r\n$ mkdir ghc-pkg-check\r\n$ cd ghc-pkg-check\r\n$ curl https://downloads.haskell.org/~ghc/8.2.2/ghc-8.2.2-i386-unknown-mingw32.tar.xz > ghc-8.2.2-i386-unknown-mingw32.tar.xz\r\n % Total % Received % Xferd Average Speed Time Time Time Current\r\n Dload Upload Total Spent Left Speed\r\n100 163M 100 163M 0 0 3669k 0 0:00:45 0:00:45 --:--:-- 4776k\r\n\r\n$ xz -dc ghc-8.2.2-i386-unknown-mingw32.tar.xz | tar -xf -\r\n$ cd ghc-8.2.2/bin/\r\n$ ./ghc-pkg.exe --version\r\nGHC package manager version 8.2.2\r\nSegmentation fault\r\n}}}\r\n\r\nThe error arises irrespective of how and with what arguments to call `ghc-pkg` utility. For example, firstly I has faced the problem using `stack` from Windows console:\r\n{{{#!bat\r\n> stack build --arch=i386 --resolver=11.9\r\n}}}\r\n\r\nI checked another distributions of GHC for presence of this bug on `Windows 7`. 64-bit version of ghc-8.2.2, 32-bit and 64-bit versions of ghc-8.0.2 and ghc-8.4.2 are free of the problem. I **did not check** the problem **on another versions** of MS Windows.","type_of_failure":"OtherFailure","blocking":[]} -->8.6.1https://gitlab.haskell.org/ghc/ghc/-/issues/15142GHC HEAD regression: tcTyVarDetails2019-07-07T18:14:05ZRyan ScottGHC HEAD regression: tcTyVarDetailsThis regression prevents the `generic-lens` library from building. Here is a minimized test case:
```hs
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeInType #-}
module Bug where
import Data.Kind
...This regression prevents the `generic-lens` library from building. Here is a minimized test case:
```hs
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeInType #-}
module Bug where
import Data.Kind
class ListTuple (tuple :: Type) (as :: [(k, Type)]) where
type ListToTuple as :: Type
```
On GHC 8.4.2, this compiles, but on GHC HEAD, it panics:
```
$ ~/Software/ghc/inplace/bin/ghc-stage2 Bug.hs[1 of 1] Compiling Bug ( Bug.hs, Bug.o )
ghc-stage2: panic! (the 'impossible' happened)
(GHC version 8.5.20180511 for x86_64-unknown-linux):
tcTyVarDetails
co_aWx :: (k_aWt[tau:2] :: *) ~# (* :: *)
Call stack:
CallStack (from HasCallStack):
callStackDoc, called at compiler/utils/Outputable.hs:1162:37 in ghc:Outputable
pprPanic, called at compiler/basicTypes/Var.hs:497:22 in ghc:Var
```
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ----------------------- |
| Version | 8.5 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | highest |
| Resolution | Unresolved |
| Component | Compiler (Type checker) |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"GHC HEAD regression: tcTyVarDetails","status":"New","operating_system":"","component":"Compiler (Type checker)","related":[],"milestone":"8.6.1","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.5","keywords":["TypeFamilies","TypeInType,"],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"This regression prevents the `generic-lens` library from building. Here is a minimized test case:\r\n\r\n{{{#!hs\r\n{-# LANGUAGE MultiParamTypeClasses #-}\r\n{-# LANGUAGE TypeFamilies #-}\r\n{-# LANGUAGE TypeInType #-}\r\nmodule Bug where\r\n\r\nimport Data.Kind\r\n\r\nclass ListTuple (tuple :: Type) (as :: [(k, Type)]) where\r\n type ListToTuple as :: Type\r\n}}}\r\n\r\nOn GHC 8.4.2, this compiles, but on GHC HEAD, it panics:\r\n\r\n{{{\r\n$ ~/Software/ghc/inplace/bin/ghc-stage2 Bug.hs[1 of 1] Compiling Bug ( Bug.hs, Bug.o )\r\nghc-stage2: panic! (the 'impossible' happened)\r\n (GHC version 8.5.20180511 for x86_64-unknown-linux):\r\n tcTyVarDetails\r\n co_aWx :: (k_aWt[tau:2] :: *) ~# (* :: *)\r\n Call stack:\r\n CallStack (from HasCallStack):\r\n callStackDoc, called at compiler/utils/Outputable.hs:1162:37 in ghc:Outputable\r\n pprPanic, called at compiler/basicTypes/Var.hs:497:22 in ghc:Var\r\n}}}","type_of_failure":"OtherFailure","blocking":[]} -->8.6.1Richard Eisenbergrae@richarde.devRichard Eisenbergrae@richarde.dev