GHC issueshttps://gitlab.haskell.org/ghc/ghc/-/issues2019-07-07T18:21:22Zhttps://gitlab.haskell.org/ghc/ghc/-/issues/13552Enum Float/Double does not match Haskell Report2019-07-07T18:21:22ZLukeEnum Float/Double does not match Haskell ReportSection 6.3.4 of the report says that the `Enum` instance for `Float` and
`Double` should define the `enumFromThen*` functions such that
`enumFromThen e1 e2` is the list `[e1, e1 + i, e1 + 2i, ...]`
where `i = e2 - e1`. The actual implem...Section 6.3.4 of the report says that the `Enum` instance for `Float` and
`Double` should define the `enumFromThen*` functions such that
`enumFromThen e1 e2` is the list `[e1, e1 + i, e1 + 2i, ...]`
where `i = e2 - e1`. The actual implementation in base is that of successive
additions (which is approximately the same thing for some types).
Successive additions causes issues with floating point rounding. Changing the definition to something like
```hs
enumFromThen_ e1 e2 = let i = e2 - e1 in map (\n -> e1 + n * i) [0..]
```
significantly improves the accuracy of floating point ranges, as well
as \*\*matching what the report says\*\*.
```
Prelude> last $ take 101 $ [0,0.1..] :: Float
10.000028
Prelude> last $ take 101 $ enumFromThen_ 0 0.1 :: Float
10.0
```
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | -------------- |
| Version | 8.0.1 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | libraries/base |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"Enum Float/Double does not match Haskell Report","status":"New","operating_system":"","component":"libraries/base","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.0.1","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"Section 6.3.4 of the report says that the `Enum` instance for `Float` and\r\n`Double` should define the `enumFromThen*` functions such that\r\n`enumFromThen e1 e2` is the list `[e1, e1 + i, e1 + 2i, ...]`\r\nwhere `i = e2 - e1`. The actual implementation in base is that of successive\r\nadditions (which is approximately the same thing for some types).\r\n\r\nSuccessive additions causes issues with floating point rounding. Changing the definition to something like\r\n\r\n{{{#!hs\r\nenumFromThen_ e1 e2 = let i = e2 - e1 in map (\\n -> e1 + n * i) [0..]\r\n}}}\r\n\r\nsignificantly improves the accuracy of floating point ranges, as well\r\nas **matching what the report says**.\r\n\r\n{{{\r\nPrelude> last $ take 101 $ [0,0.1..] :: Float\r\n10.000028\r\n\r\nPrelude> last $ take 101 $ enumFromThen_ 0 0.1 :: Float\r\n10.0\r\n}}}\r\n\r\n","type_of_failure":"OtherFailure","blocking":[]} -->https://gitlab.haskell.org/ghc/ghc/-/issues/13551Support DEPRECATED and WARNING pragmas on Template Haskell2019-07-07T18:21:22ZutdemirSupport DEPRECATED and WARNING pragmas on Template HaskellI'm writing TH function from some JSON spec to Haskell data structures. Some fields are marked as deprecated in the spec, therefore I want to mark the accessors to those fields with DEPRECATED pragma, but as far as I can see, TH does not...I'm writing TH function from some JSON spec to Haskell data structures. Some fields are marked as deprecated in the spec, therefore I want to mark the accessors to those fields with DEPRECATED pragma, but as far as I can see, TH does not support this.
I'm aware that module level DEPRECATED pragma is impossible in TH, but I still want to be able to tag top-level attributes as DEPRECATED.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ---------------- |
| Version | 8.0.1 |
| Type | FeatureRequest |
| TypeOfFailure | OtherFailure |
| Priority | low |
| Resolution | Unresolved |
| Component | Template Haskell |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"Support DEPRECATED and WARNING pragmas on Template Haskell","status":"New","operating_system":"","component":"Template Haskell","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.0.1","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"FeatureRequest","description":"I'm writing TH function from some JSON spec to Haskell data structures. Some fields are marked as deprecated in the spec, therefore I want to mark the accessors to those fields with DEPRECATED pragma, but as far as I can see, TH does not support this.\r\n\r\nI'm aware that module level DEPRECATED pragma is impossible in TH, but I still want to be able to tag top-level attributes as DEPRECATED.\r\n\r\n","type_of_failure":"OtherFailure","blocking":[]} -->https://gitlab.haskell.org/ghc/ghc/-/issues/13550-ddump-splices doesn't parenthesize type/data families correctly in 8.2.12019-07-07T18:21:22ZRyan Scott-ddump-splices doesn't parenthesize type/data families correctly in 8.2.1The pretty-printed code which `-ddump-splices` has regressed since 8.0. If you compile this code:
```hs
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeFamilies #-} ...The pretty-printed code which `-ddump-splices` has regressed since 8.0. If you compile this code:
```hs
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -ddump-splices #-}
module Bug where
$([d| type family Foo a b
type instance Foo (Maybe a) b = Either (Maybe a) (Maybe b)
data family Bar a b
data instance Bar (Maybe a) b = BarMaybe (Maybe a) (Maybe b)
|])
```
with GHC 8.0.2, you get this:
```
GHCi, version 8.0.2: http://www.haskell.org/ghc/ :? for help
Loaded GHCi configuration from /home/rgscott/.ghci
[1 of 1] Compiling Bug ( Bug.hs, interpreted )
Bug.hs:(6,3)-(11,6): Splicing declarations
[d| type family Foo_a13C a_a13G b_a13H
data family Bar_a13B a_a13E b_a13F
data instance Bar_a13B (Maybe a_a13I) b_a13J
= BarMaybe_a13D (Maybe a_a13I) (Maybe b_a13J)
type instance Foo_a13C (Maybe a_a13K) b_a13L = Either (Maybe a_a13K) (Maybe b_a13L) |]
======>
type family Foo_a3O6 a_a3O9 b_a3Oa
type instance Foo_a3O6 (Maybe a_a3Ob) b_a3Oc = Either (Maybe a_a3Ob) (Maybe b_a3Oc)
data family Bar_a3O7 a_a3Od b_a3Oe
data instance Bar_a3O7 (Maybe a_a3Of) b_a3Og
= BarMaybe_a3O8 (Maybe a_a3Of) (Maybe b_a3Og)
```
Looks good. But in GHC 8.2.1, the output of `-ddump-splices` lacks many sets of parentheses which are necessary for correctness!
```
GHCi, version 8.2.0.20170403: http://www.haskell.org/ghc/ :? for help
Loaded GHCi configuration from /home/rgscott/.ghci
[1 of 1] Compiling Bug ( Bug.hs, interpreted )
Bug.hs:(6,3)-(11,6): Splicing declarations
[d| type family Foo_a1ty a_a1tC b_a1tD
data family Bar_a1tx a_a1tA b_a1tB
type instance Foo_a1ty (Maybe a_a1tG) b_a1tH = Either (Maybe a_a1tG) (Maybe b_a1tH)
data instance Bar_a1tx (Maybe a_a1tE) b_a1tF
= BarMaybe_a1tz (Maybe a_a1tE) (Maybe b_a1tF) |]
======>
type family Foo_a4ia a_a4id b_a4ie
type instance Foo_a4ia Maybe a_a4if b_a4ig = Either (Maybe a_a4if) (Maybe b_a4ig)
data family Bar_a4ib a_a4ih b_a4ii
data instance Bar_a4ib Maybe a_a4ij b_a4ik
= BarMaybe_a4ic Maybe a_a4ij Maybe b_a4ik
```
This pops up both in the arguments to `type instance Foo ...` and `data instance Bar ...`, as well as the arguments to the data constructor `BarMaybe`.
cc'ing alanz, since I suspect this is related to #13199.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ---------------- |
| Version | 8.1 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Template Haskell |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | alanz |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"-ddump-splices doesn't parenthesize type/data families correctly in 8.2.1","status":"New","operating_system":"","component":"Template Haskell","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.1","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":["alanz"],"type":"Bug","description":"The pretty-printed code which `-ddump-splices` has regressed since 8.0. If you compile this code:\r\n\r\n{{{#!hs\r\n{-# LANGUAGE TemplateHaskell #-} \r\n{-# LANGUAGE TypeFamilies #-} \r\n{-# OPTIONS_GHC -ddump-splices #-} \r\nmodule Bug where \r\n \r\n$([d| type family Foo a b \r\n type instance Foo (Maybe a) b = Either (Maybe a) (Maybe b) \r\n \r\n data family Bar a b \r\n data instance Bar (Maybe a) b = BarMaybe (Maybe a) (Maybe b) \r\n |])\r\n}}}\r\n\r\nwith GHC 8.0.2, you get this:\r\n\r\n{{{\r\nGHCi, version 8.0.2: http://www.haskell.org/ghc/ :? for help \r\nLoaded GHCi configuration from /home/rgscott/.ghci \r\n[1 of 1] Compiling Bug ( Bug.hs, interpreted ) \r\nBug.hs:(6,3)-(11,6): Splicing declarations \r\n [d| type family Foo_a13C a_a13G b_a13H\r\n data family Bar_a13B a_a13E b_a13F\r\n \r\n data instance Bar_a13B (Maybe a_a13I) b_a13J\r\n = BarMaybe_a13D (Maybe a_a13I) (Maybe b_a13J)\r\n type instance Foo_a13C (Maybe a_a13K) b_a13L = Either (Maybe a_a13K) (Maybe b_a13L) |]\r\n ======>\r\n type family Foo_a3O6 a_a3O9 b_a3Oa\r\n type instance Foo_a3O6 (Maybe a_a3Ob) b_a3Oc = Either (Maybe a_a3Ob) (Maybe b_a3Oc)\r\n data family Bar_a3O7 a_a3Od b_a3Oe\r\n data instance Bar_a3O7 (Maybe a_a3Of) b_a3Og\r\n = BarMaybe_a3O8 (Maybe a_a3Of) (Maybe b_a3Og)\r\n}}}\r\n\r\nLooks good. But in GHC 8.2.1, the output of `-ddump-splices` lacks many sets of parentheses which are necessary for correctness!\r\n\r\n{{{\r\nGHCi, version 8.2.0.20170403: http://www.haskell.org/ghc/ :? for help\r\nLoaded GHCi configuration from /home/rgscott/.ghci\r\n[1 of 1] Compiling Bug ( Bug.hs, interpreted )\r\nBug.hs:(6,3)-(11,6): Splicing declarations\r\n [d| type family Foo_a1ty a_a1tC b_a1tD\r\n data family Bar_a1tx a_a1tA b_a1tB\r\n \r\n type instance Foo_a1ty (Maybe a_a1tG) b_a1tH = Either (Maybe a_a1tG) (Maybe b_a1tH)\r\n data instance Bar_a1tx (Maybe a_a1tE) b_a1tF\r\n = BarMaybe_a1tz (Maybe a_a1tE) (Maybe b_a1tF) |]\r\n ======>\r\n type family Foo_a4ia a_a4id b_a4ie\r\n type instance Foo_a4ia Maybe a_a4if b_a4ig = Either (Maybe a_a4if) (Maybe b_a4ig)\r\n data family Bar_a4ib a_a4ih b_a4ii\r\n data instance Bar_a4ib Maybe a_a4ij b_a4ik\r\n = BarMaybe_a4ic Maybe a_a4ij Maybe b_a4ik\r\n}}}\r\n\r\nThis pops up both in the arguments to `type instance Foo ...` and `data instance Bar ...`, as well as the arguments to the data constructor `BarMaybe`.\r\n\r\ncc'ing alanz, since I suspect this is related to #13199.","type_of_failure":"OtherFailure","blocking":[]} -->8.2.1Alan ZimmermanAlan Zimmermanhttps://gitlab.haskell.org/ghc/ghc/-/issues/13549GHC 8.2.1's typechecker rejects code generated by singletons that 8.0 accepts2019-07-07T18:21:23ZRyan ScottGHC 8.2.1's typechecker rejects code generated by singletons that 8.0 acceptsI recently attempted to upgrade `singletons` to use GHC 8.2.1, but was thwarted when GHC's typechecker rejected code that was generated by Template Haskell. I was able to put all of this code in a single module (which I've attached), but...I recently attempted to upgrade `singletons` to use GHC 8.2.1, but was thwarted when GHC's typechecker rejected code that was generated by Template Haskell. I was able to put all of this code in a single module (which I've attached), but sadly, it's 1367 lines long. What's important is that GHC 8.0.1 and 8.0.2 accept this code, but neither 8.2.1-rc1 nor HEAD do. Here is the error message you get, in its full glory:
```
$ /opt/ghc/8.2.1/bin/ghci Bug.hs -fprint-explicit-kinds
GHCi, version 8.2.0.20170403: http://www.haskell.org/ghc/ :? for help
Loaded GHCi configuration from /home/rgscott/.ghci
[1 of 1] Compiling Bug ( Bug.hs, interpreted )
Bug.hs:1328:59: error:
• Couldn't match type ‘c69895866216793215480’ with ‘[a_a337f]’
‘c69895866216793215480’ is untouchable
inside the constraints: (arg_a33hh ~ xs_a33fp, arg_a33hi ~ r_a33fq)
bound by the type signature for:
lambda_a33iH :: forall (xs_a33fp :: [a_a337f]) (r_a33fq :: [[a_a337f]]).
(arg_a33hh ~ xs_a33fp, arg_a33hi ~ r_a33fq) =>
Sing [a_a337f] xs_a33fp
-> Sing [[a_a337f]] r_a33fq
-> Sing
[[a_a337f]]
(Apply
[[a_a337f]]
[[a_a337f]]
(Apply
[a_a337f]
(TyFun [[a_a337f]] [[a_a337f]] -> *)
(Let6989586621679736980InterleaveSym4
[a_a337f]
[a_a337f]
a_a337f
xs0_a33a0
t_a33aL
ts_a33aM
is_a33aO)
arg_a33hh)
arg_a33hi)
at Bug.hs:(1289,35)-(1294,157)
Expected type: Sing (TyFun [a_a337f] [a_a337f] -> *) t
-> Sing [a_a337f] t1
-> Sing [[a_a337f]] t2
-> Sing
([a_a337f], [[a_a337f]])
((@@)
[[a_a337f]]
([a_a337f], [[a_a337f]])
((@@)
[a_a337f]
([[a_a337f]] ~> ([a_a337f], [[a_a337f]]))
((@@)
(TyFun [a_a337f] [a_a337f] -> *)
([a_a337f] ~> ([[a_a337f]] ~> ([a_a337f], [[a_a337f]])))
(Let6989586621679736980Interleave'Sym4
[a_a337f]
[a_a337f]
a_a337f
[a_a337f]
xs0_a33a0
t_a33aL
ts_a33aM
is_a33aO)
t)
t1)
t2)
Actual type: Sing (TyFun [a_a337f] c69895866216793215480 -> *) t
-> Sing [a_a337f] t1
-> Sing [c69895866216793215480] t2
-> Sing
([a_a337f], [c69895866216793215480])
(Apply
[c69895866216793215480]
([a_a337f], [c69895866216793215480])
(Apply
[a_a337f]
([c69895866216793215480] ~> ([a_a337f], [c69895866216793215480]))
(Apply
(TyFun [a_a337f] c69895866216793215480 -> *)
([a_a337f]
~> ([c69895866216793215480]
~> ([a_a337f], [c69895866216793215480])))
(Let6989586621679736980Interleave'Sym4
[a_a337f]
[a_a337f]
a_a337f
c69895866216793215480
xs0_a33a0
t_a33aL
ts_a33aM
is_a33aO)
t)
t1)
t2)
• In the second argument of ‘singFun3’, namely ‘sInterleave'’
In the first argument of ‘applySing’, namely
‘((singFun3
(Proxy ::
Proxy (Let6989586621679736980Interleave'Sym4 xs0_a33a0 t_a33aL ts_a33aM is_a33aO)))
sInterleave')’
In the first argument of ‘applySing’, namely
‘((applySing
((singFun3
(Proxy ::
Proxy (Let6989586621679736980Interleave'Sym4 xs0_a33a0 t_a33aL ts_a33aM is_a33aO)))
sInterleave'))
((singFun1 (Proxy :: Proxy IdSym0)) sId))’
• Relevant bindings include
sX_6989586621679737266 :: Sing
([a_a337f], [[a_a337f]])
(Let6989586621679737265X_6989586621679737266Sym6
[a_a337f]
[a_a337f]
a_a337f
xs0_a33a0
t_a33aL
ts_a33aM
is_a33aO
xs_a33fp
r_a33fq)
(bound at Bug.hs:1321:41)
r_a33iK :: Sing [[a_a337f]] r_a33fq (bound at Bug.hs:1295:57)
xs_a33iJ :: Sing [a_a337f] xs_a33fp (bound at Bug.hs:1295:48)
lambda_a33iH :: Sing [a_a337f] xs_a33fp
-> Sing [[a_a337f]] r_a33fq
-> Sing
[[a_a337f]]
(Apply
[[a_a337f]]
[[a_a337f]]
(Apply
[a_a337f]
(TyFun [[a_a337f]] [[a_a337f]] -> *)
(Let6989586621679736980InterleaveSym4
[a_a337f]
[a_a337f]
a_a337f
xs0_a33a0
t_a33aL
ts_a33aM
is_a33aO)
arg_a33hh)
arg_a33hi)
(bound at Bug.hs:1295:35)
sR :: Sing [[a_a337f]] arg_a33hi (bound at Bug.hs:1287:45)
sXs :: Sing [a_a337f] arg_a33hh (bound at Bug.hs:1287:41)
sInterleave' :: forall (arg_a33he :: TyFun
[a_a337f] c69895866216793215480
-> *) (arg_a33hf :: [a_a337f]) (arg_a33hg :: [c69895866216793215480]).
Sing (TyFun [a_a337f] c69895866216793215480 -> *) arg_a33he
-> Sing [a_a337f] arg_a33hf
-> Sing [c69895866216793215480] arg_a33hg
-> Sing
([a_a337f], [c69895866216793215480])
(Apply
[c69895866216793215480]
([a_a337f], [c69895866216793215480])
(Apply
[a_a337f]
([c69895866216793215480] ~> ([a_a337f], [c69895866216793215480]))
(Apply
(TyFun [a_a337f] c69895866216793215480 -> *)
([a_a337f]
~> ([c69895866216793215480]
~> ([a_a337f], [c69895866216793215480])))
(Let6989586621679736980Interleave'Sym4
[a_a337f]
[a_a337f]
a_a337f
c69895866216793215480
xs0_a33a0
t_a33aL
ts_a33aM
is_a33aO)
arg_a33he)
arg_a33hf)
arg_a33hg)
(bound at Bug.hs:1166:29)
lambda_a33ha :: Sing a_a337f t_a33aL
-> Sing [a_a337f] ts_a33aM
-> Sing [a_a337f] is_a33aO
-> Sing
[[a_a337f]]
(Apply
[a_a337f]
[[a_a337f]]
(Apply
[a_a337f]
([a_a337f] ~> [[a_a337f]])
(Let6989586621679736931PermsSym1 a_a337f xs0_a33a0)
arg_a33h0)
arg_a33h1)
(bound at Bug.hs:1153:23)
sTs :: Sing [a_a337f] n_a1kQd (bound at Bug.hs:1143:34)
sT :: Sing a_a337f n_a1kQc (bound at Bug.hs:1143:31)
lambda_a33gY :: Sing [a_a337f] xs0_a33a0
-> Sing
[[a_a337f]]
(Apply [a_a337f] [[a_a337f]] (PermutationsSym0 a_a337f) t_a33gX)
(bound at Bug.hs:1127:11)
(Some bindings suppressed; use -fmax-relevant-binds=N or -fno-max-relevant-binds)
|
1328 | sInterleave'))
| ^^^^^^^^^^^^
Bug.hs:1328:59: error:
• Could not deduce: (Let6989586621679736980Interleave'
[a_a337f]
[a_a337f]
a_a337f
c69895866216793215480
xs0_a33a0
t_a33aL
ts_a33aM
is_a33aO
t
t1
t2 :: ([a_a337f], [c69895866216793215480]))
~~
(Let6989586621679736980Interleave'
[a_a337f]
[a_a337f]
a_a337f
[a_a337f]
xs0_a33a0
t_a33aL
ts_a33aM
is_a33aO
t
t1
t2 :: ([a_a337f], [c69895866216793215480]))
from the context: t_a33gX ~ xs0_a33a0
bound by the type signature for:
lambda_a33gY :: forall (xs0_a33a0 :: [a_a337f]).
t_a33gX ~ xs0_a33a0 =>
Sing [a_a337f] xs0_a33a0
-> Sing
[[a_a337f]]
(Apply
[a_a337f] [[a_a337f]] (PermutationsSym0 a_a337f) t_a33gX)
at Bug.hs:(1122,11)-(1126,67)
or from: arg_a33h0 ~ (':) a_a337f n_a1kQc n_a1kQd
bound by a pattern with constructor:
SCons :: forall a_11 (z_a1kQb :: [a_11]) (n_a1kQc :: a_11) (n_a1kQd :: [a_11]).
z_a1kQb ~ (':) a_11 n_a1kQc n_a1kQd =>
Sing a_11 n_a1kQc -> Sing [a_11] n_a1kQd -> Sing [a_11] z_a1kQb,
in an equation for ‘sPerms’
at Bug.hs:1143:25-36
or from: (arg_a33h0
~
Apply
[a_a337f]
[a_a337f]
(Apply
a_a337f (TyFun [a_a337f] [a_a337f] -> *) ((:$) a_a337f) t_a33aL)
ts_a33aM,
arg_a33h1 ~ is_a33aO)
bound by the type signature for:
lambda_a33ha :: forall (t_a33aL :: a_a337f) (ts_a33aM :: [a_a337f]) (is_a33aO :: [a_a337f]).
(arg_a33h0
~
Apply
[a_a337f]
[a_a337f]
(Apply
a_a337f
(TyFun [a_a337f] [a_a337f] -> *)
((:$) a_a337f)
t_a33aL)
ts_a33aM,
arg_a33h1 ~ is_a33aO) =>
Sing a_a337f t_a33aL
-> Sing [a_a337f] ts_a33aM
-> Sing [a_a337f] is_a33aO
-> Sing
[[a_a337f]]
(Apply
[a_a337f]
[[a_a337f]]
(Apply
[a_a337f]
([a_a337f] ~> [[a_a337f]])
(Let6989586621679736931PermsSym1 a_a337f xs0_a33a0)
arg_a33h0)
arg_a33h1)
at Bug.hs:(1145,23)-(1152,117)
or from: (arg_a33hh ~ xs_a33fp, arg_a33hi ~ r_a33fq)
bound by the type signature for:
lambda_a33iH :: forall (xs_a33fp :: [a_a337f]) (r_a33fq :: [[a_a337f]]).
(arg_a33hh ~ xs_a33fp, arg_a33hi ~ r_a33fq) =>
Sing [a_a337f] xs_a33fp
-> Sing [[a_a337f]] r_a33fq
-> Sing
[[a_a337f]]
(Apply
[[a_a337f]]
[[a_a337f]]
(Apply
[a_a337f]
(TyFun [[a_a337f]] [[a_a337f]] -> *)
(Let6989586621679736980InterleaveSym4
[a_a337f]
[a_a337f]
a_a337f
xs0_a33a0
t_a33aL
ts_a33aM
is_a33aO)
arg_a33hh)
arg_a33hi)
at Bug.hs:(1289,35)-(1294,157)
Expected type: Sing (TyFun [a_a337f] [a_a337f] -> *) t
-> Sing [a_a337f] t1
-> Sing [[a_a337f]] t2
-> Sing
([a_a337f], [[a_a337f]])
((@@)
[[a_a337f]]
([a_a337f], [[a_a337f]])
((@@)
[a_a337f]
([[a_a337f]] ~> ([a_a337f], [[a_a337f]]))
((@@)
(TyFun [a_a337f] [a_a337f] -> *)
([a_a337f] ~> ([[a_a337f]] ~> ([a_a337f], [[a_a337f]])))
(Let6989586621679736980Interleave'Sym4
[a_a337f]
[a_a337f]
a_a337f
[a_a337f]
xs0_a33a0
t_a33aL
ts_a33aM
is_a33aO)
t)
t1)
t2)
Actual type: Sing (TyFun [a_a337f] c69895866216793215480 -> *) t
-> Sing [a_a337f] t1
-> Sing [c69895866216793215480] t2
-> Sing
([a_a337f], [c69895866216793215480])
(Apply
[c69895866216793215480]
([a_a337f], [c69895866216793215480])
(Apply
[a_a337f]
([c69895866216793215480] ~> ([a_a337f], [c69895866216793215480]))
(Apply
(TyFun [a_a337f] c69895866216793215480 -> *)
([a_a337f]
~> ([c69895866216793215480]
~> ([a_a337f], [c69895866216793215480])))
(Let6989586621679736980Interleave'Sym4
[a_a337f]
[a_a337f]
a_a337f
c69895866216793215480
xs0_a33a0
t_a33aL
ts_a33aM
is_a33aO)
t)
t1)
t2)
The type variable ‘c69895866216793215480’ is ambiguous
• In the second argument of ‘singFun3’, namely ‘sInterleave'’
In the first argument of ‘applySing’, namely
‘((singFun3
(Proxy ::
Proxy (Let6989586621679736980Interleave'Sym4 xs0_a33a0 t_a33aL ts_a33aM is_a33aO)))
sInterleave')’
In the first argument of ‘applySing’, namely
‘((applySing
((singFun3
(Proxy ::
Proxy (Let6989586621679736980Interleave'Sym4 xs0_a33a0 t_a33aL ts_a33aM is_a33aO)))
sInterleave'))
((singFun1 (Proxy :: Proxy IdSym0)) sId))’
• Relevant bindings include
sX_6989586621679737266 :: Sing
([a_a337f], [[a_a337f]])
(Let6989586621679737265X_6989586621679737266Sym6
[a_a337f]
[a_a337f]
a_a337f
xs0_a33a0
t_a33aL
ts_a33aM
is_a33aO
xs_a33fp
r_a33fq)
(bound at Bug.hs:1321:41)
r_a33iK :: Sing [[a_a337f]] r_a33fq (bound at Bug.hs:1295:57)
xs_a33iJ :: Sing [a_a337f] xs_a33fp (bound at Bug.hs:1295:48)
lambda_a33iH :: Sing [a_a337f] xs_a33fp
-> Sing [[a_a337f]] r_a33fq
-> Sing
[[a_a337f]]
(Apply
[[a_a337f]]
[[a_a337f]]
(Apply
[a_a337f]
(TyFun [[a_a337f]] [[a_a337f]] -> *)
(Let6989586621679736980InterleaveSym4
[a_a337f]
[a_a337f]
a_a337f
xs0_a33a0
t_a33aL
ts_a33aM
is_a33aO)
arg_a33hh)
arg_a33hi)
(bound at Bug.hs:1295:35)
sR :: Sing [[a_a337f]] arg_a33hi (bound at Bug.hs:1287:45)
sXs :: Sing [a_a337f] arg_a33hh (bound at Bug.hs:1287:41)
sInterleave' :: forall (arg_a33he :: TyFun
[a_a337f] c69895866216793215480
-> *) (arg_a33hf :: [a_a337f]) (arg_a33hg :: [c69895866216793215480]).
Sing (TyFun [a_a337f] c69895866216793215480 -> *) arg_a33he
-> Sing [a_a337f] arg_a33hf
-> Sing [c69895866216793215480] arg_a33hg
-> Sing
([a_a337f], [c69895866216793215480])
(Apply
[c69895866216793215480]
([a_a337f], [c69895866216793215480])
(Apply
[a_a337f]
([c69895866216793215480] ~> ([a_a337f], [c69895866216793215480]))
(Apply
(TyFun [a_a337f] c69895866216793215480 -> *)
([a_a337f]
~> ([c69895866216793215480]
~> ([a_a337f], [c69895866216793215480])))
(Let6989586621679736980Interleave'Sym4
[a_a337f]
[a_a337f]
a_a337f
c69895866216793215480
xs0_a33a0
t_a33aL
ts_a33aM
is_a33aO)
arg_a33he)
arg_a33hf)
arg_a33hg)
(bound at Bug.hs:1166:29)
lambda_a33ha :: Sing a_a337f t_a33aL
-> Sing [a_a337f] ts_a33aM
-> Sing [a_a337f] is_a33aO
-> Sing
[[a_a337f]]
(Apply
[a_a337f]
[[a_a337f]]
(Apply
[a_a337f]
([a_a337f] ~> [[a_a337f]])
(Let6989586621679736931PermsSym1 a_a337f xs0_a33a0)
arg_a33h0)
arg_a33h1)
(bound at Bug.hs:1153:23)
sTs :: Sing [a_a337f] n_a1kQd (bound at Bug.hs:1143:34)
sT :: Sing a_a337f n_a1kQc (bound at Bug.hs:1143:31)
lambda_a33gY :: Sing [a_a337f] xs0_a33a0
-> Sing
[[a_a337f]]
(Apply [a_a337f] [[a_a337f]] (PermutationsSym0 a_a337f) t_a33gX)
(bound at Bug.hs:1127:11)
(Some bindings suppressed; use -fmax-relevant-binds=N or -fno-max-relevant-binds)
|
1328 | sInterleave'))
| ^^^^^^^^^^^^
```8.4.1https://gitlab.haskell.org/ghc/ghc/-/issues/13548the 'impossible' happened during building PureScript for profiling2019-07-07T18:21:23Zhdgarroodthe 'impossible' happened during building PureScript for profilingRepro steps:
- `git clone https://github.com/purescript/purescript`
- `cd purescript`
- `git checkout v0.11.2`
- `stack build --profile`
The error was:
```
[ 23 of 145] Compiling Language.PureScript.Constants ( src/Language/PureScript...Repro steps:
- `git clone https://github.com/purescript/purescript`
- `cd purescript`
- `git checkout v0.11.2`
- `stack build --profile`
The error was:
```
[ 23 of 145] Compiling Language.PureScript.Constants ( src/Language/PureScript/Constants.hs, .stack-work/dist/x86_64-linux/Cabal-1.24.2.0/build/Language/PureScript/Constants.p_o )
ghc: panic! (the 'impossible' happened)
(GHC version 8.0.2 for x86_64-unknown-linux):
kindPrimRep.go rep_sfuE
Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
-- While building package purescript-0.11.2 using:
/home/harry/.stack/setup-exe-cache/x86_64-linux/Cabal-simple_mPHDZzAJ_1.24.2.0_ghc-8.0.2 --builddir=.stack-work/dist/x86_64-linux/Cabal-1.24.2.0 build lib:purescript exe:purs --ghc-options " -ddump-hi -ddump-to-file"
Process exited with code: ExitFailure 1
```
Sorry that this is pretty much the complete opposite of a minimal reproducing example, but I have no clue how to go about isolating the part that's actually causing the problem.
<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":"the 'impossible' happened during building PureScript for profiling","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.0.2","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"Repro steps:\r\n\r\n* `git clone https://github.com/purescript/purescript`\r\n* `cd purescript`\r\n* `git checkout v0.11.2`\r\n* `stack build --profile`\r\n\r\nThe error was:\r\n\r\n{{{\r\n[ 23 of 145] Compiling Language.PureScript.Constants ( src/Language/PureScript/Constants.hs, .stack-work/dist/x86_64-linux/Cabal-1.24.2.0/build/Language/PureScript/Constants.p_o )\r\nghc: panic! (the 'impossible' happened)\r\n (GHC version 8.0.2 for x86_64-unknown-linux):\r\n kindPrimRep.go rep_sfuE\r\n\r\nPlease report this as a GHC bug: http://www.haskell.org/ghc/reportabug\r\n\r\n\r\n-- While building package purescript-0.11.2 using:\r\n /home/harry/.stack/setup-exe-cache/x86_64-linux/Cabal-simple_mPHDZzAJ_1.24.2.0_ghc-8.0.2 --builddir=.stack-work/dist/x86_64-linux/Cabal-1.24.2.0 build lib:purescript exe:purs --ghc-options \" -ddump-hi -ddump-to-file\"\r\n Process exited with code: ExitFailure 1\r\n}}}\r\n\r\nSorry that this is pretty much the complete opposite of a minimal reproducing example, but I have no clue how to go about isolating the part that's actually causing the problem.","type_of_failure":"OtherFailure","blocking":[]} -->https://gitlab.haskell.org/ghc/ghc/-/issues/13547Lint error in arrows program2020-11-14T10:00:44Zcipher1024Lint error in arrows programWhen building with `stack build --resolver lts-7.20`and `stack build --resolver lts-8.8`, i.e. with ghc-8.0.1 and ghc-8.0.2.
```
[37 of 60] Compiling Document.Phase.Proofs ( src/Document/Phase/Proofs.hs, .stack-work/dist/x86_64-osx/...When building with `stack build --resolver lts-7.20`and `stack build --resolver lts-8.8`, i.e. with ghc-8.0.1 and ghc-8.0.2.
```
[37 of 60] Compiling Document.Phase.Proofs ( src/Document/Phase/Proofs.hs, .stack-work/dist/x86_64-osx/Cabal-1.24.0.0/build/Document/Phase/Proofs.o )
<no location info>: error:
ghc: panic! (the 'impossible' happened)
(GHC version 8.0.1 for x86_64-apple-darwin):
StgCmmEnv: variable not found
$dTypeable_aZSM
local binds for:
$sunionWith_$sunionWithKey
$sfromList1
$sfromList3
$sfromList
$s$fOrdEither
$s$fMonadReaderrReaderT
$s$fIsTupleconstrIdentity
$s$fIsTupleconstr(,,,,)
$s$fIsTupleconstr(,,,)
$s$fIsTupleconstr(,,)
$s$fIsTupleconstr(,,)2
$s$fIsTupleconstr(,)1
$s$fIsTupleconstr(,)
$s$fIsTupleconstr(,)2
$s$fHasMachineP2p
$fNFDataEventRefA
$fMonoidEventRefA
$fGenericEventRefA
$wmake_phase4
make_phase1
$wpoly_go10
make_phase2
make_phase3
make_phase5
$fNFDataEventRefA4
$fNFDataEventRefA2
$stypeRep#78
$swithCommand8
$stypeRep#54
$swithCommand5
$stypeRep#11
$swithCommand2
$stypeRep#74
$stypeRep#81
$stypeRep#15
$stypeRep#20
$stypeRep#79
$stypeRep#80
$stypeRep#70
$stypeRep#75
$stypeRep#58
$stypeRep#66
$stypeRep#71
$stypeRep#62
$stypeRep#8
$stypeRep#67
$stypeRep#63
$stypeRep#59
$stypeRep#50
$stypeRep#55
$stypeRep#38
$stypeRep#46
$stypeRep#51
$stypeRep#42
$stypeRep#47
$stypeRep#43
$stypeRep#34
$stypeRep#39
$stypeRep#31
$stypeRep#35
$stypeRep#28
$stypeRep#24
$stypeRep#25
$stypeRep#21
$stypeRep#3
$stypeRep#16
$stypeRep#7
$stypeRep#12
$stypeRep#2
$smakeCell8
$smakeCell7
$smakeCell40
$smakeCell39
$smakeCell36
$smakeCell35
$smakeCell32
$smakeCell31
$smakeCell4
$smakeCell28
$smakeCell27
$smakeCell24
$smakeCell23
$smakeCell3
$smakeCell20
$smakeCell19
$smakeCell16
$smakeCell15
$smakeCell12
$smakeCell11
$wpoly_go5
$wgo5
$sfromList_go5
$wpoly_go2
$sfromList2
$s$fOrd(,)
$sfromList_fromList'1
$wpoly_go1
$s$fEqEither
$s$fOrdEither_$s$fOrdEither_$cp1Ord
$s$fEq(,)
$s$fOrd(,)_$s$fOrd(,)_$cp1Ord
$s$fMonadRWST
$s$fMonadReaderrReaderT1
$s$fMonadReaderT
$s$fApplicativeReaderT
$s$fMonadReaderT_$s$fMonadReaderT_$cfail
$s$fMonadReaderT_$s$fMonadReaderT_$c>>
$s$fMonadReaderT_$s$fMonadReaderT_$c>>=
$s$fMonadReaderT_$s$fMonadReaderT_$cp1Monad
$s$fMonadRWST_$s$fMonadRWST_$cfail
$s$fMonadRWST_$s$fMonadRWST_$c>>
$s$fMonadRWST_$s$fMonadRWST_$c>>=
$s$fMonadRWST_$s$fMonadRWST_$cp1Monad
$s$fIsTupleconstr(,,,,)_$s$fLatexArg[]
$s$fIsTupleconstr(,,,,)1
$s$fIsTupleconstr(,,,)_$s$fLatexArg[]
$s$fIsTupleconstr(,,,)_irred2
$s$fIsTupleconstr(,,)_$s$fLatexArg[]
$s$fIsTupleconstr(,,)_$dLatexArgFromString
$s$fIsTupleconstr(,,)_$s$fLatexArgFromStringConc
$s$fIsTupleconstr(,,)_irred1
$s$fIsTupleconstr(,,)_$s$fLatexArgNonEmpty
$s$fIsTupleconstr(,,)1
$s$fIsTupleconstr(,)3
$s$fHasMachineP1p
$s$fHasMachineP2p1
$s$fHasMachineP2p2
$s$fHasMachineP2p3
$s$fHasMachineP2p4
$s$fHasMachineP2p5
$s$fHasMachineP2p6
$s$fHasMachineP1p_$s$fHasMachineP1p_$cp5HasMachineP1
$s$fHasMachineP1p_$s$fHasMachineP1p_$cp4HasMachineP1
$s$fHasMachineP1p_$s$fHasMachineP1p_$cp3HasMachineP1
$s$fHasMachineP1p_$s$fHasMachineP1p_$cp2HasMachineP1
$s$fHasMachineP1p_$s$fHasMachineP1p_$cp1HasMachineP1
$s$fEq(,)_$dEq1
$s$fEq(,)_$dEq
$s$fApplicativeReaderT_$s$fFunctorReaderT_$c<$
$s$fApplicativeReaderT_$s$fFunctorReaderT_$cfmap
$s$fApplicativeReaderT_$s$fFunctorReaderT
$s$fApplicativeRWST
$s$fApplicativeReaderT_$dApplicative
$s$fApplicativeReaderT_$s$fApplicativeReaderT_$c<*>
$s$fApplicativeReaderT_$s$fMonadReaderT_$creturn
$s$fApplicativeReaderT_$s$fApplicativeReaderT_$cp1Applicative
$s$fApplicativeRWST_$dFunctor
$s$fApplicativeRWST_$s$fApplicativeRWST_$c<*>
$s$fApplicativeRWST_$s$fApplicativeRWST_$cpure
$s$fApplicativeRWST_$s$fApplicativeRWST_$cp1Applicative
$fNFDataEventRefA1
$fNFDataEventRefA3
$w$dNFData2
$w$dNFData1
$w$dNFData
$fNFDataEventRefA_$crnf
$wgo
$fMonoidEventRefA_$cmconcat
$fMonoidEventRefA_$cmappend
$fMonoidEventRefA_$cmempty
$fGenericEventRefA_$cto
$fGenericEventRefA_$cfrom
make_phase4
ruleProxies_rSKY
refinement_parser_rSL2
$w$smiddle
$w$sgreater
$sfilterGt1
$sfilterLt1
$sinsert_$sgo10
$sinsert_$sgo5
$sleadsTo1
$wpoly_go3
$wpoly_go4
$slookup5
$slookup7
$smakeCell2
$smakeCell6
$smakeCell10
$smakeCell14
$smakeCell18
$smakeCell22
$smakeCell26
$smakeCell30
$smakeCell34
$smakeCell38
$wpoly_go6
$wpoly_go7
$wpoly_go8
$sshowStringP1
$strim1
$strim3
$sunions1
$sunless_eta
$swithCommand1
$swithCommand4
$swithCommand7
lvl_r2714
lvl1_r2715
go_r2716
$wgo1_r2717
lvl2_r2718
lvl3_r2719
lvl4_r271a
lvl5_r271b
lvl6_r271c
lvl7_r271d
lvl8_r271e
lvl9_r271f
lvl10_r271g
lvl11_r271h
lvl12_r271i
lvl13_r271j
lvl14_r271k
lvl15_r271l
lvl16_r271m
lvl17_r271n
lvl18_r271o
lvl19_r271p
lvl20_r271q
lvl21_r271r
lvl22_r271s
lvl23_r271t
lvl24_r271u
lvl25_r271v
lvl26_r271w
lvl27_r271x
lvl28_r271y
lvl29_r271z
lvl30_r271A
lvl31_r271B
lvl32_r271C
lvl33_r271D
lvl34_r271E
lvl35_r271F
lvl36_r271G
lvl37_r271H
lvl38_r271I
lvl39_r271J
lvl40_r271K
lvl49_r2723
lvl50_r2724
lvl51_r2725
lvl52_r2726
lvl53_r2727
lvl54_r2728
lvl55_r2729
lvl56_r272a
lvl57_r272b
lvl58_r272c
lvl59_r272d
lvl60_r272e
lvl61_r272f
lvl62_r272g
lvl63_r272h
lvl64_r272i
lvl65_r272j
lvl66_r272k
lvl67_r272l
lvl68_r272m
lvl69_r272n
lvl70_r272o
lvl71_r272p
lvl72_r272q
$s$fApplicativeRWST_$c<*>_r272u
$s$fApplicativeRWST_$cpure_r272v
lvl74_r272w
lvl75_r272x
lvl76_r272y
$s$fMonadRWST_$c>>_r272z
$s$fMonadRWST_$cfail_r272A
$s$fMonadRWST_$c>>=_r272B
lvl77_r272C
lvl78_r272D
lvl79_r272E
lvl80_r272F
lvl81_r272G
lvl82_r272H
$slesser1_r272S
lvl88_r272T
lvl89_r272U
$wcreate_r272V
lvl90_r272W
m2_r272X
$s$fMonadReaderT_$c>>_r272Y
$s$fMonadReaderT_$c>>=_r272Z
go10_r2730
$wpoly_create_r2731
lvl91_r2732
lvl92_r2733
lvl93_r2734
lvl94_r2735
lvl95_r2736
lvl96_r2737
lvl97_r2738
lvl98_r2739
lvl99_r273a
lvl100_r273b
lvl101_r273c
lvl102_r273d
lvl103_r273e
lvl104_r273f
lvl105_r273g
lvl106_r273h
lvl107_r273i
lvl108_r273j
lvl109_r273k
lvl110_r273l
lvl111_r273m
lvl112_r273n
lvl113_r273o
lvl114_r273p
lvl115_r273q
lvl116_r273r
lvl117_r273s
lvl118_r273t
lvl119_r273u
lvl120_r273v
lvl121_r273w
lvl122_r273x
lvl123_r273y
lvl124_r273z
$wpoly_create1_r273A
lvl125_r273B
lvl126_r273C
lvl127_r273D
lvl128_r273E
lvl129_r273F
lvl130_r273G
lvl131_r273H
lvl132_r273I
lvl133_r273J
lvl134_r273K
lvl135_r273L
$wlvl_r273M
lvl136_r273N
$wlvl1_r273O
lvl137_r273P
$wlvl2_r273Q
lvl138_r273R
$wlvl3_r273S
lvl139_r273T
$wlvl4_r273U
lvl140_r273V
$wlvl5_r273W
lvl141_r273X
$wlvl6_r273Y
lvl142_r273Z
lvl143_r2740
lvl144_r2741
lvl145_r2742
lvl146_r2743
lvl147_r2744
lvl148_r2745
lvl149_r2746
lvl150_r2747
lvl151_r2748
lvl152_r2749
lvl153_r274a
lvl154_r274b
$s$fFunctorReaderT_$cfmap_r274c
$s$fFunctorReaderT_$c<$_r274d
lvl155_r274e
lvl156_r274f
$s$fApplicativeReaderT_$c<*>_r274g
$s$fMonadReaderT_$creturn_r274h
$s$fMonadReaderT_$cfail_r274i
lvl157_r274j
lvl158_r274k
lvl159_r274l
lvl160_r274m
$d~_r274n
lvl161_r274p
lvl162_r274q
lvl163_r274s
lvl164_r274t
lvl165_r274v
lvl166_r274w
lvl167_r274y
lvl168_r274z
lvl169_r274B
lvl170_r274C
lvl171_r274E
lvl172_r274F
lvl173_r274H
lvl174_r274I
lvl175_r274K
lvl176_r274L
lvl177_r274N
lvl178_r274O
lvl179_r274Q
lvl180_r274R
lvl181_r274T
lvl182_r274U
lvl183_r274V
lvl184_r274W
lvl185_r274X
lvl186_r274Y
lvl187_r274Z
lvl188_r2750
lvl189_r2751
lvl190_r2752
lvl191_r2753
lvl192_r2754
lvl193_r2755
lvl194_r2756
lvl195_r2757
lvl196_r2758
lvl197_r2759
lvl198_r275a
lvl199_r275b
lvl200_r275c
lvl201_r275d
lvl202_r275e
lvl203_r275f
lvl204_r275g
lvl205_r275h
lvl206_r275i
lvl207_r275j
lvl208_r275k
lvl209_r275l
lvl210_r275m
lvl211_r275n
lvl212_r275o
lvl213_r275p
lvl214_r275q
lvl215_r275r
lvl216_r275s
lvl217_r275t
lvl218_r275u
lvl219_r275v
lvl220_r275w
ww1_r275x
ww2_r275y
lvl221_r275z
ww3_r275A
lvl222_r275B
pre_r275C
x_s27MP
eta_s27MQ
eta1_s27MR
ds_s27MS
ds1_s27MT
ds2_s27MU
ds3_s27MV
goal_s27MW
prxy'_s27MX
sat_s27MY
Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
```https://gitlab.haskell.org/ghc/ghc/-/issues/13546Kind error with type equality2019-07-07T18:21:24ZVladislav ZavialovKind error with type equalityThis code
```hs
{-# LANGUAGE TypeInType, TypeFamilies, GADTs, ConstraintKinds #-}
import Data.Kind
data Dict c where
Dict :: c => Dict c
data T (t :: k)
type family UnT (a :: Type) :: k where
UnT (T t) = t
untt :: Dict (UnT (T ...This code
```hs
{-# LANGUAGE TypeInType, TypeFamilies, GADTs, ConstraintKinds #-}
import Data.Kind
data Dict c where
Dict :: c => Dict c
data T (t :: k)
type family UnT (a :: Type) :: k where
UnT (T t) = t
untt :: Dict (UnT (T "a") ~ "a")
untt = Dict
tunt :: Dict (T (UnT (T "a")) ~ T "a")
tunt = Dict
```
fails with this error:
```
tunt.hs:17:8: error:
• Couldn't match kind ‘k’ with ‘GHC.Types.Symbol’
‘k’ is a rigid type variable bound by
the type signature for:
tunt :: forall k. Dict T (UnT (T "a")) ~ T "a"
at tunt.hs:16:1-38
When matching types
UnT (T "a") :: k
"a" :: GHC.Types.Symbol
• In the expression: Dict
In an equation for ‘tunt’: tunt = Dict
• Relevant bindings include
tunt :: Dict T (UnT (T "a")) ~ T "a" (bound at tunt.hs:17:1)
|
17 | tunt = Dict
|
```
Instead I would expect these reductions to take place:
```
1. T (UnT (T "a")) ~ T "a"
2. T "a" ~ T "a"
3. constraint satisfied (refl)
```
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ----------------------- |
| Version | 8.0.1 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler (Type checker) |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | goldfire |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"Kind error with type equality","status":"New","operating_system":"","component":"Compiler (Type checker)","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.0.1","keywords":["TypeInType"],"differentials":[],"test_case":"","architecture":"","cc":["goldfire"],"type":"Bug","description":"This code\r\n\r\n{{{#!hs\r\n{-# LANGUAGE TypeInType, TypeFamilies, GADTs, ConstraintKinds #-}\r\n\r\nimport Data.Kind\r\n\r\ndata Dict c where\r\n Dict :: c => Dict c\r\n\r\ndata T (t :: k)\r\n\r\ntype family UnT (a :: Type) :: k where\r\n UnT (T t) = t\r\n\r\nuntt :: Dict (UnT (T \"a\") ~ \"a\")\r\nuntt = Dict\r\n\r\ntunt :: Dict (T (UnT (T \"a\")) ~ T \"a\")\r\ntunt = Dict\r\n}}}\r\n\r\nfails with this error:\r\n\r\n{{{\r\ntunt.hs:17:8: error:\r\n • Couldn't match kind ‘k’ with ‘GHC.Types.Symbol’\r\n ‘k’ is a rigid type variable bound by\r\n the type signature for:\r\n tunt :: forall k. Dict T (UnT (T \"a\")) ~ T \"a\"\r\n at tunt.hs:16:1-38\r\n When matching types\r\n UnT (T \"a\") :: k\r\n \"a\" :: GHC.Types.Symbol\r\n • In the expression: Dict\r\n In an equation for ‘tunt’: tunt = Dict\r\n • Relevant bindings include\r\n tunt :: Dict T (UnT (T \"a\")) ~ T \"a\" (bound at tunt.hs:17:1)\r\n |\r\n17 | tunt = Dict\r\n | \r\n}}}\r\n\r\nInstead I would expect these reductions to take place:\r\n\r\n{{{\r\n 1. T (UnT (T \"a\")) ~ T \"a\"\r\n 2. T \"a\" ~ T \"a\"\r\n 3. constraint satisfied (refl)\r\n}}}","type_of_failure":"OtherFailure","blocking":[]} -->https://gitlab.haskell.org/ghc/ghc/-/issues/13545Remove duplication between lookupSubBndrOcc and lookupExportChild2019-07-07T18:21:24ZMatthew PickeringRemove duplication between lookupSubBndrOcc and lookupExportChild`lookupSubBndrOcc` is used in expressions such as `x { y = 5 }` to resolve field labels such as `y`.
`lookupExportChild` is used in export lists such as `T(A, x)` to lookup `A` and `x`.
They contain very similar logic but it is duplica...`lookupSubBndrOcc` is used in expressions such as `x { y = 5 }` to resolve field labels such as `y`.
`lookupExportChild` is used in export lists such as `T(A, x)` to lookup `A` and `x`.
They contain very similar logic but it is duplicated in two places which caused #13528.
It should be easy to refactor them them to deduplicate the logic.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 8.0.1 |
| Type | Task |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"Remove duplication between lookupSubBndrOcc and lookupExportChild","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.0.1","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Task","description":"`lookupSubBndrOcc` is used in expressions such as `x { y = 5 }` to resolve field labels such as `y`. \r\n\r\n`lookupExportChild` is used in export lists such as `T(A, x)` to lookup `A` and `x`. \r\n\r\nThey contain very similar logic but it is duplicated in two places which caused #13528.\r\n\r\nIt should be easy to refactor them them to deduplicate the logic.","type_of_failure":"OtherFailure","blocking":[]} -->8.4.1Matthew PickeringMatthew Pickeringhttps://gitlab.haskell.org/ghc/ghc/-/issues/13544ghc panic2019-07-07T18:21:24Zshauryab98ghc panicI got this error:
```
ghc: panic! (the 'impossible' happened)
(GHC version 8.0.2 for x86_64-unknown-mingw32):
initTc: unsolved constraints
WC {wc_insol = [W] %_a1El :: t_a1Ek[tau:1] (CHoleCan: %)}
```
while compiling the fo...I got this error:
```
ghc: panic! (the 'impossible' happened)
(GHC version 8.0.2 for x86_64-unknown-mingw32):
initTc: unsolved constraints
WC {wc_insol = [W] %_a1El :: t_a1Ek[tau:1] (CHoleCan: %)}
```
while compiling the following code
```hs
halveEvens :: [Integer] -> [Integer]
halveEvens = map . filter (\c -> c%2 == 0)
```
<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","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.0.2","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"I got this error:\r\n\r\n{{{\r\nghc: panic! (the 'impossible' happened)\r\n (GHC version 8.0.2 for x86_64-unknown-mingw32):\r\n initTc: unsolved constraints\r\n WC {wc_insol = [W] %_a1El :: t_a1Ek[tau:1] (CHoleCan: %)}\r\n}}}\r\n\r\nwhile compiling the following code\r\n{{{#!hs\r\nhalveEvens :: [Integer] -> [Integer]\r\nhalveEvens = map . filter (\\c -> c%2 == 0)\r\n}}}\r\n\r\n\r\n","type_of_failure":"OtherFailure","blocking":[]} -->https://gitlab.haskell.org/ghc/ghc/-/issues/13543Improve demand analysis for join points2019-07-07T18:21:25ZSimon Peyton JonesImprove demand analysis for join pointsConsider
```
g :: (Int,Int) -> Int
g (p,q) = p+q
f :: Int -> Int -> Int
f x p = g (join j y = (p,y)
in case x of
True -> j 3
False -> j 4)
```
If `j` was a vanilla funct...Consider
```
g :: (Int,Int) -> Int
g (p,q) = p+q
f :: Int -> Int -> Int
f x p = g (join j y = (p,y)
in case x of
True -> j 3
False -> j 4)
```
If `j` was a vanilla function definition, we'd analyse its body with
`evalDmd`, and think that it was lazy in `p`.
But for a join point we can do better. We know that
`j`'s body (if evaluated at all) will be evaluated with the demand that consumes the entire
join-binding, in this case the argument demand from `g`. Whizzo! `g`
evaluates both components of its arugment pair, so j is strict in `p`.
So, when analysing a join point, we can analyse its body with the
demand from the entire join-binding. Another
win for join points!
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 8.0.1 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"Improve demand analysis for join points","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.0.1","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"Consider\r\n{{{\r\n g :: (Int,Int) -> Int\r\n g (p,q) = p+q\r\n\r\n f :: Int -> Int -> Int\r\n f x p = g (join j y = (p,y)\r\n in case x of\r\n True -> j 3\r\n False -> j 4)\r\n}}}\r\nIf `j` was a vanilla function definition, we'd analyse its body with\r\n`evalDmd`, and think that it was lazy in `p`. \r\n\r\nBut for a join point we can do better. We know that\r\n`j`'s body (if evaluated at all) will be evaluated with the demand that consumes the entire\r\njoin-binding, in this case the argument demand from `g`. Whizzo! `g`\r\nevaluates both components of its arugment pair, so j is strict in `p`.\r\n\r\nSo, when analysing a join point, we can analyse its body with the\r\ndemand from the entire join-binding. Another\r\nwin for join points!\r\n","type_of_failure":"OtherFailure","blocking":[]} -->https://gitlab.haskell.org/ghc/ghc/-/issues/13542Solaris build fails with collect2: execv: Arg list too long2023-05-25T22:35:37ZkgardasSolaris build fails with collect2: execv: Arg list too longIt looks like HEAD build is broken on Solaris and Solaris-derived OSes. It fails with:
```
gmake --no-print-directory -f ghc.mk phase=final all
"inplace/bin/ghc-stage1" -hisuf hi -osuf o -hcsuf hc -static -H32m -O -Wall -this-uni...It looks like HEAD build is broken on Solaris and Solaris-derived OSes. It fails with:
```
gmake --no-print-directory -f ghc.mk phase=final all
"inplace/bin/ghc-stage1" -hisuf hi -osuf o -hcsuf hc -static -H32m -O -Wall -this-unit-id ghc-prim-0.5.0.0 -hide-all-packages -i -ilibraries/ghc-prim/. -ilibraries/ghc-prim/dist-install/build -Ilibraries/ghc-prim/dist-install/build -ilibraries/ghc-prim/dist-install/build/./autogen -Ilibraries/ghc-prim/dist-install/build/./autogen -Ilibraries/ghc-prim/. -optP-include -optPlibraries/ghc-prim/dist-install/build/./autogen/cabal_macros.h -package-id rts -this-unit-id ghc-prim -XHaskell2010 -O2 -no-user-package-db -rtsopts -Wno-trustworthy-safe -Wno-deprecated-flags -Wnoncanonical-monad-instances -odir libraries/ghc-prim/dist-install/build -hidir libraries/ghc-prim/dist-install/build -stubdir libraries/ghc-prim/dist-install/build -split-objs -dynamic-too -c libraries/ghc-prim/./GHC/Types.hs -o libraries/ghc-prim/dist-install/build/GHC/Types.o -dyno libraries/ghc-prim/dist-install/build/GHC/Types.dyn_o
gcc: error trying to exec '/usr/gcc/4.8/lib/gcc/i386-pc-solaris2.11/4.8.2/collect2': execv: Arg list too long
`gcc' failed in phase `Linker'. (Exit code: 1)
gmake[1]: *** [libraries/ghc-prim/dist-install/build/GHC/Types.o] Error 1
gmake: *** [all] Error 2
```
on Solaris 11.2 and with:
```
"inplace/bin/ghc-stage1" -hisuf hi -osuf o -hcsuf hc -static -H32m -O -Wall -this-unit-id ghc-prim-0.5.0.0 -hide-all-packages -i -ilibraries/ghc-prim/. -ilibraries/ghc-prim/dist-install/build -Ilibraries/ghc-prim/dist-install/build -ilibraries/ghc-prim/dist-install/build/./autogen -Ilibraries/ghc-prim/dist-install/build/./autogen -Ilibraries/ghc-prim/. -optP-include -optPlibraries/ghc-prim/dist-install/build/./autogen/cabal_macros.h -package-id rts -this-unit-id ghc-prim -XHaskell2010 -O2 -no-user-package-db -rtsopts -Wno-trustworthy-safe -Wno-deprecated-flags -Wnoncanonical-monad-instances -odir libraries/ghc-prim/dist-install/build -hidir libraries/ghc-prim/dist-install/build -stubdir libraries/ghc-prim/dist-install/build -split-objs -dynamic-too -c libraries/ghc-prim/./GHC/Types.hs -o libraries/ghc-prim/dist-install/build/GHC/Types.o -dyno libraries/ghc-prim/dist-install/build/GHC/Types.dyn_o
gcc: error trying to exec '/opt/local/gcc47/libexec/gcc/i486-sun-solaris2.11/4.7.4/collect2': execv: Arg list too long
`gcc' failed in phase `Linker'. (Exit code: 1)
libraries/ghc-prim/ghc.mk:4: recipe for target 'libraries/ghc-prim/dist-install/build/GHC/Types.o' failed
gmake[1]: *** [libraries/ghc-prim/dist-install/build/GHC/Types.o] Error 1
Makefile:122: recipe for target 'all' failed
gmake: *** [all] Error 2
```
on SmartOS.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 8.1 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"Solaris build fails with collect2: execv: Arg list too long","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.1","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"It looks like HEAD build is broken on Solaris and Solaris-derived OSes. It fails with:\r\n{{{\r\ngmake --no-print-directory -f ghc.mk phase=final all\r\n\"inplace/bin/ghc-stage1\" -hisuf hi -osuf o -hcsuf hc -static -H32m -O -Wall -this-unit-id ghc-prim-0.5.0.0 -hide-all-packages -i -ilibraries/ghc-prim/. -ilibraries/ghc-prim/dist-install/build -Ilibraries/ghc-prim/dist-install/build -ilibraries/ghc-prim/dist-install/build/./autogen -Ilibraries/ghc-prim/dist-install/build/./autogen -Ilibraries/ghc-prim/. -optP-include -optPlibraries/ghc-prim/dist-install/build/./autogen/cabal_macros.h -package-id rts -this-unit-id ghc-prim -XHaskell2010 -O2 -no-user-package-db -rtsopts -Wno-trustworthy-safe -Wno-deprecated-flags -Wnoncanonical-monad-instances -odir libraries/ghc-prim/dist-install/build -hidir libraries/ghc-prim/dist-install/build -stubdir libraries/ghc-prim/dist-install/build -split-objs -dynamic-too -c libraries/ghc-prim/./GHC/Types.hs -o libraries/ghc-prim/dist-install/build/GHC/Types.o -dyno libraries/ghc-prim/dist-install/build/GHC/Types.dyn_o\r\ngcc: error trying to exec '/usr/gcc/4.8/lib/gcc/i386-pc-solaris2.11/4.8.2/collect2': execv: Arg list too long\r\n`gcc' failed in phase `Linker'. (Exit code: 1)\r\ngmake[1]: *** [libraries/ghc-prim/dist-install/build/GHC/Types.o] Error 1\r\ngmake: *** [all] Error 2\r\n}}}\r\n\r\non Solaris 11.2 and with:\r\n\r\n{{{\r\n\"inplace/bin/ghc-stage1\" -hisuf hi -osuf o -hcsuf hc -static -H32m -O -Wall -this-unit-id ghc-prim-0.5.0.0 -hide-all-packages -i -ilibraries/ghc-prim/. -ilibraries/ghc-prim/dist-install/build -Ilibraries/ghc-prim/dist-install/build -ilibraries/ghc-prim/dist-install/build/./autogen -Ilibraries/ghc-prim/dist-install/build/./autogen -Ilibraries/ghc-prim/. -optP-include -optPlibraries/ghc-prim/dist-install/build/./autogen/cabal_macros.h -package-id rts -this-unit-id ghc-prim -XHaskell2010 -O2 -no-user-package-db -rtsopts -Wno-trustworthy-safe -Wno-deprecated-flags -Wnoncanonical-monad-instances -odir libraries/ghc-prim/dist-install/build -hidir libraries/ghc-prim/dist-install/build -stubdir libraries/ghc-prim/dist-install/build -split-objs -dynamic-too -c libraries/ghc-prim/./GHC/Types.hs -o libraries/ghc-prim/dist-install/build/GHC/Types.o -dyno libraries/ghc-prim/dist-install/build/GHC/Types.dyn_o\r\ngcc: error trying to exec '/opt/local/gcc47/libexec/gcc/i486-sun-solaris2.11/4.7.4/collect2': execv: Arg list too long\r\n`gcc' failed in phase `Linker'. (Exit code: 1)\r\nlibraries/ghc-prim/ghc.mk:4: recipe for target 'libraries/ghc-prim/dist-install/build/GHC/Types.o' failed\r\ngmake[1]: *** [libraries/ghc-prim/dist-install/build/GHC/Types.o] Error 1\r\nMakefile:122: recipe for target 'all' failed\r\ngmake: *** [all] Error 2\r\n}}}\r\n\r\non SmartOS.\r\n","type_of_failure":"OtherFailure","blocking":[]} -->https://gitlab.haskell.org/ghc/ghc/-/issues/13541Make it easier to use the gold linker2020-02-17T10:21:32ZBen GamariMake it easier to use the gold linkerAs pointed out in #4862, the `gold` linker is significantly faster than BFD `ld`. Currently we use whatever linker `gcc` uses by default. This is an unfortunate situation for users as few packagers take the effort to configure their buil...As pointed out in #4862, the `gold` linker is significantly faster than BFD `ld`. Currently we use whatever linker `gcc` uses by default. This is an unfortunate situation for users as few packagers take the effort to configure their builds to use `gold`.
I think we should consider the following,
> Introduce a configure flag (to both the source distribution, and the distributed binary distributions), `--enable-gold`. When enabled, `configure` will check for the functioning of `gcc -fuse-ld=gold`. If found to work `-fuse-ld=gold` would be added to GHC's `optlc`. The flag would throw an error on non-ELF platforms (which are not supported by `gold`).
While there is admittedly not a whole lot of precedent for this, the status quo means we are leaving a significant bit of compiler performance on the table in a majority of cases. Given that `stack` uses GHC's official bindists, we should try to improve this situation.
In fact, I would even weakly suggest that we might consider enabling `--enable-gold` the default behavior, requiring the user to explicitly pass `--disable-gold` if they want the current behavior.8.2.1Ben GamariBen Gamarihttps://gitlab.haskell.org/ghc/ghc/-/issues/13540Enable -msse2 by default on i3862019-07-07T18:21:25ZBen GamariEnable -msse2 by default on i386SSE2 has been around for nearly 15 years now and at this point it is supported nearly universally. Currently we pass `-msse2` to numerically-sensitive testsuite tests since x87 is too imprecise.
<details><summary>Trac metadata</summary>...SSE2 has been around for nearly 15 years now and at this point it is supported nearly universally. Currently we pass `-msse2` to numerically-sensitive testsuite tests since x87 is too imprecise.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 8.0.1 |
| Type | Task |
| TypeOfFailure | OtherFailure |
| Priority | high |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"Enable -msse2 by default on i386","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"8.4.1","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.0.1","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Task","description":"SSE2 has been around for nearly 15 years now and at this point it is supported nearly universally. Currently we pass `-msse2` to numerically-sensitive testsuite tests since x87 is too imprecise. ","type_of_failure":"OtherFailure","blocking":[]} -->8.4.1Ben GamariBen Gamarihttps://gitlab.haskell.org/ghc/ghc/-/issues/13539Options -pgmlclang and -pgmlc overlap2019-07-07T18:21:26ZNiklas Hambüchenmail@nh2.meOptions -pgmlclang and -pgmlc overlapI tried to tell GHC to use `clang` with `-pgmlclang`, and only after some time found out that it won't work, because GHC interprets that as `-pgmlc` `lang` (surprise, `-pgmlc` is also an option).
The user manual suggests that `pgmc<valu...I tried to tell GHC to use `clang` with `-pgmlclang`, and only after some time found out that it won't work, because GHC interprets that as `-pgmlc` `lang` (surprise, `-pgmlc` is also an option).
The user manual suggests that `pgmc<value>` (without space) is the recommended syntax. If spaces are in fact allowed, we should change the manual.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------- |
| Version | 8.0.2 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Documentation |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | nh2 |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"Options -pgmlclang and -pgmlc overlap","status":"New","operating_system":"","component":"Documentation","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.0.2","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":["nh2"],"type":"Bug","description":"I tried to tell GHC to use `clang` with `-pgmlclang`, and only after some time found out that it won't work, because GHC interprets that as `-pgmlc` `lang` (surprise, `-pgmlc` is also an option).\r\n\r\nThe user manual suggests that `pgmc<value>` (without space) is the recommended syntax. If spaces are in fact allowed, we should change the manual.","type_of_failure":"OtherFailure","blocking":[]} -->https://gitlab.haskell.org/ghc/ghc/-/issues/13538Weird kind inference problems with closed type families2019-07-07T18:21:26ZArtem ChirkinWeird kind inference problems with closed type familiesConsider a problem of injective cons on a type-level list [https://ghc.haskell.org/trac/ghc/ticket/12114](https://ghc.haskell.org/trac/ghc/ticket/12114). I made a small workaround by adding an intermediate data type `List1 k`. Here is my...Consider a problem of injective cons on a type-level list [https://ghc.haskell.org/trac/ghc/ticket/12114](https://ghc.haskell.org/trac/ghc/ticket/12114). I made a small workaround by adding an intermediate data type `List1 k`. Here is my code:
```hs
{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE TypeFamilies, TypeFamilyDependencies #-}
{-# LANGUAGE KindSignatures, DataKinds, PolyKinds #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE TypeApplications #-}
module TFTest where
import GHC.TypeLits
import Data.Proxy
-- | Synonym for a type-level snoc (injective!)
type (ns :: [k]) +: (n :: k) = GetList1 (SinkFirst (n ': ns))
infixl 5 +:
-- | A weird data type used to make `(+:)` operation injective.
-- `List k [k]` must have at least two elements.
data List1 k = L1Single k | L1Head k [k]
-- | Sink first element of a list to the end of the list
type family SinkFirst (xs :: [k]) = (ys :: List1 k) | ys -> xs where
SinkFirst '[y] = 'L1Single y
-- SinkFirst (y ': x ': xs :: [Nat])
-- = ('L1Head x (GetList1Nat (SinkFirst (y ': xs))) :: List1 Nat)
SinkFirst (y ': x ': xs :: [k])
= ('L1Head x (GetList1 (SinkFirst (y ': xs))) :: List1 k)
type family GetList1 (ts :: List1 k) = (rs :: [k]) | rs -> ts where
GetList1 ('L1Single x) = '[x]
GetList1 ('L1Head y (x ':xs)) = y ': x ': xs
type family GetList1Nat (ts :: List1 Nat) = (rs :: [Nat]) | rs -> ts where
GetList1Nat ('L1Single x) = '[x]
GetList1Nat ('L1Head y (x ': xs)) = y ': x ': xs
type family (++) (as :: [k]) (bs :: [k]) :: [k] where
'[] ++ bs = bs
(a ': as) ++ bs = a ': (as ++ bs)
ff :: Proxy k -> Proxy (as +: k) -> Proxy (k ': bs) -> Proxy (as ++ bs)
ff _ _ _ = Proxy
yy :: Proxy '[3,7,2]
yy = ff (Proxy @5) (Proxy @'[3,7,5]) (Proxy @'[5,2])
```
This gives me the following error:
```
~/TFTest.hs: 47, 21
• Couldn't match kind ‘k’ with ‘Nat’
When matching the kind of ‘7 : xs’
Expected type: Proxy ((3 : (7 : xs)) +: 5)
Actual type: Proxy '[3, 7, 5]
• In the second argument of ‘ff’, namely ‘(Proxy @'[3, 7, 5])’
In the expression:
ff (Proxy @5) (Proxy @'[3, 7, 5]) (Proxy @'[5, 2])
In an equation for ‘yy’:
yy = ff (Proxy @5) (Proxy @'[3, 7, 5]) (Proxy @'[5, 2])
```
However, if I uncomment lines `26-27`, the code works perfectly fine!
This behaviour feels like a bug in type checker, though I am not sure.
If it is not, please, explain me what happens here? :)
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ----------------------- |
| Version | 8.0.2 |
| 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":"Weird kind inference problems with closed type families","status":"New","operating_system":"","component":"Compiler (Type checker)","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.0.2","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"Consider a problem of injective cons on a type-level list [https://ghc.haskell.org/trac/ghc/ticket/12114]. I made a small workaround by adding an intermediate data type `List1 k`. Here is my code:\r\n{{{#!hs\r\n{-# LANGUAGE UndecidableInstances #-}\r\n{-# LANGUAGE TypeFamilies, TypeFamilyDependencies #-}\r\n{-# LANGUAGE KindSignatures, DataKinds, PolyKinds #-}\r\n{-# LANGUAGE TypeOperators #-}\r\n{-# LANGUAGE TypeApplications #-}\r\nmodule TFTest where\r\n\r\nimport GHC.TypeLits\r\nimport Data.Proxy\r\n\r\n\r\n\r\n-- | Synonym for a type-level snoc (injective!)\r\ntype (ns :: [k]) +: (n :: k) = GetList1 (SinkFirst (n ': ns))\r\ninfixl 5 +:\r\n\r\n\r\n\r\n-- | A weird data type used to make `(+:)` operation injective.\r\n-- `List k [k]` must have at least two elements.\r\ndata List1 k = L1Single k | L1Head k [k]\r\n\r\n-- | Sink first element of a list to the end of the list\r\ntype family SinkFirst (xs :: [k]) = (ys :: List1 k) | ys -> xs where\r\n SinkFirst '[y] = 'L1Single y\r\n -- SinkFirst (y ': x ': xs :: [Nat])\r\n -- = ('L1Head x (GetList1Nat (SinkFirst (y ': xs))) :: List1 Nat)\r\n SinkFirst (y ': x ': xs :: [k])\r\n = ('L1Head x (GetList1 (SinkFirst (y ': xs))) :: List1 k)\r\n\r\ntype family GetList1 (ts :: List1 k) = (rs :: [k]) | rs -> ts where\r\n GetList1 ('L1Single x) = '[x]\r\n GetList1 ('L1Head y (x ':xs)) = y ': x ': xs\r\ntype family GetList1Nat (ts :: List1 Nat) = (rs :: [Nat]) | rs -> ts where\r\n GetList1Nat ('L1Single x) = '[x]\r\n GetList1Nat ('L1Head y (x ': xs)) = y ': x ': xs\r\n\r\ntype family (++) (as :: [k]) (bs :: [k]) :: [k] where\r\n '[] ++ bs = bs\r\n (a ': as) ++ bs = a ': (as ++ bs)\r\n\r\n\r\nff :: Proxy k -> Proxy (as +: k) -> Proxy (k ': bs) -> Proxy (as ++ bs)\r\nff _ _ _ = Proxy\r\n\r\nyy :: Proxy '[3,7,2]\r\nyy = ff (Proxy @5) (Proxy @'[3,7,5]) (Proxy @'[5,2])\r\n}}}\r\n\r\nThis gives me the following error:\r\n{{{\r\n~/TFTest.hs: 47, 21\r\n• Couldn't match kind ‘k’ with ‘Nat’\r\n When matching the kind of ‘7 : xs’\r\n Expected type: Proxy ((3 : (7 : xs)) +: 5)\r\n Actual type: Proxy '[3, 7, 5]\r\n• In the second argument of ‘ff’, namely ‘(Proxy @'[3, 7, 5])’\r\n In the expression:\r\n ff (Proxy @5) (Proxy @'[3, 7, 5]) (Proxy @'[5, 2])\r\n In an equation for ‘yy’:\r\n yy = ff (Proxy @5) (Proxy @'[3, 7, 5]) (Proxy @'[5, 2])\r\n}}}\r\n\r\nHowever, if I uncomment lines `26-27`, the code works perfectly fine!\r\n\r\nThis behaviour feels like a bug in type checker, though I am not sure.\r\nIf it is not, please, explain me what happens here? :) \r\n","type_of_failure":"OtherFailure","blocking":[]} -->8.2.1https://gitlab.haskell.org/ghc/ghc/-/issues/13537Adding underscore (m :: _) to pattern variable makes it fail2019-07-07T18:21:26ZIcelandjackAdding underscore (m :: _) to pattern variable makes it failThis works fine
```hs
{-# Language RankNTypes, TypeOperators, KindSignatures, GADTs, ScopedTypeVariables, PolyKinds #-}
import Data.Kind
data CodTy :: (k -> Type) -> Type where
CodTy :: { runCodTy :: (forall r. (f ty -> r) -> r) } -...This works fine
```hs
{-# Language RankNTypes, TypeOperators, KindSignatures, GADTs, ScopedTypeVariables, PolyKinds #-}
import Data.Kind
data CodTy :: (k -> Type) -> Type where
CodTy :: { runCodTy :: (forall r. (f ty -> r) -> r) } -> CodTy f
type f ~> g = forall xx. f xx -> g xx
fmap' :: (f ~> f') -> (CodTy f -> CodTy f')
fmap' f (CodTy m) = CodTy $ \ c -> m (c . f)
```
but adding
```hs
fmap' f (CodTy (m :: _)) = CodTy $ \ c -> m (c . f)
```
makes it fail (also fails without `PolyKinds`)
```
$ ghci -ignore-dot-ghci tNT2.hs
GHCi, version 8.0.1: http://www.haskell.org/ghc/ :? for help
[1 of 1] Compiling Main ( tNT2.hs, interpreted )
tNT2.hs:11:22: error:
• Found type wildcard ‘_’ standing for ‘(f ty -> r0) -> r0’
Where: ‘r0’ is an ambiguous type variable
‘f’ is a rigid type variable bound by
the type signature for:
fmap' :: forall k (f :: k -> *) (f' :: k -> *).
f ~> f' -> CodTy f -> CodTy f'
at tNT2.hs:10:10
‘ty’ is a rigid type variable bound by
a pattern with constructor:
CodTy :: forall k (f :: k -> *) (ty :: k).
(forall r. (f ty -> r) -> r) -> CodTy f,
in an equation for ‘fmap'’
at tNT2.hs:11:10
‘k’ is a rigid type variable bound by
the type signature for:
fmap' :: forall k (f :: k -> *) (f' :: k -> *).
f ~> f' -> CodTy f -> CodTy f'
at tNT2.hs:10:10
To use the inferred type, enable PartialTypeSignatures
• In a pattern type signature: _
In the pattern: m :: _
In the pattern: CodTy (m :: _)
• Relevant bindings include
f :: f ~> f' (bound at tNT2.hs:11:7)
fmap' :: f ~> f' -> CodTy f -> CodTy f' (bound at tNT2.hs:11:1)
tNT2.hs:11:46: error:
• Couldn't match type ‘r0’ with ‘r’
because type variable ‘r’ would escape its scope
This (rigid, skolem) type variable is bound by
a type expected by the context:
(f' ty -> r) -> r
at tNT2.hs:11:28-51
Expected type: f ty -> r0
Actual type: f ty -> r
• In the first argument of ‘m’, namely ‘(c . f)’
In the expression: m (c . f)
In the second argument of ‘($)’, namely ‘\ c -> m (c . f)’
• Relevant bindings include
c :: f' ty -> r (bound at tNT2.hs:11:38)
m :: (f ty -> r0) -> r0 (bound at tNT2.hs:11:17)
Failed, modules loaded: none.
Prelude>
```
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ----------------------- |
| Version | 8.0.1 |
| 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":"Adding underscore (m :: _) to pattern variable makes it fail","status":"New","operating_system":"","component":"Compiler (Type checker)","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.0.1","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"This works fine\r\n\r\n{{{#!hs\r\n{-# Language RankNTypes, TypeOperators, KindSignatures, GADTs, ScopedTypeVariables, PolyKinds #-}\r\n\r\nimport Data.Kind\r\n\r\ndata CodTy :: (k -> Type) -> Type where\r\n CodTy :: { runCodTy :: (forall r. (f ty -> r) -> r) } -> CodTy f\r\n\r\ntype f ~> g = forall xx. f xx -> g xx\r\n\r\nfmap' :: (f ~> f') -> (CodTy f -> CodTy f')\r\nfmap' f (CodTy m) = CodTy $ \\ c -> m (c . f)\r\n}}}\r\n\r\nbut adding \r\n\r\n{{{#!hs\r\nfmap' f (CodTy (m :: _)) = CodTy $ \\ c -> m (c . f)\r\n}}}\r\n\r\nmakes it fail (also fails without `PolyKinds`)\r\n\r\n{{{\r\n$ ghci -ignore-dot-ghci tNT2.hs\r\nGHCi, version 8.0.1: http://www.haskell.org/ghc/ :? for help\r\n[1 of 1] Compiling Main ( tNT2.hs, interpreted )\r\n\r\ntNT2.hs:11:22: error:\r\n • Found type wildcard ‘_’ standing for ‘(f ty -> r0) -> r0’\r\n Where: ‘r0’ is an ambiguous type variable\r\n ‘f’ is a rigid type variable bound by\r\n the type signature for:\r\n fmap' :: forall k (f :: k -> *) (f' :: k -> *).\r\n f ~> f' -> CodTy f -> CodTy f'\r\n at tNT2.hs:10:10\r\n ‘ty’ is a rigid type variable bound by\r\n a pattern with constructor:\r\n CodTy :: forall k (f :: k -> *) (ty :: k).\r\n (forall r. (f ty -> r) -> r) -> CodTy f,\r\n in an equation for ‘fmap'’\r\n at tNT2.hs:11:10\r\n ‘k’ is a rigid type variable bound by\r\n the type signature for:\r\n fmap' :: forall k (f :: k -> *) (f' :: k -> *).\r\n f ~> f' -> CodTy f -> CodTy f'\r\n at tNT2.hs:10:10\r\n To use the inferred type, enable PartialTypeSignatures\r\n • In a pattern type signature: _\r\n In the pattern: m :: _\r\n In the pattern: CodTy (m :: _)\r\n • Relevant bindings include\r\n f :: f ~> f' (bound at tNT2.hs:11:7)\r\n fmap' :: f ~> f' -> CodTy f -> CodTy f' (bound at tNT2.hs:11:1)\r\n\r\ntNT2.hs:11:46: error:\r\n • Couldn't match type ‘r0’ with ‘r’\r\n because type variable ‘r’ would escape its scope\r\n This (rigid, skolem) type variable is bound by\r\n a type expected by the context:\r\n (f' ty -> r) -> r\r\n at tNT2.hs:11:28-51\r\n Expected type: f ty -> r0\r\n Actual type: f ty -> r\r\n • In the first argument of ‘m’, namely ‘(c . f)’\r\n In the expression: m (c . f)\r\n In the second argument of ‘($)’, namely ‘\\ c -> m (c . f)’\r\n • Relevant bindings include\r\n c :: f' ty -> r (bound at tNT2.hs:11:38)\r\n m :: (f ty -> r0) -> r0 (bound at tNT2.hs:11:17)\r\nFailed, modules loaded: none.\r\nPrelude> \r\n}}}","type_of_failure":"OtherFailure","blocking":[]} -->https://gitlab.haskell.org/ghc/ghc/-/issues/13536Program which terminates instantly in GHC 8.0.2 runs for minutes with 8.2.12019-07-07T18:21:26ZRyan ScottProgram which terminates instantly in GHC 8.0.2 runs for minutes with 8.2.1This currently causes the `vector` test suite to loop forever (see [here](https://github.com/haskell/vector/pull/161#issuecomment-292031845)). I've reproduced this with GHC 8.2.1 and HEAD. Unfortunately, it's not easy to isolate down to ...This currently causes the `vector` test suite to loop forever (see [here](https://github.com/haskell/vector/pull/161#issuecomment-292031845)). I've reproduced this with GHC 8.2.1 and HEAD. Unfortunately, it's not easy to isolate down to a file with no dependencies, so for now this requires `vector` and `QuickCheck` to reproduce. First, install them:
```
$ cabal install vector QuickCheck --allow-newer -w /opt/ghc/8.2.1/bin/ghc
```
Then take this file:
```hs
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE TypeFamilies #-}
module Main (main) where
import qualified Data.Vector.Generic as V
import qualified Data.Vector.Unboxed as DVU
import Test.QuickCheck
import Text.Show.Functions ()
main :: IO ()
main = do
verboseCheck ((\f (i, b) v -> V.foldl f (i, b) v == foldl (\x -> f (unmodel x)) (i, b) (
DVU.toList v)) :: ((Int, Bool) -> (Int, Bool) -> (Int, Bool))
-> (Int, Bool) -> DVU.Vector (Int, Bool) -> Bool)
instance (Arbitrary a, DVU.Unbox a) => Arbitrary (DVU.Vector a) where
arbitrary = fmap DVU.fromList arbitrary
class TestData a where
type Model a
unmodel :: Model a -> a
instance TestData Bool where
type Model Bool = Bool
unmodel = id
instance TestData Int where
type Model Int = Int
unmodel = id
instance (Eq a, Eq b, TestData a, TestData b) => TestData (a,b) where
type Model (a,b) = (Model a, Model b)
unmodel (a,b) = (unmodel a, unmodel b)
```
Then compile it with `/opt/ghc/8.2.1/bin/ghc -O2 Main.hs` (the `-O2` part is important). Observe that running it never terminates.
However, the same program //does// terminate when compiled with 8.0.2!
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 8.1 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | highest |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"Program which terminated in GHC 8.0.2 loops with 8.2.1","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"8.2.1","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.1","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"This currently causes the `vector` test suite to loop forever (see [https://github.com/haskell/vector/pull/161#issuecomment-292031845 here]). I've reproduced this with GHC 8.2.1 and HEAD. Unfortunately, it's not easy to isolate down to a file with no dependencies, so for now this requires `vector` and `QuickCheck` to reproduce. First, install them:\r\n\r\n{{{\r\n$ cabal install vector QuickCheck --allow-newer -w /opt/ghc/8.2.1/bin/ghc\r\n}}}\r\n\r\nThen take this file:\r\n\r\n{{{#!hs\r\n{-# LANGUAGE FlexibleContexts #-}\r\n{-# LANGUAGE TypeFamilies #-}\r\nmodule Main (main) where\r\n\r\nimport qualified Data.Vector.Generic as V\r\nimport qualified Data.Vector.Unboxed as DVU\r\nimport Test.QuickCheck\r\nimport Text.Show.Functions ()\r\n\r\nmain :: IO ()\r\nmain = do\r\n verboseCheck ((\\f (i, b) v -> V.foldl f (i, b) v == foldl (\\x -> f (unmodel x)) (i, b) (\r\nDVU.toList v)) :: ((Int, Bool) -> (Int, Bool) -> (Int, Bool))\r\n -> (Int, Bool) -> DVU.Vector (Int, Bool) -> Bool)\r\ninstance (Arbitrary a, DVU.Unbox a) => Arbitrary (DVU.Vector a) where\r\n arbitrary = fmap DVU.fromList arbitrary\r\n\r\nclass TestData a where\r\n type Model a\r\n unmodel :: Model a -> a\r\n\r\ninstance TestData Bool where\r\n type Model Bool = Bool\r\n unmodel = id\r\n\r\ninstance TestData Int where\r\n type Model Int = Int\r\n unmodel = id\r\n\r\ninstance (Eq a, Eq b, TestData a, TestData b) => TestData (a,b) where\r\n type Model (a,b) = (Model a, Model b)\r\n unmodel (a,b) = (unmodel a, unmodel b)\r\n}}}\r\n\r\nThen compile it with `/opt/ghc/8.2.1/bin/ghc -O2 Main.hs` (the `-O2` part is important). Observe that running it never terminates.\r\n\r\nHowever, the same program //does// terminate when compiled with 8.0.2!","type_of_failure":"OtherFailure","blocking":[]} -->8.2.1https://gitlab.haskell.org/ghc/ghc/-/issues/13535vector test suite uses excessive memory on GHC 8.22023-06-02T11:06:30ZRyan Scottvector test suite uses excessive memory on GHC 8.2First noticed [here](https://github.com/haskell/vector/pull/161#issuecomment-292031845). I haven't managed to boil this down to a test case with no dependencies yet, so for the time being, this requires `vector`. To reproduce, follow the...First noticed [here](https://github.com/haskell/vector/pull/161#issuecomment-292031845). I haven't managed to boil this down to a test case with no dependencies yet, so for the time being, this requires `vector`. To reproduce, follow these steps:
```
$ git clone https://github.com/erikd/vector
$ cd vector/
$ cabal install --only-dependencies --enable-tests -w /opt/ghc/8.2.1/bin/ghc
$ cabal configure --enable-tests -w /opt/ghc/8.2.1/bin/ghc
$ cabal test
```
When building `vector-tests-O2`, GHC will stall when compiling the `Tests.Vector` module. On machines with modest memory allowances (e.g., [the machines used on Travis CI](https://travis-ci.org/haskell/vector/jobs/218749281#L1270)), GHC will be killed with an out-of-memory error after trying to compile `Tests.Vector` for a while.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 8.1 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | highest |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"vector test suite uses excessive memory on GHC 8.2","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"8.2.1","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.1","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"First noticed [https://github.com/haskell/vector/pull/161#issuecomment-292031845 here]. I haven't managed to boil this down to a test case with no dependencies yet, so for the time being, this requires `vector`. To reproduce, follow these steps:\r\n\r\n{{{\r\n$ git clone https://github.com/erikd/vector\r\n$ cd vector/\r\n$ cabal install --only-dependencies --enable-tests -w /opt/ghc/8.2.1/bin/ghc\r\n$ cabal configure --enable-tests -w /opt/ghc/8.2.1/bin/ghc\r\n$ cabal test\r\n}}}\r\n\r\nWhen building `vector-tests-O2`, GHC will stall when compiling the `Tests.Vector` module. On machines with modest memory allowances (e.g., [https://travis-ci.org/haskell/vector/jobs/218749281#L1270 the machines used on Travis CI]), GHC will be killed with an out-of-memory error after trying to compile `Tests.Vector` for a while.","type_of_failure":"OtherFailure","blocking":[]} -->⊥Ben GamariBen Gamarihttps://gitlab.haskell.org/ghc/ghc/-/issues/13534ghc-8.2.0.20170404/testsuite/timeout failed to build2019-07-07T18:21:27ZJens Petersenghc-8.2.0.20170404/testsuite/timeout failed to build```
+ make test
make -C testsuite/tests CLEANUP=1 SUMMARY_FILE=../../testsuite_summary.txt
make[1]: Entering directory '/builddir/build/BUILD/ghc-8.2.0.20170404/testsuite/tests'
"/builddir/build/BUILD/ghc-8.2.0.20170404/inplace/bin/ghc-s...```
+ make test
make -C testsuite/tests CLEANUP=1 SUMMARY_FILE=../../testsuite_summary.txt
make[1]: Entering directory '/builddir/build/BUILD/ghc-8.2.0.20170404/testsuite/tests'
"/builddir/build/BUILD/ghc-8.2.0.20170404/inplace/bin/ghc-stage2" --make -o ../mk/ghc-config ../mk/ghc-config.hs
[1 of 1] Compiling Main ( ../mk/ghc-config.hs, ../mk/ghc-config.o )
Linking ../mk/ghc-config ...
../mk/ghc-config "/builddir/build/BUILD/ghc-8.2.0.20170404/inplace/bin/ghc-stage2" >"../mk/ghcconfig_builddir_build_BUILD_ghc-8.2.0.20170404_inplace_bin_ghc-stage2.mk"; if [ $? != 0 ]; then rm -f "../mk/ghcconfig_builddir_build_BUILD_ghc-8.2.0.20170404_inplace_bin_ghc-stage2.mk"; exit 1; fi
Looks like you don't have timeout, building it first...
make -C ../timeout all
make[2]: Entering directory '/builddir/build/BUILD/ghc-8.2.0.20170404/testsuite/timeout'
rm -f -f TimeMe.o TimeMe.hi TimeMe TimeMe.exe
python3 calibrate '' > calibrate.out
Traceback (most recent call last):
File "calibrate", line 20, in <module>
compiler_name, 'TimeMe.hs', '-o', 'TimeMe', '-O2')
File "/usr/lib64/python3.6/os.py", line 920, in spawnl
return spawnv(mode, file, args)
File "/usr/lib64/python3.6/os.py", line 871, in spawnv
return _spawnvef(mode, file, args, None, execv)
File "/usr/lib64/python3.6/os.py", line 838, in _spawnvef
raise ValueError('argv first element cannot be empty')
ValueError: argv first element cannot be empty
make[2]: Leaving directory '/builddir/build/BUILD/ghc-8.2.0.20170404/testsuite/timeout'
make[2]: *** [Makefile:54: calibrate.out] Error 1
make[1]: Leaving directory '/builddir/build/BUILD/ghc-8.2.0.20170404/testsuite/tests'
make[1]: *** [../mk/test.mk:293: ../timeout/install-inplace/bin/timeout] Error 2
make: *** [Makefile:217: test] Error 2
```
Full buildlog at https://copr-be.cloud.fedoraproject.org/results/petersen/ghc-8.2.1/fedora-26-x86_64/00536407-ghc/build.log.gz (for a couple of weeks)8.2.1https://gitlab.haskell.org/ghc/ghc/-/issues/13533-ddump-warnings2019-07-07T18:21:27ZNeil Mitchell-ddump-warningsIt would be useful to have a way to dump the warnings from a compilation to a file, and seemingly the most natural way to do that would be to extend with `-ddump-warnings`.
The use case is that developers often want to develop and debug...It would be useful to have a way to dump the warnings from a compilation to a file, and seemingly the most natural way to do that would be to extend with `-ddump-warnings`.
The use case is that developers often want to develop and debug without worrying so much about warnings, but should almost always resolve the warnings before committing. If you build with `-Werror` that impedes development. If you don't build with `-Werror` then you may check in code that later fails continuous integration tests, or have to do a clean build to get the warnings out. An alternative workflow would be to always dump warnings to a file, then before commit have a script to quickly check if any of the files are non-empty.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | -------------------- |
| Version | 8.0.2 |
| Type | FeatureRequest |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | ndmitchell@gmail.com |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"-ddump-warnings","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.0.2","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":["ndmitchell@gmail.com"],"type":"FeatureRequest","description":"It would be useful to have a way to dump the warnings from a compilation to a file, and seemingly the most natural way to do that would be to extend with {{{-ddump-warnings}}}.\r\n\r\nThe use case is that developers often want to develop and debug without worrying so much about warnings, but should almost always resolve the warnings before committing. If you build with {{{-Werror}}} that impedes development. If you don't build with {{{-Werror}}} then you may check in code that later fails continuous integration tests, or have to do a clean build to get the warnings out. An alternative workflow would be to always dump warnings to a file, then before commit have a script to quickly check if any of the files are non-empty.","type_of_failure":"OtherFailure","blocking":[]} -->