Skip to content

Instantly share code, notes, and snippets.

@andrewthad
Created June 12, 2019 12:33
Show Gist options
  • Save andrewthad/b58cb1511667a9098f224ea7750440ad to your computer and use it in GitHub Desktop.
Save andrewthad/b58cb1511667a9098f224ea7750440ad to your computer and use it in GitHub Desktop.
T16391 Typechecker Trace
[1 of 1] Compiling T16391a ( T16391a.hs, T16391a.o )
checkFamInstConsistency [Data.Kind, Prelude]
Tc2 (src)
Tc3
tcExtendKindEnvList []
tcExtendKindEnvList []
---- tcTyClGroup ---- {
Decls for [Const]
tcExtendKindEnv [rs4 :-> APromotionErr TyConPE]
---- kcTyClGroup ---- {
module T16391a
type Const (a_aWQ :: Type) (b_aWR :: Type) = a_aWQ
getInitialKinds {
getInitialKinds done }
tcExtendKindEnvList []
solveEqualities { level = 1
getInitialKinds {
bindImplicitTKBndrs
[]
[]
tc_extend_local_env []
tcExtendBinderStack []
bindExplicTKBndrs [(a_aWQ :: Type), (b_aWR :: Type)]
solveLocalEqualitiesX { Called from tcLHsKindSig
lk1 Type
tcInferApps {
Type
[]
tcInferApps } * :: *
checkExpectedKind
*
*
checkExpectedKindX
Type
act_kind': *
exp_kind: *
solveLocalEqualities: running solver WC {}
newNoTcEvBinds unique = aWS
solveWanteds {
Level = 1
WC {}
solveSimpleWanteds { {}
solveSimpleWanteds end }
iterations = 1
residual = WC {}
solveWanteds }
final wc = WC {}
current evbinds = {}
unflattenGivens []
solveLocalEqualitiesX end } residual_wanted = WC {}
tcLHsKindSig
Type
*
checkValidType * :: *
done ct *
Ambiguity check for *
tcSubType_NC
the kind annotation on the type variable ‘a_aWQ’
*
*
tc_sub_tc_type (general case)
ty_actual = *
ty_expected = *
tcSkolemise
tc_sub_type_ds
ty_actual = *
ty_expected = *
deeply_instantiate final subst
origin: arising from a type equality * ~ *
type: *
new type: *
subst: [TCvSubst In scope: InScope {} Type env: [] Co env: []]
u_tys
tclvl 1
* ~ *
arising from a type equality * ~ *
u_tys yields no coercion
simplifyAmbiguityCheck {
type = *
wanted = WC {}
newTcEvBinds unique = aWT
solveWanteds {
Level = 1
WC {}
solveSimpleWanteds { {}
solveSimpleWanteds end }
iterations = 1
residual = WC {}
solveWanteds }
final wc = WC {}
current evbinds = {}
unflattenGivens []
End simplifyAmbiguityCheck }
reportUnsolved(ambig) {
newTcEvBinds unique = aWU
reportUnsolved(ambig) }
Done ambiguity check for *
checkValidType done * :: *
tcLHsKindSig2 *
newTyVarTyVar a_aWV[tyv:1]
tc_extend_local_env
[(a_aWQ, Type variable ‘a_aWQ’ = a_aWV[tyv:1] :: *)]
tcExtendBinderStack [a_aWQ a_aWV[tyv:1]]
solveLocalEqualitiesX { Called from tcLHsKindSig
lk1 Type
tcInferApps {
Type
[]
tcInferApps } * :: *
checkExpectedKind
*
*
checkExpectedKindX
Type
act_kind': *
exp_kind: *
solveLocalEqualities: running solver WC {}
newNoTcEvBinds unique = aWW
solveWanteds {
Level = 1
WC {}
solveSimpleWanteds { {}
solveSimpleWanteds end }
iterations = 1
residual = WC {}
solveWanteds }
final wc = WC {}
current evbinds = {}
unflattenGivens []
solveLocalEqualitiesX end } residual_wanted = WC {}
tcLHsKindSig
Type
*
checkValidType * :: *
done ct *
Ambiguity check for *
tcSubType_NC
the kind annotation on the type variable ‘b_aWR’
*
*
tc_sub_tc_type (general case)
ty_actual = *
ty_expected = *
tcSkolemise
tc_sub_type_ds
ty_actual = *
ty_expected = *
deeply_instantiate final subst
origin: arising from a type equality * ~ *
type: *
new type: *
subst: [TCvSubst In scope: InScope {} Type env: [] Co env: []]
u_tys
tclvl 1
* ~ *
arising from a type equality * ~ *
u_tys yields no coercion
simplifyAmbiguityCheck {
type = *
wanted = WC {}
newTcEvBinds unique = aWX
solveWanteds {
Level = 1
WC {}
solveSimpleWanteds { {}
solveSimpleWanteds end }
iterations = 1
residual = WC {}
solveWanteds }
final wc = WC {}
current evbinds = {}
unflattenGivens []
End simplifyAmbiguityCheck }
reportUnsolved(ambig) {
newTcEvBinds unique = aWY
reportUnsolved(ambig) }
Done ambiguity check for *
checkValidType done * :: *
tcLHsKindSig2 *
newTyVarTyVar b_aWZ[tyv:1]
tc_extend_local_env
[(b_aWR, Type variable ‘b_aWR’ = b_aWZ[tyv:1] :: *)]
tcExtendBinderStack [b_aWR b_aWZ[tyv:1]]
newMetaKindVar k_aX0[tau:1]
kcLHsQTyVars: not-cusk
Const
[]
[(a_aWQ :: Type), (b_aWR :: Type)]
[]
[a_aWV[tyv:1], b_aWZ[tyv:1]]
* -> * -> k_aX0[tau:1]
getInitialKinds done }
kcTyClGroup: initial kinds Const :: * -> * -> k_aX0[tau:1]
tcExtendKindEnvList
[(Const, ATcTyCon Const[tc] :: * -> * -> k_aX0[tau:1])]
kcTyClDecl { Const
bindTyClTyVars
Const [anon-vis (a_aWV[tyv:1]), anon-vis (b_aWZ[tyv:1])]
[(a_aWQ, a_aWV[tyv:1]), (b_aWR, b_aWZ[tyv:1])]
tc_extend_local_env
[(a_aWQ, Type variable ‘a_aWQ’ = a_aWV[tyv:1] :: *),
(b_aWR, Type variable ‘b_aWR’ = b_aWZ[tyv:1] :: *)]
tcExtendBinderStack [a_aWQ a_aWV[tyv:1], b_aWR b_aWZ[tyv:1]]
lk1 a_aWQ
tcInferApps {
a_aWQ
[]
tcInferApps } a_aWV[tyv:1] :: *
checkExpectedKind
a_aWV[tyv:1]
*
checkExpectedKindX
a_aWQ
act_kind': *
exp_kind: k_aX0[tau:1]
u_tys
tclvl 1
* ~ k_aX0[tau:1]
arising from a type equality * ~ k_aX0[tau:1]
u_tys
tclvl 1
* ~ *
arising from a kind equality arising from k_aX0[tau:1] ~ *
u_tys
tclvl 1
'GHC.Types.LiftedRep ~ 'GHC.Types.LiftedRep
arising from a kind equality arising from k_aX0[tau:1] ~ *
u_tys yields no coercion
u_tys yields no coercion
uUnfilledVar2 ok
k_aX0[tau:1] :: *
* :: *
True
<*>_N
writeMetaTyVar k_aX0[tau:1] :: * := *
u_tys yields no coercion
checkExpectedKind
*
k_aX0[tau:1]
<*>_N
kcTyClDecl done } Const
solveEqualities: running solver wanted = WC {}
newNoTcEvBinds unique = aX1
solveWanteds {
Level = 1
WC {}
solveSimpleWanteds { {}
solveSimpleWanteds end }
iterations = 1
residual = WC {}
solveWanteds }
final wc = WC {}
current evbinds = {}
unflattenGivens []
End solveEqualities }
newNoTcEvBinds unique = aX2
Skolemising a_aWV[tyv:1] := a_aWV[sk:1]
writeMetaTyVar a_aWV[tyv:1] :: * := a_aWV[sk:1]
Skolemising b_aWZ[tyv:1] := b_aWZ[sk:1]
writeMetaTyVar b_aWZ[tyv:1] :: * := b_aWZ[sk:1]
quantifyTyVars 1
0
DV {dv_kvs = {}, dv_tvs = {}, dv_cvs = {}}
{}
quantifyTyVars 2
globals: {}
mono_tvs: {}
nondep:
dep:
dep_kvs'
nondep_tvs'
generaliseTcTyCon: before zonkRec
spec_req_tvs = a_aWV[sk:1] b_aWZ[sk:1]
inferred =
generaliseTcTyCon: post zonk
tycon = Const[tc]
inferred =
ze = ZE {ze_tv_env = [aWV :-> a_aWQ, aWZ :-> b_aWR]
ze_id_env = []}
spec_req_prs = [(a_aWQ, a_aWV[tyv:1]), (b_aWR, b_aWZ[tyv:1])]
spec_req_tvs = a_aWV[sk:1] b_aWZ[sk:1]
final_spec_req_tvs = a_aWQ b_aWR
generaliseTcTyCon done
tycon = Const[tc]
tc_res_kind = *
dep_fv_set = {}
final_spec_req_tvs = a_aWQ b_aWR
inferred =
specified =
required_tcbs = [anon-vis (a_aWQ), anon-vis (b_aWR)]
final_tcbs = [anon-vis (a_aWQ), anon-vis (b_aWR)]
---- kcTyClGroup end ---- } Const :: * -> * -> *
tcTyAndCl generalized kinds
(Const, [anon-vis (a_aWQ), anon-vis (b_aWR)], * True)
tcExtendKindEnvList [(Const, ATcTyCon Const[tc] :: * -> * -> *)]
---- tcTyClDecl ---- {
type Const (a_aWQ :: Type) (b_aWR :: Type) = a_aWQ
bindTyClTyVars
Const [anon-vis (a_aWQ), anon-vis (b_aWR)]
[(a_aWQ, a_aWQ), (b_aWR, b_aWR)]
tc_extend_local_env
[(a_aWQ, Type variable ‘a_aWQ’ = a_aWQ :: *),
(b_aWR, Type variable ‘b_aWR’ = b_aWR :: *)]
tcExtendBinderStack [a_aWQ a_aWQ, b_aWR b_aWR]
tc-syn
Const
[aWQ :-> Type variable ‘a_aWQ’ = a_aWQ :: *,
aWR :-> Type variable ‘b_aWR’ = b_aWR :: *,
rs4 :-> ATcTyCon Const[tc] :: * -> * -> *]
solveEqualities { level = 1
lk1 a_aWQ
tcInferApps {
a_aWQ
[]
tcInferApps } a_aWQ :: *
checkExpectedKind
a_aWQ
*
checkExpectedKindX
a_aWQ
act_kind': *
exp_kind: *
solveEqualities: running solver wanted = WC {}
newNoTcEvBinds unique = aX3
solveWanteds {
Level = 1
WC {}
solveSimpleWanteds { {}
solveSimpleWanteds end }
iterations = 1
residual = WC {}
solveWanteds }
final wc = WC {}
current evbinds = {}
unflattenGivens []
End solveEqualities }
newNoTcEvBinds unique = aX4
---- tcTyClDecl end ---- } Const
Starting synonym cycle check [Const]
Done synonym cycle check [Const]
Starting validity check [Const]
Starting validity for tycon Const
checkValidTyCon
Const
Nothing
checkValidType a_aWQ :: *
done ct a_aWQ
checkValidType done a_aWQ :: *
Done validity for tycon Const
Done validity check [Const]
---- end tcTyClGroup ---- }
tcAddTyCons
tycons [Const]
implicits []
tcExtendKindEnvList []
tc_extend_local_env []
Adding instances:
addFamInsts
tcAddTyCons
tycons []
implicits []
tcExtendKindEnvList []
tc_extend_local_env []
---- tcTyClGroup ---- {
Decls for [F]
tcExtendKindEnv [rs3 :-> APromotionErr TyConPE]
---- kcTyClGroup ---- {
module T16391a
type family F :: Const Type a_aWP where
F = Int
getInitialKinds {
solveEqualities { level = 1
newMetaKindVar k_aX5[tau:1]
bindImplicitTKBndrs
[a_aWP]
[a_aWP[sk:1]]
tc_extend_local_env
[(a_aWP, Type variable ‘a_aWP’ = a_aWP[sk:1] :: k_aX5[tau:1])]
tcExtendBinderStack [a_aWP a_aWP[sk:1]]
bindExplicTKBndrs []
solveLocalEqualitiesX { Called from tcLHsKindSig
lk1 Const
tcInferApps {
Const
[Type, a_aWP]
tcInferApps (vis normal app)
[vis] *
Type
*
[TCvSubst In scope: InScope {} Type env: [] Co env: []]
lk1 Type
tcInferApps {
Type
[]
tcInferApps } * :: *
checkExpectedKind
*
*
checkExpectedKindX
Type
act_kind': *
exp_kind: *
tcInferApps (vis normal app) 2 *
tcInferApps (vis normal app)
[vis] *
a_aWP
*
[TCvSubst In scope: InScope {} Type env: [] Co env: []]
lk1 a_aWP
tcInferApps {
a_aWP
[]
tcInferApps } a_aWP[sk:1] :: k_aX5[tau:1]
checkExpectedKind
a_aWP[sk:1]
k_aX5[tau:1]
checkExpectedKindX
a_aWP
act_kind': k_aX5[tau:1]
exp_kind: *
u_tys
tclvl 1
k_aX5[tau:1] ~ *
arising from a type equality k_aX5[tau:1] ~ *
u_tys
tclvl 1
* ~ *
arising from a kind equality arising from k_aX5[tau:1] ~ *
u_tys
tclvl 1
'GHC.Types.LiftedRep ~ 'GHC.Types.LiftedRep
arising from a kind equality arising from k_aX5[tau:1] ~ *
u_tys yields no coercion
u_tys yields no coercion
uUnfilledVar2 ok
k_aX5[tau:1] :: *
* :: *
True
<*>_N
writeMetaTyVar k_aX5[tau:1] :: * := *
u_tys yields no coercion
checkExpectedKind
k_aX5[tau:1]
*
<*>_N
tcInferApps (vis normal app) 2 *
tcInferApps } Const * a_aWP[sk:1] :: *
checkExpectedKind
Const * a_aWP[sk:1]
*
checkExpectedKindX
Const Type a_aWP
act_kind': *
exp_kind: *
solveLocalEqualities: running solver WC {}
newNoTcEvBinds unique = aX6
solveWanteds {
Level = 1
WC {}
solveSimpleWanteds { {}
solveSimpleWanteds end }
iterations = 1
residual = WC {}
solveWanteds }
final wc = WC {}
current evbinds = {}
unflattenGivens []
solveLocalEqualitiesX end } residual_wanted = WC {}
tcLHsKindSig
Const Type a_aWP
Const * a_aWP[sk:1]
checkValidType Const * a_aWP[sk:1] :: *
done ct Const * a_aWP[sk:1]
Ambiguity check for Const * a_aWP[sk:1]
tcSubType_NC
the result kind for ‘F’
Const * a_aWP[sk:1]
Const * a_aWP[sk:1]
tc_sub_tc_type (general case)
ty_actual = Const * a_aWP[sk:1]
ty_expected = Const * a_aWP[sk:1]
tcSkolemise
tc_sub_type_ds
ty_actual = Const * a_aWP[sk:1]
ty_expected = Const * a_aWP[sk:1]
deeply_instantiate final subst
origin: arising from a type equality Const * a_aWP[sk:1]
~
Const * a_aWP[sk:1]
type: Const * a_aWP[sk:1]
new type: Const * a_aWP[sk:1]
subst: [TCvSubst In scope: InScope {a_aWP} Type env: [] Co env: []]
u_tys
tclvl 1
Const * a_aWP[sk:1] ~ Const * a_aWP[sk:1]
arising from a type equality Const * a_aWP[sk:1]
~
Const * a_aWP[sk:1]
u_tys
tclvl 1
'GHC.Types.LiftedRep ~ 'GHC.Types.LiftedRep
arising from a type equality Const * a_aWP[sk:1]
~
Const * a_aWP[sk:1]
u_tys yields no coercion
u_tys yields no coercion
simplifyAmbiguityCheck {
type = Const * a_aWP[sk:1]
wanted = WC {}
newTcEvBinds unique = aX7
solveWanteds {
Level = 1
WC {}
solveSimpleWanteds { {}
solveSimpleWanteds end }
iterations = 1
residual = WC {}
solveWanteds }
final wc = WC {}
current evbinds = {}
unflattenGivens []
End simplifyAmbiguityCheck }
reportUnsolved(ambig) {
newTcEvBinds unique = aX8
reportUnsolved(ambig) }
Done ambiguity check for Const * a_aWP[sk:1]
checkValidType done Const * a_aWP[sk:1] :: *
tcLHsKindSig2 Const * a_aWP[sk:1]
solveEqualities: running solver wanted = WC {}
newNoTcEvBinds unique = aX9
solveWanteds {
Level = 1
WC {}
solveSimpleWanteds { {}
solveSimpleWanteds end }
iterations = 1
residual = WC {}
solveWanteds }
final wc = WC {}
current evbinds = {}
unflattenGivens []
End solveEqualities }
newNoTcEvBinds unique = aXa
quantifyTyVars 1
0
DV {dv_kvs = {}, dv_tvs = {}, dv_cvs = {}}
{}
quantifyTyVars 2
globals: {}
mono_tvs: {}
nondep:
dep:
dep_kvs'
nondep_tvs'
kcLHsQTyVars: cusk
name F
kv_ns [a_aWP]
hs_tvs []
scoped_kvs [a_aWP[sk:1]]
tc_tvs []
res_kind Const * a_aWP[sk:1]
candidates DV {dv_kvs = {a_aWP[sk:1]}, dv_tvs = {}, dv_cvs = {}}
inferred []
specified [a_aWP[sk:1]]
final_tc_binders [spec (a_aWP[sk:1])]
mkTyConKind final_tc_bndrs res_kind forall a. Const * a
all_tv_prs [(a_aWP, a_aWP[sk:1])]
getInitialKinds done }
tcExtendKindEnvList [(F, ATcTyCon F[tc] :: forall a. Const * a)]
solveEqualities { level = 1
getInitialKinds {
getInitialKinds done }
kcTyClGroup: initial kinds
tcExtendKindEnvList []
solveEqualities: running solver wanted = WC {}
newNoTcEvBinds unique = aXb
solveWanteds {
Level = 1
WC {}
solveSimpleWanteds { {}
solveSimpleWanteds end }
iterations = 1
residual = WC {}
solveWanteds }
final wc = WC {}
current evbinds = {}
unflattenGivens []
End solveEqualities }
newNoTcEvBinds unique = aXc
---- kcTyClGroup end ---- } F :: forall a. Const * a
tcTyAndCl generalized kinds
(F, [spec (a_aWP[sk:1])], Const * a_aWP[sk:1] True)
tcExtendKindEnvList [(F, ATcTyCon F[tc] :: forall a. Const * a)]
---- tcTyClDecl ---- {
type family F :: Const Type a_aWP where
F = Int
Closed type family: F
bindTyClTyVars
F [spec (a_aWP[sk:1])]
[(a_aWP, a_aWP[sk:1])]
tc_extend_local_env
[(a_aWP, Type variable ‘a_aWP’ = a_aWP[sk:1] :: *)]
tcExtendBinderStack [a_aWP a_aWP[sk:1]]
tcTyFamInstEqnGuts { F[tc] []
solveEqualities { level = 1
bindImplicitTKBndrs
[]
[]
tc_extend_local_env []
tcExtendBinderStack []
bindExplicTKBndrs []
tcFamTyPats {
F[tc]
arity: 1
tcInferApps {
F
[]
tcInferApps } F :: forall a. Const * a
cloneAnonMetaTyVar a_aXd[tau:1]
End tcFamTyPats }
F[tc]
res_kind: Const * a_aXd[tau:1]
lk1 Int
tcInferApps {
Int
[]
tcInferApps } Int :: *
checkExpectedKind
Int
*
checkExpectedKindX
Int
act_kind': *
exp_kind: Const * a_aXd[tau:1]
solveEqualities: running solver wanted = WC {}
newNoTcEvBinds unique = aXe
solveWanteds {
Level = 1
WC {}
solveSimpleWanteds { {}
solveSimpleWanteds end }
iterations = 1
residual = WC {}
solveWanteds }
final wc = WC {}
current evbinds = {}
unflattenGivens []
End solveEqualities }
newNoTcEvBinds unique = aXf
quantifyTyVars 1
0
DV {dv_kvs = {}, dv_tvs = {a_aXd[tau:1]}, dv_cvs = {}}
{}
Skolemising a_aXd[tau:1] := a_aXd[sk:1]
writeMetaTyVar a_aXd[tau:1] :: * := a_aXd[sk:1]
quantifyTyVars 2
globals: {}
mono_tvs: {}
nondep: a_aXd[tau:1]
dep:
dep_kvs'
nondep_tvs' a_aXd[sk:1]
tcTyFamInstEqnGuts } F[tc] a_aXd
---- tcTyClDecl end ---- } F
Starting synonym cycle check [F]
Done synonym cycle check [F]
Starting validity check [F]
Starting validity for tycon F
checkValidTyCon
F
Nothing
checkFamPatBinders
F a_aXd
F @a_aXd
qtvs: [a_aXd]
rhs_tvs: {}
pat_tvs: {a_aXd}
exact_pat_tvs: {a_aXd}
checkVTFE
F
Int
[]
Done validity for tycon F
Done validity check [F]
---- end tcTyClGroup ---- }
tcAddTyCons
tycons [F]
implicits [Coercion axiom ‘T16391a.D:R:F’]
tcExtendKindEnvList []
tc_extend_local_env []
Adding instances:
addFamInsts
tcAddTyCons
tycons []
implicits []
tcExtendKindEnvList []
tc_extend_local_env []
---- tcTyClGroup ---- {
Decls for [TS]
tcExtendKindEnv [rs2 :-> APromotionErr TyConPE]
---- kcTyClGroup ---- {
module T16391a
type TS = (Int :: Const Type a_aWO)
getInitialKinds {
solveEqualities { level = 1
newMetaKindVar k_aXh[tau:1]
bindImplicitTKBndrs
[a_aWO]
[a_aWO[sk:1]]
tc_extend_local_env
[(a_aWO, Type variable ‘a_aWO’ = a_aWO[sk:1] :: k_aXh[tau:1])]
tcExtendBinderStack [a_aWO a_aWO[sk:1]]
bindExplicTKBndrs []
solveLocalEqualitiesX { Called from tcLHsKindSig
lk1 Const
tcInferApps {
Const
[Type, a_aWO]
tcInferApps (vis normal app)
[vis] *
Type
*
[TCvSubst In scope: InScope {} Type env: [] Co env: []]
lk1 Type
tcInferApps {
Type
[]
tcInferApps } * :: *
checkExpectedKind
*
*
checkExpectedKindX
Type
act_kind': *
exp_kind: *
tcInferApps (vis normal app) 2 *
tcInferApps (vis normal app)
[vis] *
a_aWO
*
[TCvSubst In scope: InScope {} Type env: [] Co env: []]
lk1 a_aWO
tcInferApps {
a_aWO
[]
tcInferApps } a_aWO[sk:1] :: k_aXh[tau:1]
checkExpectedKind
a_aWO[sk:1]
k_aXh[tau:1]
checkExpectedKindX
a_aWO
act_kind': k_aXh[tau:1]
exp_kind: *
u_tys
tclvl 1
k_aXh[tau:1] ~ *
arising from a type equality k_aXh[tau:1] ~ *
u_tys
tclvl 1
* ~ *
arising from a kind equality arising from k_aXh[tau:1] ~ *
u_tys
tclvl 1
'GHC.Types.LiftedRep ~ 'GHC.Types.LiftedRep
arising from a kind equality arising from k_aXh[tau:1] ~ *
u_tys yields no coercion
u_tys yields no coercion
uUnfilledVar2 ok
k_aXh[tau:1] :: *
* :: *
True
<*>_N
writeMetaTyVar k_aXh[tau:1] :: * := *
u_tys yields no coercion
checkExpectedKind
k_aXh[tau:1]
*
<*>_N
tcInferApps (vis normal app) 2 *
tcInferApps } Const * a_aWO[sk:1] :: *
checkExpectedKind
Const * a_aWO[sk:1]
*
checkExpectedKindX
Const Type a_aWO
act_kind': *
exp_kind: *
solveLocalEqualities: running solver WC {}
newNoTcEvBinds unique = aXi
solveWanteds {
Level = 1
WC {}
solveSimpleWanteds { {}
solveSimpleWanteds end }
iterations = 1
residual = WC {}
solveWanteds }
final wc = WC {}
current evbinds = {}
unflattenGivens []
solveLocalEqualitiesX end } residual_wanted = WC {}
tcLHsKindSig
Const Type a_aWO
Const * a_aWO[sk:1]
checkValidType Const * a_aWO[sk:1] :: *
done ct Const * a_aWO[sk:1]
Ambiguity check for Const * a_aWO[sk:1]
tcSubType_NC
the kind annotation on the declaration for ‘TS’
Const * a_aWO[sk:1]
Const * a_aWO[sk:1]
tc_sub_tc_type (general case)
ty_actual = Const * a_aWO[sk:1]
ty_expected = Const * a_aWO[sk:1]
tcSkolemise
tc_sub_type_ds
ty_actual = Const * a_aWO[sk:1]
ty_expected = Const * a_aWO[sk:1]
deeply_instantiate final subst
origin: arising from a type equality Const * a_aWO[sk:1]
~
Const * a_aWO[sk:1]
type: Const * a_aWO[sk:1]
new type: Const * a_aWO[sk:1]
subst: [TCvSubst In scope: InScope {a_aWO} Type env: [] Co env: []]
u_tys
tclvl 1
Const * a_aWO[sk:1] ~ Const * a_aWO[sk:1]
arising from a type equality Const * a_aWO[sk:1]
~
Const * a_aWO[sk:1]
u_tys
tclvl 1
'GHC.Types.LiftedRep ~ 'GHC.Types.LiftedRep
arising from a type equality Const * a_aWO[sk:1]
~
Const * a_aWO[sk:1]
u_tys yields no coercion
u_tys yields no coercion
simplifyAmbiguityCheck {
type = Const * a_aWO[sk:1]
wanted = WC {}
newTcEvBinds unique = aXj
solveWanteds {
Level = 1
WC {}
solveSimpleWanteds { {}
solveSimpleWanteds end }
iterations = 1
residual = WC {}
solveWanteds }
final wc = WC {}
current evbinds = {}
unflattenGivens []
End simplifyAmbiguityCheck }
reportUnsolved(ambig) {
newTcEvBinds unique = aXk
reportUnsolved(ambig) }
Done ambiguity check for Const * a_aWO[sk:1]
checkValidType done Const * a_aWO[sk:1] :: *
tcLHsKindSig2 Const * a_aWO[sk:1]
solveEqualities: running solver wanted = WC {}
newNoTcEvBinds unique = aXl
solveWanteds {
Level = 1
WC {}
solveSimpleWanteds { {}
solveSimpleWanteds end }
iterations = 1
residual = WC {}
solveWanteds }
final wc = WC {}
current evbinds = {}
unflattenGivens []
End solveEqualities }
newNoTcEvBinds unique = aXm
quantifyTyVars 1
0
DV {dv_kvs = {}, dv_tvs = {}, dv_cvs = {}}
{}
quantifyTyVars 2
globals: {}
mono_tvs: {}
nondep:
dep:
dep_kvs'
nondep_tvs'
kcLHsQTyVars: cusk
name TS
kv_ns [a_aWO]
hs_tvs []
scoped_kvs [a_aWO[sk:1]]
tc_tvs []
res_kind Const * a_aWO[sk:1]
candidates DV {dv_kvs = {a_aWO[sk:1]}, dv_tvs = {}, dv_cvs = {}}
inferred []
specified [a_aWO[sk:1]]
final_tc_binders [spec (a_aWO[sk:1])]
mkTyConKind final_tc_bndrs res_kind forall a. Const * a
all_tv_prs [(a_aWO, a_aWO[sk:1])]
getInitialKinds done }
tcExtendKindEnvList [(TS, ATcTyCon TS[tc] :: forall a. Const * a)]
solveEqualities { level = 1
getInitialKinds {
getInitialKinds done }
kcTyClGroup: initial kinds
tcExtendKindEnvList []
solveEqualities: running solver wanted = WC {}
newNoTcEvBinds unique = aXn
solveWanteds {
Level = 1
WC {}
solveSimpleWanteds { {}
solveSimpleWanteds end }
iterations = 1
residual = WC {}
solveWanteds }
final wc = WC {}
current evbinds = {}
unflattenGivens []
End solveEqualities }
newNoTcEvBinds unique = aXo
---- kcTyClGroup end ---- } TS :: forall a. Const * a
tcTyAndCl generalized kinds
(TS, [spec (a_aWO[sk:1])], Const * a_aWO[sk:1] True)
tcExtendKindEnvList [(TS, ATcTyCon TS[tc] :: forall a. Const * a)]
---- tcTyClDecl ---- { type TS = (Int :: Const Type a_aWO)
bindTyClTyVars
TS [spec (a_aWO[sk:1])]
[(a_aWO, a_aWO[sk:1])]
tc_extend_local_env
[(a_aWO, Type variable ‘a_aWO’ = a_aWO[sk:1] :: *)]
tcExtendBinderStack [a_aWO a_aWO[sk:1]]
tc-syn
TS
[aWO :-> Type variable ‘a_aWO’ = a_aWO[sk:1] :: *,
rs2 :-> ATcTyCon TS[tc] :: forall a. Const * a]
solveEqualities { level = 1
solveLocalEqualitiesX { Called from tcLHsKindSig
lk1 Const
tcInferApps {
Const
[Type, a_aWO]
tcInferApps (vis normal app)
[vis] *
Type
*
[TCvSubst In scope: InScope {} Type env: [] Co env: []]
lk1 Type
tcInferApps {
Type
[]
tcInferApps } * :: *
checkExpectedKind
*
*
checkExpectedKindX
Type
act_kind': *
exp_kind: *
tcInferApps (vis normal app) 2 *
tcInferApps (vis normal app)
[vis] *
a_aWO
*
[TCvSubst In scope: InScope {} Type env: [] Co env: []]
lk1 a_aWO
tcInferApps {
a_aWO
[]
tcInferApps } a_aWO[sk:1] :: *
checkExpectedKind
a_aWO[sk:1]
*
checkExpectedKindX
a_aWO
act_kind': *
exp_kind: *
tcInferApps (vis normal app) 2 *
tcInferApps } Const * a_aWO[sk:1] :: *
checkExpectedKind
Const * a_aWO[sk:1]
*
checkExpectedKindX
Const Type a_aWO
act_kind': *
exp_kind: *
solveLocalEqualities: running solver WC {}
newNoTcEvBinds unique = aXp
solveWanteds {
Level = 1
WC {}
solveSimpleWanteds { {}
solveSimpleWanteds end }
iterations = 1
residual = WC {}
solveWanteds }
final wc = WC {}
current evbinds = {}
unflattenGivens []
solveLocalEqualitiesX end } residual_wanted = WC {}
tcLHsKindSig
Const Type a_aWO
Const * a_aWO[sk:1]
checkValidType Const * a_aWO[sk:1] :: *
done ct Const * a_aWO[sk:1]
Ambiguity check for Const * a_aWO[sk:1]
tcSubType_NC
a kind signature
Const * a_aWO[sk:1]
Const * a_aWO[sk:1]
tc_sub_tc_type (general case)
ty_actual = Const * a_aWO[sk:1]
ty_expected = Const * a_aWO[sk:1]
tcSkolemise
tc_sub_type_ds
ty_actual = Const * a_aWO[sk:1]
ty_expected = Const * a_aWO[sk:1]
deeply_instantiate final subst
origin: arising from a type equality Const * a_aWO[sk:1]
~
Const * a_aWO[sk:1]
type: Const * a_aWO[sk:1]
new type: Const * a_aWO[sk:1]
subst: [TCvSubst In scope: InScope {a_aWO} Type env: [] Co env: []]
u_tys
tclvl 1
Const * a_aWO[sk:1] ~ Const * a_aWO[sk:1]
arising from a type equality Const * a_aWO[sk:1]
~
Const * a_aWO[sk:1]
u_tys
tclvl 1
'GHC.Types.LiftedRep ~ 'GHC.Types.LiftedRep
arising from a type equality Const * a_aWO[sk:1]
~
Const * a_aWO[sk:1]
u_tys yields no coercion
u_tys yields no coercion
simplifyAmbiguityCheck {
type = Const * a_aWO[sk:1]
wanted = WC {}
newTcEvBinds unique = aXq
solveWanteds {
Level = 1
WC {}
solveSimpleWanteds { {}
solveSimpleWanteds end }
iterations = 1
residual = WC {}
solveWanteds }
final wc = WC {}
current evbinds = {}
unflattenGivens []
End simplifyAmbiguityCheck }
reportUnsolved(ambig) {
newTcEvBinds unique = aXr
reportUnsolved(ambig) }
Done ambiguity check for Const * a_aWO[sk:1]
checkValidType done Const * a_aWO[sk:1] :: *
tcLHsKindSig2 Const * a_aWO[sk:1]
tc_infer_hs_type:sig
Int
Const * a_aWO[sk:1]
lk1 Int
tcInferApps {
Int
[]
tcInferApps } Int :: *
checkExpectedKind
Int
*
checkExpectedKindX
Int
act_kind': *
exp_kind: Const * a_aWO[sk:1]
checkExpectedKind
Int
Const * a_aWO[sk:1]
checkExpectedKindX
Int :: Const Type a_aWO
act_kind': Const * a_aWO[sk:1]
exp_kind: Const * a_aWO[sk:1]
solveEqualities: running solver wanted = WC {}
newNoTcEvBinds unique = aXs
solveWanteds {
Level = 1
WC {}
solveSimpleWanteds { {}
solveSimpleWanteds end }
iterations = 1
residual = WC {}
solveWanteds }
final wc = WC {}
current evbinds = {}
unflattenGivens []
End solveEqualities }
newNoTcEvBinds unique = aXt
---- tcTyClDecl end ---- } TS
Starting synonym cycle check [TS]
Done synonym cycle check [TS]
Starting validity check [TS]
Starting validity for tycon TS
checkValidTyCon
TS
Nothing
checkValidType Int :: *
done ct Int
checkValidType done Int :: *
Done validity for tycon TS
Done validity check [TS]
---- end tcTyClGroup ---- }
tcAddTyCons
tycons [TS]
implicits []
tcExtendKindEnvList []
tc_extend_local_env []
Adding instances:
addFamInsts
tcAddTyCons
tycons []
implicits []
tcExtendKindEnvList []
tc_extend_local_env []
---- tcTyClGroup ---- {
Decls for [T1]
tcExtendKindEnv
[rs0 :-> APromotionErr TyConPE, rs1 :-> APromotionErr RecDataConPE]
---- kcTyClGroup ---- {
module T16391a
data T1 :: Const Type a_aWN where MkT1 :: T1
getInitialKinds {
getInitialKinds done }
tcExtendKindEnvList []
solveEqualities { level = 1
getInitialKinds {
newMetaKindVar k_aXu[tau:1]
newTyVarTyVar a_aXv[tyv:1]
bindImplicitTKBndrs
[a_aWN]
[a_aXv[tyv:1]]
tc_extend_local_env
[(a_aWN, Type variable ‘a_aWN’ = a_aXv[tyv:1] :: k_aXu[tau:1])]
tcExtendBinderStack [a_aWN a_aXv[tyv:1]]
bindExplicTKBndrs []
solveLocalEqualitiesX { Called from tcLHsKindSig
lk1 Const
tcInferApps {
Const
[Type, a_aWN]
tcInferApps (vis normal app)
[vis] *
Type
*
[TCvSubst In scope: InScope {} Type env: [] Co env: []]
lk1 Type
tcInferApps {
Type
[]
tcInferApps } * :: *
checkExpectedKind
*
*
checkExpectedKindX
Type
act_kind': *
exp_kind: *
tcInferApps (vis normal app) 2 *
tcInferApps (vis normal app)
[vis] *
a_aWN
*
[TCvSubst In scope: InScope {} Type env: [] Co env: []]
lk1 a_aWN
tcInferApps {
a_aWN
[]
tcInferApps } a_aXv[tyv:1] :: k_aXu[tau:1]
checkExpectedKind
a_aXv[tyv:1]
k_aXu[tau:1]
checkExpectedKindX
a_aWN
act_kind': k_aXu[tau:1]
exp_kind: *
u_tys
tclvl 1
k_aXu[tau:1] ~ *
arising from a type equality k_aXu[tau:1] ~ *
u_tys
tclvl 1
* ~ *
arising from a kind equality arising from k_aXu[tau:1] ~ *
u_tys
tclvl 1
'GHC.Types.LiftedRep ~ 'GHC.Types.LiftedRep
arising from a kind equality arising from k_aXu[tau:1] ~ *
u_tys yields no coercion
u_tys yields no coercion
uUnfilledVar2 ok
k_aXu[tau:1] :: *
* :: *
True
<*>_N
writeMetaTyVar k_aXu[tau:1] :: * := *
u_tys yields no coercion
checkExpectedKind
k_aXu[tau:1]
*
<*>_N
tcInferApps (vis normal app) 2 *
tcInferApps } Const * a_aXv[tyv:1] :: *
checkExpectedKind
Const * a_aXv[tyv:1]
*
checkExpectedKindX
Const Type a_aWN
act_kind': *
exp_kind: *
solveLocalEqualities: running solver WC {}
newNoTcEvBinds unique = aXw
solveWanteds {
Level = 1
WC {}
solveSimpleWanteds { {}
solveSimpleWanteds end }
iterations = 1
residual = WC {}
solveWanteds }
final wc = WC {}
current evbinds = {}
unflattenGivens []
solveLocalEqualitiesX end } residual_wanted = WC {}
tcLHsKindSig
Const Type a_aWN
Const * a_aXv[tyv:1]
checkValidType Const * a_aXv[tyv:1] :: *
done ct Const * a_aXv[tyv:1]
Ambiguity check for Const * a_aXv[tyv:1]
tcSubType_NC
the kind annotation on the declaration for ‘T1’
Const * a_aXv[tyv:1]
Const * a_aXv[tyv:1]
tc_sub_tc_type (general case)
ty_actual = Const * a_aXv[tyv:1]
ty_expected = Const * a_aXv[tyv:1]
tcSkolemise
tc_sub_type_ds
ty_actual = Const * a_aXv[tyv:1]
ty_expected = Const * a_aXv[tyv:1]
deeply_instantiate final subst
origin: arising from a type equality Const * a_aXv[tyv:1]
~
Const * a_aXv[tyv:1]
type: Const * a_aXv[tyv:1]
new type: Const * a_aXv[tyv:1]
subst: [TCvSubst In scope: InScope {a_aXv} Type env: [] Co env: []]
u_tys
tclvl 1
Const * a_aXv[tyv:1] ~ Const * a_aXv[tyv:1]
arising from a type equality Const * a_aXv[tyv:1]
~
Const * a_aXv[tyv:1]
u_tys
tclvl 1
'GHC.Types.LiftedRep ~ 'GHC.Types.LiftedRep
arising from a type equality Const * a_aXv[tyv:1]
~
Const * a_aXv[tyv:1]
u_tys yields no coercion
u_tys yields no coercion
simplifyAmbiguityCheck {
type = Const * a_aXv[tyv:1]
wanted = WC {}
newTcEvBinds unique = aXx
solveWanteds {
Level = 1
WC {}
solveSimpleWanteds { {}
solveSimpleWanteds end }
iterations = 1
residual = WC {}
solveWanteds }
final wc = WC {}
current evbinds = {}
unflattenGivens []
End simplifyAmbiguityCheck }
reportUnsolved(ambig) {
newTcEvBinds unique = aXy
reportUnsolved(ambig) }
Done ambiguity check for Const * a_aXv[tyv:1]
checkValidType done Const * a_aXv[tyv:1] :: *
tcLHsKindSig2 Const * a_aXv[tyv:1]
kcLHsQTyVars: not-cusk
T1
[a_aWN]
[]
[a_aXv[tyv:1]]
[]
Const * a_aXv[tyv:1]
getInitialKinds done }
kcTyClGroup: initial kinds T1 :: Const * a_aXv[tyv:1]
tcExtendKindEnvList [(T1, ATcTyCon T1[tc] :: Const * a_aXv[tyv:1])]
kcTyClDecl { T1
bindImplicitTKBndrs
[]
[]
tc_extend_local_env []
tcExtendBinderStack []
bindExplicTKBndrs []
newAnonMetaTyVar t_aXA[tau:1]
lk1 T1
tcInferApps {
T1
[]
tcInferApps } T1 :: Const * a_aXv[tyv:1]
checkExpectedKind
T1
Const * a_aXv[tyv:1]
checkExpectedKindX
T1
act_kind': Const * a_aXv[tyv:1]
exp_kind: TYPE t_aXA[tau:1]
u_tys
tclvl 1
Const * a_aXv[tyv:1] ~ TYPE t_aXA[tau:1]
arising from a type equality Const * a_aXv[tyv:1]
~
TYPE t_aXA[tau:1]
u_tys
tclvl 1
'GHC.Types.LiftedRep ~ t_aXA[tau:1]
arising from a type equality Const * a_aXv[tyv:1]
~
TYPE t_aXA[tau:1]
u_tys
tclvl 1
GHC.Types.RuntimeRep ~ GHC.Types.RuntimeRep
arising from a kind equality arising from
t_aXA[tau:1] ~ 'GHC.Types.LiftedRep
u_tys yields no coercion
uUnfilledVar2 ok
t_aXA[tau:1] :: GHC.Types.RuntimeRep
'GHC.Types.LiftedRep :: GHC.Types.RuntimeRep
True
<GHC.Types.RuntimeRep>_N
writeMetaTyVar
t_aXA[tau:1] :: GHC.Types.RuntimeRep := 'GHC.Types.LiftedRep
u_tys yields no coercion
u_tys yields no coercion
checkExpectedKind
Const * a_aXv[tyv:1]
TYPE t_aXA[tau:1]
<*>_N
kcTyClDecl done } T1
solveEqualities: running solver wanted = WC {}
newNoTcEvBinds unique = aXB
solveWanteds {
Level = 1
WC {}
solveSimpleWanteds { {}
solveSimpleWanteds end }
iterations = 1
residual = WC {}
solveWanteds }
final wc = WC {}
current evbinds = {}
unflattenGivens []
End solveEqualities }
newNoTcEvBinds unique = aXC
Skolemising a_aXv[tyv:1] := a_aXv[sk:1]
writeMetaTyVar a_aXv[tyv:1] :: * := a_aXv[sk:1]
quantifyTyVars 1
0
DV {dv_kvs = {}, dv_tvs = {}, dv_cvs = {}}
{}
quantifyTyVars 2
globals: {}
mono_tvs: {}
nondep:
dep:
dep_kvs'
nondep_tvs'
generaliseTcTyCon: before zonkRec
spec_req_tvs = a_aXv[sk:1]
inferred =
generaliseTcTyCon: post zonk
tycon = T1[tc]
inferred =
ze = ZE {ze_tv_env = [aXv :-> a_aWN]
ze_id_env = []}
spec_req_prs = [(a_aWN, a_aXv[tyv:1])]
spec_req_tvs = a_aXv[sk:1]
final_spec_req_tvs = a_aWN
generaliseTcTyCon done
tycon = T1[tc]
tc_res_kind = Const * a_aWN
dep_fv_set = {a_aWN}
final_spec_req_tvs = a_aWN
inferred =
specified = a_aWN
required_tcbs = []
final_tcbs = [spec (a_aWN)]
---- kcTyClGroup end ---- } T1 :: forall a. Const * a
tcTyAndCl generalized kinds
(T1, [spec (a_aWN)], Const * a_aWN True)
tcExtendKindEnvList [(T1, ATcTyCon T1[tc] :: forall a. Const * a)]
---- tcTyClDecl ---- { data T1 :: Const Type a_aWN where MkT1 :: T1
bindTyClTyVars
T1 [spec (a_aWN)]
[(a_aWN, a_aWN)]
tc_extend_local_env [(a_aWN, Type variable ‘a_aWN’ = a_aWN :: *)]
tcExtendBinderStack [a_aWN a_aWN]
solveEqualities { level = 1
solveEqualities: running solver wanted = WC {}
newNoTcEvBinds unique = aXE
solveWanteds {
Level = 1
WC {}
solveSimpleWanteds { {}
solveSimpleWanteds end }
iterations = 1
residual = WC {}
solveWanteds }
final wc = WC {}
current evbinds = {}
unflattenGivens []
End solveEqualities }
newNoTcEvBinds unique = aXF
tcConDecl 1 gadt [MkT1]
solveEqualities { level = 1
bindImplicitTKBndrs
[]
[]
tc_extend_local_env []
tcExtendBinderStack []
bindExplicTKBndrs []
lk1 T1
tcInferApps {
T1
[]
tcInferApps } T1 :: forall a. Const * a
lookupCF
MkT1
Nothing
[]
solveEqualities: running solver wanted = WC {}
newNoTcEvBinds unique = aXG
solveWanteds {
Level = 1
WC {}
solveSimpleWanteds { {}
solveSimpleWanteds end }
iterations = 1
residual = WC {}
solveWanteds }
final wc = WC {}
current evbinds = {}
unflattenGivens []
End solveEqualities }
newNoTcEvBinds unique = aXH
kindGeneralise1 T1
kindGeneralize
T1
DV {dv_kvs = {}, dv_tvs = {}, dv_cvs = {}}
quantifyTyVars 1
0
DV {dv_kvs = {}, dv_tvs = {}, dv_cvs = {}}
{a_aWN}
quantifyTyVars 2
globals: {a_aWN}
mono_tvs: {a_aWN}
nondep:
dep:
dep_kvs'
nondep_tvs'
tcConDecl 2
[MkT1]
[]
tcConDecl 2 [MkT1]
tcDataDefn
T1
[spec (a_aWN)]
[]
---- tcTyClDecl end ---- } T1
Starting synonym cycle check [T1]
Done synonym cycle check [T1]
Starting validity check [T1]
Starting validity for tycon T1
checkValidTyCon
T1
Nothing
cvtc1 T1
cvtc2 T1
checkValidDataCon
MkT1
T1
[a_aWN]
T1 @a_aWN :: Const * a_aWN
T1 :: forall a. Const * a
Adding error:
T16391a.hs:14:3: error:
• Data constructor ‘MkT1’ returns type ‘T1’
instead of an instance of its parent type ‘T1 @a’
• In the definition of data constructor ‘MkT1’
In the data type declaration for ‘T1’
attemptM recovering with insoluble constraints WC {}
Aborted validity for tycon T1
Done validity check [T1[tc], MkT1[tc]]
---- end tcTyClGroup ---- }
tcAddTyCons
tycons [T1[tc], MkT1[tc]]
implicits []
tcExtendKindEnvList []
tc_extend_local_env []
Adding instances:
addFamInsts
tcAddTyCons
tycons []
implicits []
tcExtendKindEnvList []
tc_extend_local_env []
---- tcTyClGroup ---- {
Decls for [T2]
tcExtendKindEnv
[rq0 :-> APromotionErr TyConPE, rrZ :-> APromotionErr RecDataConPE]
---- kcTyClGroup ---- {
module T16391a
data T2 :: Const Type a_as6 -> Type where MkT2 :: T2 b_aWM
getInitialKinds {
getInitialKinds done }
tcExtendKindEnvList []
solveEqualities { level = 1
getInitialKinds {
newMetaKindVar k_aXN[tau:1]
newTyVarTyVar a_aXO[tyv:1]
bindImplicitTKBndrs
[a_as6]
[a_aXO[tyv:1]]
tc_extend_local_env
[(a_as6, Type variable ‘a_as6’ = a_aXO[tyv:1] :: k_aXN[tau:1])]
tcExtendBinderStack [a_as6 a_aXO[tyv:1]]
bindExplicTKBndrs []
solveLocalEqualitiesX { Called from tcLHsKindSig
lk1 Const
tcInferApps {
Const
[Type, a_as6]
tcInferApps (vis normal app)
[vis] *
Type
*
[TCvSubst In scope: InScope {} Type env: [] Co env: []]
lk1 Type
tcInferApps {
Type
[]
tcInferApps } * :: *
checkExpectedKind
*
*
checkExpectedKindX
Type
act_kind': *
exp_kind: *
tcInferApps (vis normal app) 2 *
tcInferApps (vis normal app)
[vis] *
a_as6
*
[TCvSubst In scope: InScope {} Type env: [] Co env: []]
lk1 a_as6
tcInferApps {
a_as6
[]
tcInferApps } a_aXO[tyv:1] :: k_aXN[tau:1]
checkExpectedKind
a_aXO[tyv:1]
k_aXN[tau:1]
checkExpectedKindX
a_as6
act_kind': k_aXN[tau:1]
exp_kind: *
u_tys
tclvl 1
k_aXN[tau:1] ~ *
arising from a type equality k_aXN[tau:1] ~ *
u_tys
tclvl 1
* ~ *
arising from a kind equality arising from k_aXN[tau:1] ~ *
u_tys
tclvl 1
'GHC.Types.LiftedRep ~ 'GHC.Types.LiftedRep
arising from a kind equality arising from k_aXN[tau:1] ~ *
u_tys yields no coercion
u_tys yields no coercion
uUnfilledVar2 ok
k_aXN[tau:1] :: *
* :: *
True
<*>_N
writeMetaTyVar k_aXN[tau:1] :: * := *
u_tys yields no coercion
checkExpectedKind
k_aXN[tau:1]
*
<*>_N
tcInferApps (vis normal app) 2 *
tcInferApps } Const * a_aXO[tyv:1] :: *
checkExpectedKind
Const * a_aXO[tyv:1]
*
checkExpectedKindX
Const Type a_as6
act_kind': *
exp_kind: *
lk1 Type
tcInferApps {
Type
[]
tcInferApps } * :: *
checkExpectedKind
*
*
checkExpectedKindX
Type
act_kind': *
exp_kind: *
checkExpectedKind
Const * a_aXO[tyv:1] -> *
*
checkExpectedKindX
Const Type a_as6 -> Type
act_kind': *
exp_kind: *
solveLocalEqualities: running solver WC {}
newNoTcEvBinds unique = aXP
solveWanteds {
Level = 1
WC {}
solveSimpleWanteds { {}
solveSimpleWanteds end }
iterations = 1
residual = WC {}
solveWanteds }
final wc = WC {}
current evbinds = {}
unflattenGivens []
solveLocalEqualitiesX end } residual_wanted = WC {}
tcLHsKindSig
Const Type a_as6 -> Type
Const * a_aXO[tyv:1] -> *
checkValidType Const * a_aXO[tyv:1] -> * :: *
done ct Const * a_aXO[tyv:1] -> *
Ambiguity check for Const * a_aXO[tyv:1] -> *
tcSubType_NC
the kind annotation on the declaration for ‘T2’
Const * a_aXO[tyv:1] -> *
Const * a_aXO[tyv:1] -> *
tc_sub_tc_type (general case)
ty_actual = Const * a_aXO[tyv:1] -> *
ty_expected = Const * a_aXO[tyv:1] -> *
tcSkolemise
tc_sub_type_ds
ty_actual = Const * a_aXO[tyv:1] -> *
ty_expected = Const * a_aXO[tyv:1] -> *
tc_sub_type_ds
ty_actual = *
ty_expected = *
deeply_instantiate final subst
origin: arising from a type equality Const * a_aXO[tyv:1] -> *
~
Const * a_aXO[tyv:1] -> *
type: *
new type: *
subst: [TCvSubst In scope: InScope {} Type env: [] Co env: []]
u_tys
tclvl 1
* ~ *
arising from a type equality Const * a_aXO[tyv:1] -> *
~
Const * a_aXO[tyv:1] -> *
u_tys yields no coercion
tc_sub_tc_type (general case)
ty_actual = Const * a_aXO[tyv:1]
ty_expected = Const * a_aXO[tyv:1]
tcSkolemise
tc_sub_type_ds
ty_actual = Const * a_aXO[tyv:1]
ty_expected = Const * a_aXO[tyv:1]
deeply_instantiate final subst
origin: arising from a type expected by the context:
Const * a_aXO[tyv:1]
type: Const * a_aXO[tyv:1]
new type: Const * a_aXO[tyv:1]
subst: [TCvSubst In scope: InScope {a_aXO} Type env: [] Co env: []]
u_tys
tclvl 1
Const * a_aXO[tyv:1] ~ Const * a_aXO[tyv:1]
arising from a type equality Const * a_aXO[tyv:1] -> *
~
Const * a_aXO[tyv:1] -> *
u_tys
tclvl 1
'GHC.Types.LiftedRep ~ 'GHC.Types.LiftedRep
arising from a type equality Const * a_aXO[tyv:1] -> *
~
Const * a_aXO[tyv:1] -> *
u_tys yields no coercion
u_tys yields no coercion
simplifyAmbiguityCheck {
type = Const * a_aXO[tyv:1] -> *
wanted = WC {}
newTcEvBinds unique = aXQ
solveWanteds {
Level = 1
WC {}
solveSimpleWanteds { {}
solveSimpleWanteds end }
iterations = 1
residual = WC {}
solveWanteds }
final wc = WC {}
current evbinds = {}
unflattenGivens []
End simplifyAmbiguityCheck }
reportUnsolved(ambig) {
newTcEvBinds unique = aXR
reportUnsolved(ambig) }
Done ambiguity check for Const * a_aXO[tyv:1] -> *
checkValidType done Const * a_aXO[tyv:1] -> * :: *
tcLHsKindSig2 Const * a_aXO[tyv:1] -> *
kcLHsQTyVars: not-cusk
T2
[a_as6]
[]
[a_aXO[tyv:1]]
[]
Const * a_aXO[tyv:1] -> *
getInitialKinds done }
kcTyClGroup: initial kinds T2 :: Const * a_aXO[tyv:1] -> *
tcExtendKindEnvList
[(T2, ATcTyCon T2[tc] :: Const * a_aXO[tyv:1] -> *)]
kcTyClDecl { T2
newMetaKindVar k_aXT[tau:1]
newTyVarTyVar b_aXU[tyv:1]
bindImplicitTKBndrs
[b_aWM]
[b_aXU[tyv:1]]
tc_extend_local_env
[(b_aWM, Type variable ‘b_aWM’ = b_aXU[tyv:1] :: k_aXT[tau:1])]
tcExtendBinderStack [b_aWM b_aXU[tyv:1]]
bindExplicTKBndrs []
newAnonMetaTyVar t_aXV[tau:1]
lk1 T2
tcInferApps {
T2
[b_aWM]
tcInferApps (vis normal app)
[vis] Const * a_aXO[tyv:1]
b_aWM
Const * a_aXO[tyv:1]
[TCvSubst In scope: InScope {a_aXO} Type env: [] Co env: []]
lk1 b_aWM
tcInferApps {
b_aWM
[]
tcInferApps } b_aXU[tyv:1] :: k_aXT[tau:1]
checkExpectedKind
b_aXU[tyv:1]
k_aXT[tau:1]
checkExpectedKindX
b_aWM
act_kind': k_aXT[tau:1]
exp_kind: Const * a_aXO[tyv:1]
u_tys
tclvl 1
k_aXT[tau:1] ~ Const * a_aXO[tyv:1]
arising from a type equality k_aXT[tau:1] ~ Const * a_aXO[tyv:1]
u_tys
tclvl 1
* ~ *
arising from a kind equality arising from
k_aXT[tau:1] ~ Const * a_aXO[tyv:1]
u_tys
tclvl 1
'GHC.Types.LiftedRep ~ 'GHC.Types.LiftedRep
arising from a kind equality arising from
k_aXT[tau:1] ~ Const * a_aXO[tyv:1]
u_tys yields no coercion
u_tys yields no coercion
uUnfilledVar2 ok
k_aXT[tau:1] :: *
Const * a_aXO[tyv:1] :: *
True
<*>_N
writeMetaTyVar k_aXT[tau:1] :: * := Const * a_aXO[tyv:1]
u_tys yields no coercion
checkExpectedKind
k_aXT[tau:1]
Const * a_aXO[tyv:1]
<Const * a_aXO[tyv:1]>_N
tcInferApps (vis normal app) 2 Const * a_aXO[tyv:1]
tcInferApps } T2 b_aXU[tyv:1] :: *
checkExpectedKind
T2 b_aXU[tyv:1]
*
checkExpectedKindX
T2 b_aWM
act_kind': *
exp_kind: TYPE t_aXV[tau:1]
u_tys
tclvl 1
* ~ TYPE t_aXV[tau:1]
arising from a type equality * ~ TYPE t_aXV[tau:1]
u_tys
tclvl 1
'GHC.Types.LiftedRep ~ t_aXV[tau:1]
arising from a type equality * ~ TYPE t_aXV[tau:1]
u_tys
tclvl 1
GHC.Types.RuntimeRep ~ GHC.Types.RuntimeRep
arising from a kind equality arising from
t_aXV[tau:1] ~ 'GHC.Types.LiftedRep
u_tys yields no coercion
uUnfilledVar2 ok
t_aXV[tau:1] :: GHC.Types.RuntimeRep
'GHC.Types.LiftedRep :: GHC.Types.RuntimeRep
True
<GHC.Types.RuntimeRep>_N
writeMetaTyVar
t_aXV[tau:1] :: GHC.Types.RuntimeRep := 'GHC.Types.LiftedRep
u_tys yields no coercion
u_tys yields no coercion
checkExpectedKind
*
TYPE t_aXV[tau:1]
<*>_N
kcTyClDecl done } T2
solveEqualities: running solver wanted = WC {}
newNoTcEvBinds unique = aXW
solveWanteds {
Level = 1
WC {}
solveSimpleWanteds { {}
solveSimpleWanteds end }
iterations = 1
residual = WC {}
solveWanteds }
final wc = WC {}
current evbinds = {}
unflattenGivens []
End solveEqualities }
newNoTcEvBinds unique = aXX
Skolemising a_aXO[tyv:1] := a_aXO[sk:1]
writeMetaTyVar a_aXO[tyv:1] :: * := a_aXO[sk:1]
quantifyTyVars 1
0
DV {dv_kvs = {}, dv_tvs = {}, dv_cvs = {}}
{}
quantifyTyVars 2
globals: {}
mono_tvs: {}
nondep:
dep:
dep_kvs'
nondep_tvs'
generaliseTcTyCon: before zonkRec
spec_req_tvs = a_aXO[sk:1]
inferred =
generaliseTcTyCon: post zonk
tycon = T2[tc]
inferred =
ze = ZE {ze_tv_env = [aXO :-> a_as6]
ze_id_env = []}
spec_req_prs = [(a_as6, a_aXO[tyv:1])]
spec_req_tvs = a_aXO[sk:1]
final_spec_req_tvs = a_as6
generaliseTcTyCon done
tycon = T2[tc]
tc_res_kind = Const * a_as6 -> *
dep_fv_set = {a_as6}
final_spec_req_tvs = a_as6
inferred =
specified = a_as6
required_tcbs = []
final_tcbs = [spec (a_as6)]
---- kcTyClGroup end ---- } T2 :: forall a. Const * a -> *
tcTyAndCl generalized kinds
(T2, [spec (a_as6)], Const * a_as6 -> * True)
tcExtendKindEnvList
[(T2, ATcTyCon T2[tc] :: forall a. Const * a -> *)]
---- tcTyClDecl ---- {
data T2 :: Const Type a_as6 -> Type where MkT2 :: T2 b_aWM
bindTyClTyVars
T2 [spec (a_as6)]
[(a_as6, a_as6)]
tc_extend_local_env [(a_as6, Type variable ‘a_as6’ = a_as6 :: *)]
tcExtendBinderStack [a_as6 a_as6]
solveEqualities { level = 1
solveEqualities: running solver wanted = WC {}
newNoTcEvBinds unique = aXZ
solveWanteds {
Level = 1
WC {}
solveSimpleWanteds { {}
solveSimpleWanteds end }
iterations = 1
residual = WC {}
solveWanteds }
final wc = WC {}
current evbinds = {}
unflattenGivens []
End solveEqualities }
newNoTcEvBinds unique = aY0
tcConDecl 1 gadt [MkT2]
solveEqualities { level = 1
newMetaKindVar k_aY1[tau:1]
bindImplicitTKBndrs
[b_aWM]
[b_aWM[sk:1]]
tc_extend_local_env
[(b_aWM, Type variable ‘b_aWM’ = b_aWM[sk:1] :: k_aY1[tau:1])]
tcExtendBinderStack [b_aWM b_aWM[sk:1]]
bindExplicTKBndrs []
lk1 T2
tcInferApps {
T2
[b_aWM]
tcInferApps (need to instantiate)
@a_as6
[TCvSubst In scope: InScope {} Type env: [] Co env: []]
cloneAnonMetaTyVar a_aY2[tau:1]
tcInferApps (vis normal app)
[vis] Const * a_as6
b_aWM
Const * a_as6
[TCvSubst
In scope: InScope {a_aY2}
Type env: [as6 :-> a_aY2[tau:1]]
Co env: []]
lk1 b_aWM
tcInferApps {
b_aWM
[]
tcInferApps } b_aWM[sk:1] :: k_aY1[tau:1]
checkExpectedKind
b_aWM[sk:1]
k_aY1[tau:1]
checkExpectedKindX
b_aWM
act_kind': k_aY1[tau:1]
exp_kind: Const * a_aY2[tau:1]
u_tys
tclvl 1
k_aY1[tau:1] ~ Const * a_aY2[tau:1]
arising from a type equality k_aY1[tau:1] ~ Const * a_aY2[tau:1]
u_tys
tclvl 1
* ~ *
arising from a kind equality arising from
k_aY1[tau:1] ~ Const * a_aY2[tau:1]
u_tys
tclvl 1
'GHC.Types.LiftedRep ~ 'GHC.Types.LiftedRep
arising from a kind equality arising from
k_aY1[tau:1] ~ Const * a_aY2[tau:1]
u_tys yields no coercion
u_tys yields no coercion
uUnfilledVar2 ok
k_aY1[tau:1] :: *
Const * a_aY2[tau:1] :: *
True
<*>_N
writeMetaTyVar k_aY1[tau:1] :: * := Const * a_aY2[tau:1]
u_tys yields no coercion
checkExpectedKind
k_aY1[tau:1]
Const * a_aY2[tau:1]
<Const * a_aY2[tau:1]>_N
tcInferApps (vis normal app) 2 Const * a_aY2[tau:1]
tcInferApps } T2 @a_aY2[tau:1] b_aWM[sk:1] :: *
lookupCF
MkT2
Nothing
[]
solveEqualities: running solver wanted = WC {}
newNoTcEvBinds unique = aY3
solveWanteds {
Level = 1
WC {}
solveSimpleWanteds { {}
solveSimpleWanteds end }
iterations = 1
residual = WC {}
solveWanteds }
final wc = WC {}
current evbinds = {}
unflattenGivens []
End solveEqualities }
newNoTcEvBinds unique = aY4
kindGeneralise1
forall (b :: Const * a_aY2[tau:1]). T2 @a_aY2[tau:1] b
kindGeneralize
forall (b :: Const * a_aY2[tau:1]). T2 @a_aY2[tau:1] b
DV {dv_kvs = {a_aY2[tau:1]}, dv_tvs = {}, dv_cvs = {}}
quantifyTyVars 1
0
DV {dv_kvs = {a_aY2[tau:1]}, dv_tvs = {}, dv_cvs = {}}
{a_as6}
Skolemising a_aY2[tau:1] := a_aY2[sk:1]
writeMetaTyVar a_aY2[tau:1] :: * := a_aY2[sk:1]
quantifyTyVars 2
globals: {a_as6}
mono_tvs: {a_as6}
nondep:
dep: a_aY2[tau:1]
dep_kvs' a_aY2[sk:1]
nondep_tvs'
tcConDecl 2
[MkT2]
[]
tcConDecl 2 [MkT2]
tcDataDefn
T2
[spec (a_as6)]
[anon-vis (b_aYa)]
---- tcTyClDecl end ---- } T2
Starting synonym cycle check [T2]
Done synonym cycle check [T2]
Starting validity check [T2]
Starting validity for tycon T2
checkValidTyCon
T2
Nothing
cvtc1 T2
cvtc2 T2
checkValidDataCon
MkT2
T2
[a_as6, b_aYa]
T2 @a_as6 b_aYa :: *
T2 @a_aY2 b_aWM :: *
checkValidDataCon 2 forall {a} (b :: Const * a). T2 @a b
checkValidType forall {a} (b :: Const * a). T2 @a b :: *
check_type
forall {a} (b :: Const * a). T2 @a b
True
done ct forall {a} (b :: Const * a). T2 @a b
Ambiguity check for forall {a} (b :: Const * a). T2 @a b
tcSubType_NC
the type of the constructor ‘MkT2’
forall {a} (b :: Const * a). T2 @a b
forall {a} (b :: Const * a). T2 @a b
tc_sub_tc_type (general case)
ty_actual = forall {a} (b :: Const * a). T2 @a b
ty_expected = forall {a} (b :: Const * a). T2 @a b
tcSkolemise
pushLevelAndCaptureConstraints { 1
tc_sub_type_ds
ty_actual = forall {a} (b :: Const * a). T2 @a b
ty_expected = T2 @a_aYc[sk:1] b_aYd[sk:1]
cloneAnonMetaTyVar a_aYe[tau:1]
cloneAnonMetaTyVar b_aYf[tau:1]
Instantiating
all tyvars? True
origin arising from a type equality forall {a} (b :: Const * a).
T2 @a b
~
forall {a} (b :: Const * a). T2 @a b
type forall {a_aY2} @b_aWM. T2 @a_aY2 b_aWM
theta []
leave_bndrs []
with a_aYe[tau:1]
b_aYf[tau:1]
theta: []
tc_sub_type_ds
ty_actual = T2 @a_aYe[tau:1] b_aYf[tau:1]
ty_expected = T2 @a_aYc[sk:1] b_aYd[sk:1]
deeply_instantiate final subst
origin: arising from a type equality forall {a} (b :: Const * a).
T2 @a b
~
forall {a} (b :: Const * a). T2 @a b
type: T2 @a_aYe[tau:1] b_aYf[tau:1]
new type: T2 @a_aYe[tau:1] b_aYf[tau:1]
subst: [TCvSubst
In scope: InScope {a_aYe b_aYf}
Type env: []
Co env: []]
u_tys
tclvl 1
T2 @a_aYe[tau:1] b_aYf[tau:1] ~ T2 @a_aYc[sk:1] b_aYd[sk:1]
arising from a type equality T2 @a_aYe[tau:1] b_aYf[tau:1]
~
T2 @a_aYc[sk:1] b_aYd[sk:1]
u_tys
tclvl 1
a_aYe[tau:1] ~ a_aYc[sk:1]
arising from a type equality T2 @a_aYe[tau:1] b_aYf[tau:1]
~
T2 @a_aYc[sk:1] b_aYd[sk:1]
u_tys
tclvl 1
* ~ *
arising from a kind equality arising from
a_aYe[tau:1] ~ a_aYc[sk:1]
u_tys yields no coercion
uUnfilledVar2 ok
a_aYe[tau:1] :: *
a_aYc[sk:1] :: *
True
<*>_N
writeMetaTyVar a_aYe[tau:1] :: * := a_aYc[sk:1]
u_tys yields no coercion
u_tys
tclvl 1
b_aYf[tau:1] ~ b_aYd[sk:1]
arising from a type equality T2 @a_aYe[tau:1] b_aYf[tau:1]
~
T2 @a_aYc[sk:1] b_aYd[sk:1]
u_tys
tclvl 1
Const * a_aYc[sk:1] ~ Const * a_aYe[tau:1]
arising from a kind equality arising from
b_aYf[tau:1] ~ b_aYd[sk:1]
u_tys
tclvl 1
'GHC.Types.LiftedRep ~ 'GHC.Types.LiftedRep
arising from a kind equality arising from
b_aYf[tau:1] ~ b_aYd[sk:1]
u_tys yields no coercion
u_tys yields no coercion
uUnfilledVar2 ok
b_aYf[tau:1] :: Const * a_aYe[tau:1]
b_aYd[sk:1] :: Const * a_aYc[sk:1]
True
<*>_N
writeMetaTyVar b_aYf[tau:1] :: Const * a_aYe[tau:1] := b_aYd[sk:1]
u_tys yields no coercion
u_tys yields no coercion
pushLevelAndCaptureConstraints } 1
checkConstraints
1
[a_aYc[sk:1], b_aYd[sk:1]]
simplifyAmbiguityCheck {
type = forall {a} (b :: Const * a). T2 @a b
wanted = WC {}
newTcEvBinds unique = aYg
solveWanteds {
Level = 0
WC {}
solveSimpleWanteds { {}
solveSimpleWanteds end }
iterations = 1
residual = WC {}
solveWanteds }
final wc = WC {}
current evbinds = {}
unflattenGivens []
End simplifyAmbiguityCheck }
reportUnsolved(ambig) {
newTcEvBinds unique = aYh
reportUnsolved(ambig) }
Done ambiguity check for forall {a} (b :: Const * a). T2 @a b
checkValidType done forall {a} (b :: Const * a). T2 @a b :: *
Done validity of data con
MkT2
Datacon user type: forall {a} (b :: Const * a). T2 @a b
Datacon rep type: forall {a} (b :: Const * a). T2 @a b
Rep typcon binders: [spec (a_as6), anon-vis (b_aYa)]
not family
Done validity for tycon T2
Done validity check [T2]
---- end tcTyClGroup ---- }
tcAddTyCons
tycons [T2]
implicits [Data constructor ‘MkT2’, Identifier ‘T16391a.MkT2’]
tcExtendKindEnvList []
tc_extend_local_env []
Adding instances:
addFamInsts
tcAddTyCons
tycons []
implicits []
tcExtendKindEnvList []
tc_extend_local_env []
simplifyTop { wanted = WC {}
newTcEvBinds unique = aYi
solveWanteds {
Level = 0
WC {}
solveSimpleWanteds { {}
solveSimpleWanteds end }
iterations = 1
residual = WC {}
solveWanteds }
final wc = WC {}
current evbinds = {}
unflattenGivens []
End simplifyTop }
newTcEvBinds unique = aYj
reportUnsolved (unsafe overlapping) {
reportUnsolved (unsafe overlapping) }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment