Commit c738b123 authored by Matthew Pickering's avatar Matthew Pickering Committed by Ben Gamari

Replace [PostTc id Type] with PostTc id [Type]

This gives a clearer indication as to what gets filled in
when. It was suggested by Richard on D1152.

Test Plan: ./validate

Reviewers: austin, goldfire, bgamari

Reviewed By: goldfire, bgamari

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D1245
parent b89c4913
......@@ -712,7 +712,9 @@ cvtl e = wrapL (cvt e)
; return $ RecordCon c' noPostTcExpr (HsRecFields flds' Nothing)}
cvt (RecUpdE e flds) = do { e' <- cvtl e
; flds' <- mapM cvtFld flds
; return $ RecordUpd e' (HsRecFields flds' Nothing) [] [] [] }
; return $ RecordUpd e'
(HsRecFields flds' Nothing)
PlaceHolder PlaceHolder PlaceHolder }
cvt (StaticE e) = fmap HsStatic $ cvtl e
{- Note [Dropping constructors]
......
......@@ -293,11 +293,12 @@ data HsExpr id
(HsRecordBinds id)
-- (HsMatchGroup Id) -- Filled in by the type checker to be
-- -- a match that does the job
[DataCon] -- Filled in by the type checker to the
-- _non-empty_ list of DataCons that have
-- all the upd'd fields
[PostTc id Type] -- Argument types of *input* record type
[PostTc id Type] -- and *output* record type
(PostTc id [DataCon])
-- Filled in by the type checker to the
-- _non-empty_ list of DataCons that have
-- all the upd'd fields
(PostTc id [Type]) -- Argument types of *input* record type
(PostTc id [Type]) -- and *output* record type
-- For a type family, the arg types are of the *instance* tycon,
-- not the family tycon
......
......@@ -12,6 +12,7 @@ import NameSet
import RdrName
import Var
import Coercion
import DataCon (DataCon)
import Data.Data hiding ( Fixity )
import BasicTypes (Fixity)
......@@ -102,4 +103,6 @@ type DataId id =
, Data (PostTc id Type)
, Data (PostTc id Coercion)
, Data (PostTc id [Type])
, Data (PostTc id [DataCon])
)
......@@ -1178,7 +1178,8 @@ mkRecConstrOrUpdate (L l (HsVar c)) _ (fs,dd)
| isRdrDataCon c
= return (RecordCon (L l c) noPostTcExpr (mk_rec_fields fs dd))
mkRecConstrOrUpdate exp _ (fs,dd)
= return (RecordUpd exp (mk_rec_fields fs dd) [] [] [])
= return (RecordUpd exp (mk_rec_fields fs dd)
PlaceHolder PlaceHolder PlaceHolder)
mk_rec_fields :: [LHsRecField id arg] -> Bool -> HsRecFields id arg
mk_rec_fields fs False = HsRecFields { rec_flds = fs, rec_dotdot = Nothing }
......
......@@ -258,7 +258,7 @@ rnExpr (RecordCon con_id _ rbinds)
rnExpr (RecordUpd expr rbinds _ _ _)
= do { (expr', fvExpr) <- rnLExpr expr
; (rbinds', fvRbinds) <- rnHsRecBinds HsRecFieldUpd rbinds
; return (RecordUpd expr' rbinds' [] [] [],
; return (RecordUpd expr' rbinds' PlaceHolder PlaceHolder PlaceHolder,
fvExpr `plusFV` fvRbinds) }
rnExpr (ExprWithTySig expr pty PlaceHolder)
......
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