[GHC] #13549: GHC 8.2.1's typechecker rejects code generated by singletons that 8.0 accepts
GHC
ghc-devs at haskell.org
Sat Apr 8 21:40:43 UTC 2017
#13549: GHC 8.2.1's typechecker rejects code generated by singletons that 8.0
accepts
-------------------------------------+-------------------------------------
Reporter: RyanGlScott | Owner: (none)
Type: bug | Status: new
Priority: high | Milestone: 8.2.1
Component: Compiler | Version: 8.0.1
(Type checker) |
Keywords: | Operating System: Unknown/Multiple
Architecture: | Type of failure: GHC rejects
Unknown/Multiple | valid program
Test Case: | Blocked By:
Blocking: | Related Tickets:
Differential Rev(s): | Wiki Page:
-------------------------------------+-------------------------------------
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
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 xs_a33fp
-> Sing r_a33fq
-> Sing
(Apply
(Apply
(Let6989586621679736980InterleaveSym4
xs0_a33a0 t_a33aL
ts_a33aM is_a33aO)
arg_a33hh)
arg_a33hi)
at Bug.hs:(1289,35)-(1294,157)
Expected type: Sing t
-> Sing t1
-> Sing t2
-> Sing
(((Let6989586621679736980Interleave'Sym4
xs0_a33a0 t_a33aL ts_a33aM is_a33aO
@@ t)
@@ t1)
@@ t2)
Actual type: Sing t
-> Sing t1
-> Sing t2
-> Sing
(Apply
(Apply
(Apply
(Let6989586621679736980Interleave'Sym4
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
(Let6989586621679737265X_6989586621679737266Sym6
xs0_a33a0 t_a33aL ts_a33aM is_a33aO
xs_a33fp r_a33fq)
(bound at Bug.hs:1321:41)
r_a33iK :: Sing r_a33fq (bound at Bug.hs:1295:57)
xs_a33iJ :: Sing xs_a33fp (bound at Bug.hs:1295:48)
lambda_a33iH :: Sing xs_a33fp
-> Sing r_a33fq
-> Sing
(Apply
(Apply
(Let6989586621679736980InterleaveSym4
xs0_a33a0 t_a33aL ts_a33aM is_a33aO)
arg_a33hh)
arg_a33hi)
(bound at Bug.hs:1295:35)
sR :: Sing arg_a33hi (bound at Bug.hs:1287:45)
sXs :: Sing arg_a33hh (bound at Bug.hs:1287:41)
sInterleave' :: forall (arg_a33he :: TyFun
[a_a337f]
c69895866216793215480
-> *) (arg_a33hf ::
[a_a337f]) (arg_a33hg :: [c69895866216793215480]).
Sing arg_a33he
-> Sing arg_a33hf
-> Sing arg_a33hg
-> Sing
(Apply
(Apply
(Apply
(Let6989586621679736980Interleave'Sym4
xs0_a33a0 t_a33aL ts_a33aM
is_a33aO)
arg_a33he)
arg_a33hf)
arg_a33hg)
(bound at Bug.hs:1166:29)
lambda_a33ha :: Sing t_a33aL
-> Sing ts_a33aM
-> Sing is_a33aO
-> Sing
(Apply
(Apply (Let6989586621679736931PermsSym1
xs0_a33a0) arg_a33h0)
arg_a33h1)
(bound at Bug.hs:1153:23)
sTs :: Sing n_a1kQd (bound at Bug.hs:1143:34)
sT :: Sing n_a1kQc (bound at Bug.hs:1143:31)
lambda_a33gY :: Sing xs0_a33a0
-> Sing (Apply PermutationsSym0 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'
xs0_a33a0 t_a33aL ts_a33aM is_a33aO t t1 t2
~
Let6989586621679736980Interleave'
xs0_a33a0 t_a33aL ts_a33aM is_a33aO t t1 t2
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 xs0_a33a0 -> Sing (Apply
PermutationsSym0 t_a33gX)
at Bug.hs:(1122,11)-(1126,67)
or from: arg_a33h0 ~ (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 ~ (n_a1kQc : n_a1kQd) =>
Sing n_a1kQc -> Sing n_a1kQd -> Sing z_a1kQb,
in an equation for ‘sPerms’
at Bug.hs:1143:25-36
or from: (arg_a33h0 ~ Apply (Apply (:$) 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 (Apply (:$) t_a33aL)
ts_a33aM,
arg_a33h1 ~ is_a33aO) =>
Sing t_a33aL
-> Sing ts_a33aM
-> Sing is_a33aO
-> Sing
(Apply
(Apply
(Let6989586621679736931PermsSym1 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 xs_a33fp
-> Sing r_a33fq
-> Sing
(Apply
(Apply
(Let6989586621679736980InterleaveSym4
xs0_a33a0 t_a33aL
ts_a33aM is_a33aO)
arg_a33hh)
arg_a33hi)
at Bug.hs:(1289,35)-(1294,157)
Expected type: Sing t
-> Sing t1
-> Sing t2
-> Sing
(((Let6989586621679736980Interleave'Sym4
xs0_a33a0 t_a33aL ts_a33aM is_a33aO
@@ t)
@@ t1)
@@ t2)
Actual type: Sing t
-> Sing t1
-> Sing t2
-> Sing
(Apply
(Apply
(Apply
(Let6989586621679736980Interleave'Sym4
xs0_a33a0 t_a33aL ts_a33aM is_a33aO)
t)
t1)
t2)
The type variable ‘c69895866216793215480’ is ambiguous
Use -fprint-explicit-kinds to see the kind arguments
• 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
(Let6989586621679737265X_6989586621679737266Sym6
xs0_a33a0 t_a33aL ts_a33aM is_a33aO
xs_a33fp r_a33fq)
(bound at Bug.hs:1321:41)
r_a33iK :: Sing r_a33fq (bound at Bug.hs:1295:57)
xs_a33iJ :: Sing xs_a33fp (bound at Bug.hs:1295:48)
lambda_a33iH :: Sing xs_a33fp
-> Sing r_a33fq
-> Sing
(Apply
(Apply
(Let6989586621679736980InterleaveSym4
xs0_a33a0 t_a33aL ts_a33aM is_a33aO)
arg_a33hh)
arg_a33hi)
(bound at Bug.hs:1295:35)
sR :: Sing arg_a33hi (bound at Bug.hs:1287:45)
sXs :: Sing arg_a33hh (bound at Bug.hs:1287:41)
sInterleave' :: forall (arg_a33he :: TyFun
[a_a337f]
c69895866216793215480
-> *) (arg_a33hf ::
[a_a337f]) (arg_a33hg :: [c69895866216793215480]).
Sing arg_a33he
-> Sing arg_a33hf
-> Sing arg_a33hg
-> Sing
(Apply
(Apply
(Apply
(Let6989586621679736980Interleave'Sym4
xs0_a33a0 t_a33aL ts_a33aM
is_a33aO)
arg_a33he)
arg_a33hf)
arg_a33hg)
(bound at Bug.hs:1166:29)
lambda_a33ha :: Sing t_a33aL
-> Sing ts_a33aM
-> Sing is_a33aO
-> Sing
(Apply
(Apply (Let6989586621679736931PermsSym1
xs0_a33a0) arg_a33h0)
arg_a33h1)
(bound at Bug.hs:1153:23)
sTs :: Sing n_a1kQd (bound at Bug.hs:1143:34)
sT :: Sing n_a1kQc (bound at Bug.hs:1143:31)
lambda_a33gY :: Sing xs0_a33a0
-> Sing (Apply PermutationsSym0 t_a33gX)
(bound at Bug.hs:1127:11)
(Some bindings suppressed; use -fmax-relevant-binds=N or -fno-max-
relevant-binds)
|
1328 |
sInterleave'))
|
^^^^^^^^^^^^
}}}
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13549>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list