Commit 948af945 authored by simonpj@microsoft.com's avatar simonpj@microsoft.com
Browse files

Simple fix for Trac #1199 (pls merge to branch)

parent f70052e9
......@@ -600,18 +600,19 @@ reifyTyCon tc
reifyTyCon tc
= do { cxt <- reifyCxt (tyConStupidTheta tc)
; cons <- mapM reifyDataCon (tyConDataCons tc)
; let tvs = tyConTyVars tc
; cons <- mapM (reifyDataCon (mkTyVarTys tvs)) (tyConDataCons tc)
; let name = reifyName tc
tvs = reifyTyVars (tyConTyVars tc)
r_tvs = reifyTyVars tvs
deriv = [] -- Don't know about deriving
decl | isNewTyCon tc = TH.NewtypeD cxt name tvs (head cons) deriv
| otherwise = TH.DataD cxt name tvs cons deriv
decl | isNewTyCon tc = TH.NewtypeD cxt name r_tvs (head cons) deriv
| otherwise = TH.DataD cxt name r_tvs cons deriv
; return (TH.TyConI decl) }
reifyDataCon :: DataCon -> TcM TH.Con
reifyDataCon dc
reifyDataCon :: [Type] -> DataCon -> TcM TH.Con
reifyDataCon tys dc
| isVanillaDataCon dc
= do { arg_tys <- reifyTypes (dataConOrigArgTys dc)
= do { arg_tys <- reifyTypes (dataConInstOrigArgTys dc tys)
; let stricts = map reifyStrict (dataConStrictMarks dc)
fields = dataConFieldLabels dc
name = reifyName dc
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment