Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC

Commits:

22 changed files:

Changes:

  • compiler/GHC/Hs/Decls.hs
    ... ... @@ -482,12 +482,12 @@ instance NoAnn AnnSynDecl where
    482 482
     
    
    483 483
     ------------- Pretty printing FamilyDecls -----------
    
    484 484
     
    
    485
    -pprFlavour :: FamilyInfo pass -> SDoc
    
    486
    -pprFlavour DataFamily            = text "data"
    
    487
    -pprFlavour OpenTypeFamily        = text "type"
    
    485
    +pprFlavour :: FamilyInfo (GhcPass pass) -> SDoc
    
    486
    +pprFlavour DataFamily {}         = text "data"
    
    487
    +pprFlavour OpenTypeFamily {}     = text "type"
    
    488 488
     pprFlavour (ClosedTypeFamily {}) = text "type"
    
    489 489
     
    
    490
    -instance Outputable (FamilyInfo pass) where
    
    490
    +instance Outputable (FamilyInfo (GhcPass pass)) where
    
    491 491
       ppr info = pprFlavour info <+> text "family"
    
    492 492
     
    
    493 493
     
    
    ... ... @@ -642,8 +642,8 @@ tyClDeclFlavour (ClassDecl {}) = ClassFlavour
    642 642
     tyClDeclFlavour (SynDecl {})     = TypeSynonymFlavour
    
    643 643
     tyClDeclFlavour (FamDecl { tcdFam = FamilyDecl { fdInfo = info }})
    
    644 644
       = case info of
    
    645
    -      DataFamily          -> OpenFamilyFlavour (IAmData DataType) Nothing
    
    646
    -      OpenTypeFamily      -> OpenFamilyFlavour IAmType Nothing
    
    645
    +      DataFamily {}       -> OpenFamilyFlavour (IAmData DataType) Nothing
    
    646
    +      OpenTypeFamily {}   -> OpenFamilyFlavour IAmType Nothing
    
    647 647
           ClosedTypeFamily {} -> ClosedTypeFamilyFlavour
    
    648 648
     tyClDeclFlavour (DataDecl { tcdDataDefn = HsDataDefn { dd_cons = nd } })
    
    649 649
       = case dataDefnConsNewOrData nd of
    
    ... ... @@ -742,6 +742,11 @@ resultVariableName _ = Nothing
    742 742
     type instance XCInjectivityAnn  (GhcPass _) = TokRarrow
    
    743 743
     type instance XXInjectivityAnn  (GhcPass _) = DataConCantHappen
    
    744 744
     
    
    745
    +type instance XDataFamily       (GhcPass _) = NoExtField
    
    746
    +type instance XOpenTypeFamily   (GhcPass _) = NoExtField
    
    747
    +type instance XClosedTypeFamily (GhcPass _) = NoExtField
    
    748
    +type instance XXFamilyInfo      (GhcPass _) = DataConCantHappen
    
    749
    +
    
    745 750
     instance OutputableBndrId p
    
    746 751
            => Outputable (FamilyDecl (GhcPass p)) where
    
    747 752
       ppr (FamilyDecl { fdInfo = info, fdLName = ltycon
    
    ... ... @@ -768,7 +773,7 @@ instance OutputableBndrId p
    768 773
                        hsep [ vbar, ppr lhs, arrow, hsep (map ppr rhs) ]
    
    769 774
                      Nothing -> empty
    
    770 775
           (pp_where, pp_eqns) = case info of
    
    771
    -        ClosedTypeFamily mb_eqns ->
    
    776
    +        ClosedTypeFamily _ mb_eqns ->
    
    772 777
               ( text "where"
    
    773 778
               , case mb_eqns of
    
    774 779
                   Nothing   -> text ".."
    

  • compiler/GHC/Hs/Utils.hs
    ... ... @@ -1543,15 +1543,15 @@ hsLTyClDeclBinders (L loc (DataDecl { tcdLName = (L _ name)
    1543 1543
     
    
    1544 1544
     familyInfoTyConFlavour
    
    1545 1545
       :: Maybe tc    -- ^ Just cls <=> this is an associated family of class cls
    
    1546
    -  -> FamilyInfo pass
    
    1546
    +  -> FamilyInfo (GhcPass pass)
    
    1547 1547
       -> TyConFlavour tc
    
    1548 1548
     familyInfoTyConFlavour mb_parent_tycon info =
    
    1549 1549
       case info of
    
    1550
    -    DataFamily         -> OpenFamilyFlavour (IAmData DataType) mb_parent_tycon
    
    1551
    -    OpenTypeFamily     -> OpenFamilyFlavour IAmType mb_parent_tycon
    
    1552
    -    ClosedTypeFamily _ -> assert (isNothing mb_parent_tycon)
    
    1553
    -                          -- See Note [Closed type family mb_parent_tycon]
    
    1554
    -                          ClosedTypeFamilyFlavour
    
    1550
    +    DataFamily _         -> OpenFamilyFlavour (IAmData DataType) mb_parent_tycon
    
    1551
    +    OpenTypeFamily _     -> OpenFamilyFlavour IAmType mb_parent_tycon
    
    1552
    +    ClosedTypeFamily _ _ -> assert (isNothing mb_parent_tycon)
    
    1553
    +                            -- See Note [Closed type family mb_parent_tycon]
    
    1554
    +                            ClosedTypeFamilyFlavour
    
    1555 1555
     
    
    1556 1556
     -------------------
    
    1557 1557
     hsForeignDeclsBinders :: forall p a. (UnXRec (GhcPass p), IsSrcSpanAnn p a)
    

  • compiler/GHC/HsToCore/Quote.hs
    ... ... @@ -554,19 +554,19 @@ repFamilyDecl decl@(L loc (FamilyDecl { fdInfo = info
    554 554
            ; dec <- addQTyVarBinds ReuseBoundNames tvs $ \bndrs ->
    
    555 555
                     addSimpleTyVarBinds ReuseBoundNames (maybeToList res_tv) $
    
    556 556
                case info of
    
    557
    -             ClosedTypeFamily Nothing ->
    
    557
    +             ClosedTypeFamily _ Nothing ->
    
    558 558
                      notHandled (ThAbstractClosedTypeFamily decl)
    
    559
    -             ClosedTypeFamily (Just eqns) ->
    
    559
    +             ClosedTypeFamily _ (Just eqns) ->
    
    560 560
                    do { eqns1  <- mapM (repTyFamEqn . unLoc) eqns
    
    561 561
                       ; eqns2  <- coreListM tySynEqnTyConOcc eqns1
    
    562 562
                       ; result <- repFamilyResultSig resultSig
    
    563 563
                       ; inj    <- repInjectivityAnn injectivity
    
    564 564
                       ; repClosedFamilyD tc1 bndrs result inj eqns2 }
    
    565
    -             OpenTypeFamily ->
    
    565
    +             OpenTypeFamily _ ->
    
    566 566
                    do { result <- repFamilyResultSig resultSig
    
    567 567
                       ; inj    <- repInjectivityAnn injectivity
    
    568 568
                       ; repOpenFamilyD tc1 bndrs result inj }
    
    569
    -             DataFamily ->
    
    569
    +             DataFamily _ ->
    
    570 570
                    do { kind <- repFamilyResultSigToMaybeKind resultSig
    
    571 571
                       ; repDataFamilyD tc1 bndrs kind }
    
    572 572
            ; return (locA loc, dec)
    

  • compiler/GHC/Iface/Ext/Ast.hs
    ... ... @@ -1669,7 +1669,7 @@ instance ToHie (LocatedA (FamilyDecl GhcRn)) where
    1669 1669
               injSpan = maybe NoScope (mkScope . getLocA) inj
    
    1670 1670
     
    
    1671 1671
     instance ToHie (FamilyInfo GhcRn) where
    
    1672
    -  toHie (ClosedTypeFamily (Just eqns)) = concatM $
    
    1672
    +  toHie (ClosedTypeFamily _ (Just eqns)) = concatM $
    
    1673 1673
         [ concatMapM (locOnly . getLocA) eqns
    
    1674 1674
         , toHie $ map go eqns
    
    1675 1675
         ]
    

  • compiler/GHC/Parser.y
    ... ... @@ -1389,7 +1389,7 @@ ty_decl :: { LTyClDecl GhcPs }
    1389 1389
               -- data/newtype family
    
    1390 1390
             | 'data' 'family' type opt_datafam_kind_sig
    
    1391 1391
                  {% do { let { tdcolon = fst $ unLoc $4 }
    
    1392
    -                   ; mkFamDecl (comb4 $1 $2 $3 $4) DataFamily TopLevel $3
    
    1392
    +                   ; mkFamDecl (comb4 $1 $2 $3 $4) (DataFamily noExtField) TopLevel $3
    
    1393 1393
                                        (snd $ unLoc $4) Nothing
    
    1394 1394
                                (AnnFamilyDecl [] [] noAnn (epTok $1) (epTok $2) tdcolon noAnn noAnn noAnn noAnn noAnn noAnn) }}
    
    1395 1395
     
    
    ... ... @@ -1523,10 +1523,10 @@ inj_varids :: { Located [LocatedN RdrName] }
    1523 1523
     -- Closed type families
    
    1524 1524
     
    
    1525 1525
     where_type_family :: { Located ((EpToken "where", (EpToken "{", EpToken "..", EpToken "}")),FamilyInfo GhcPs) }
    
    1526
    -        : {- empty -}                      { noLoc (noAnn,OpenTypeFamily) }
    
    1526
    +        : {- empty -}                      { noLoc (noAnn,OpenTypeFamily noExtField) }
    
    1527 1527
             | 'where' ty_fam_inst_eqn_list
    
    1528 1528
                    { sLL $1 $> ((epTok $1,(fst $ unLoc $2))
    
    1529
    -                    ,ClosedTypeFamily (fmap reverse $ snd $ unLoc $2)) }
    
    1529
    +                    , ClosedTypeFamily noExtField (fmap reverse $ snd $ unLoc $2)) }
    
    1530 1530
     
    
    1531 1531
     ty_fam_inst_eqn_list :: { Located ((EpToken "{", EpToken "..", EpToken "}"),Maybe [LTyFamInstEqn GhcPs]) }
    
    1532 1532
             :     '{' ty_fam_inst_eqns '}'     { sLL $1 $> ((epTok $1,noAnn, epTok $3)
    
    ... ... @@ -1578,7 +1578,7 @@ at_decl_cls :: { LHsDecl GhcPs }
    1578 1578
             :  -- data family declarations, with optional 'family' keyword
    
    1579 1579
               'data' opt_family type opt_datafam_kind_sig
    
    1580 1580
                  {% do { let { tdcolon = fst $ unLoc $4 }
    
    1581
    -                   ; liftM mkTyClD (mkFamDecl (comb3 $1 $3 $4) DataFamily NotTopLevel $3
    
    1581
    +                   ; liftM mkTyClD (mkFamDecl (comb3 $1 $3 $4) (DataFamily noExtField) NotTopLevel $3
    
    1582 1582
                                                       (snd $ unLoc $4) Nothing
    
    1583 1583
                                (AnnFamilyDecl [] [] noAnn (epTok $1) $2 tdcolon noAnn noAnn noAnn noAnn noAnn noAnn)) }}
    
    1584 1584
     
    
    ... ... @@ -1587,14 +1587,14 @@ at_decl_cls :: { LHsDecl GhcPs }
    1587 1587
             | 'type' type opt_at_kind_inj_sig
    
    1588 1588
                 {% do { let { (tdcolon, tequal, tvbar) = fst $ unLoc $3 }
    
    1589 1589
                       ; liftM mkTyClD
    
    1590
    -                        (mkFamDecl (comb3 $1 $2 $3) OpenTypeFamily NotTopLevel $2
    
    1590
    +                        (mkFamDecl (comb3 $1 $2 $3) (OpenTypeFamily noExtField) NotTopLevel $2
    
    1591 1591
                                        (fst . snd $ unLoc $3)
    
    1592 1592
                                        (snd . snd $ unLoc $3)
    
    1593 1593
                              (AnnFamilyDecl [] [] (epTok $1) noAnn noAnn tdcolon tequal tvbar noAnn noAnn noAnn noAnn)) }}
    
    1594 1594
             | 'type' 'family' type opt_at_kind_inj_sig
    
    1595 1595
                 {% do { let { (tdcolon, tequal, tvbar) = fst $ unLoc $4 }
    
    1596 1596
                       ; liftM mkTyClD
    
    1597
    -                        (mkFamDecl (comb3 $1 $3 $4) OpenTypeFamily NotTopLevel $3
    
    1597
    +                        (mkFamDecl (comb3 $1 $3 $4) (OpenTypeFamily noExtField) NotTopLevel $3
    
    1598 1598
                                        (fst . snd $ unLoc $4)
    
    1599 1599
                                        (snd . snd $ unLoc $4)
    
    1600 1600
                                (AnnFamilyDecl [] [] (epTok $1) noAnn (epTok $2) tdcolon tequal tvbar noAnn noAnn noAnn noAnn)) }}
    

  • compiler/GHC/Parser/PostProcess.hs
    ... ... @@ -384,8 +384,8 @@ mkFamDecl loc info topLevel lhs ksig injAnn annsIn
    384 384
                                                , fdInjectivityAnn = injAnn }))) }
    
    385 385
       where
    
    386 386
         equals_or_where = case info of
    
    387
    -                        DataFamily          -> empty
    
    388
    -                        OpenTypeFamily      -> empty
    
    387
    +                        DataFamily {}       -> empty
    
    388
    +                        OpenTypeFamily {}   -> empty
    
    389 389
                             ClosedTypeFamily {} -> whereDots
    
    390 390
     
    
    391 391
     mkSpliceDecl :: LHsExpr GhcPs -> (LHsDecl GhcPs)
    

  • compiler/GHC/Rename/Module.hs
    ... ... @@ -2437,15 +2437,15 @@ rnFamDecl mb_cls (FamilyDecl { fdLName = tycon, fdTyVars = tyvars
    2437 2437
     
    
    2438 2438
          ----------------------
    
    2439 2439
          rn_info :: FamilyInfo GhcPs -> RnM (FamilyInfo GhcRn, FreeNames)
    
    2440
    -     rn_info (ClosedTypeFamily (Just eqns))
    
    2440
    +     rn_info (ClosedTypeFamily x (Just eqns))
    
    2441 2441
            = do { (eqns', fvs)
    
    2442 2442
                     <- rnList (rnTyFamInstEqn (NonAssocTyFamEqn ClosedTyFam)) eqns
    
    2443 2443
                                               -- no class context
    
    2444
    -            ; return (ClosedTypeFamily (Just eqns'), fvs) }
    
    2445
    -     rn_info (ClosedTypeFamily Nothing)
    
    2446
    -       = return (ClosedTypeFamily Nothing, emptyFNs)
    
    2447
    -     rn_info OpenTypeFamily = return (OpenTypeFamily, emptyFNs)
    
    2448
    -     rn_info DataFamily     = return (DataFamily, emptyFNs)
    
    2444
    +            ; return (ClosedTypeFamily x (Just eqns'), fvs) }
    
    2445
    +     rn_info (ClosedTypeFamily x Nothing)
    
    2446
    +       = return (ClosedTypeFamily x Nothing, emptyFNs)
    
    2447
    +     rn_info (OpenTypeFamily x) = return (OpenTypeFamily x, emptyFNs)
    
    2448
    +     rn_info (DataFamily x)     = return (DataFamily x, emptyFNs)
    
    2449 2449
     
    
    2450 2450
     rnFamResultSig :: HsDocContext
    
    2451 2451
                    -> FamilyResultSig GhcPs
    

  • compiler/GHC/Tc/TyCl.hs
    ... ... @@ -2196,7 +2196,7 @@ kcTyClDecl (FamDecl _ (FamilyDecl { fdInfo = fd_info })) fam_tc
    2196 2196
     -- closed type families look at their equations, but other families don't
    
    2197 2197
     -- do anything here
    
    2198 2198
       = case fd_info of
    
    2199
    -      ClosedTypeFamily (Just eqns) -> mapM_ (kcTyFamInstEqn fam_tc) eqns
    
    2199
    +      ClosedTypeFamily _ (Just eqns) -> mapM_ (kcTyFamInstEqn fam_tc) eqns
    
    2200 2200
           _ -> return ()
    
    2201 2201
     
    
    2202 2202
     -------------------
    
    ... ... @@ -3387,7 +3387,7 @@ tcFamDecl1 parent (FamilyDecl { fdInfo = fam_info
    3387 3387
                                   , fdLName = tc_lname@(L _ tc_name)
    
    3388 3388
                                   , fdResultSig = L _ sig
    
    3389 3389
                                   , fdInjectivityAnn = inj })
    
    3390
    -  | DataFamily <- fam_info
    
    3390
    +  | DataFamily _ <- fam_info
    
    3391 3391
       = bindTyClTyVarsAndZonk tc_name $ \ kind tc_bndrs nb_eta res_kind -> do
    
    3392 3392
       { traceTc "tcFamDecl1 data family:" (ppr tc_name)
    
    3393 3393
       ; checkFamFlag tc_name
    
    ... ... @@ -3413,7 +3413,7 @@ tcFamDecl1 parent (FamilyDecl { fdInfo = fam_info
    3413 3413
                                   parent inj
    
    3414 3414
       ; return (tycon, []) }
    
    3415 3415
     
    
    3416
    -  | OpenTypeFamily <- fam_info
    
    3416
    +  | OpenTypeFamily _ <- fam_info
    
    3417 3417
       = bindTyClTyVarsAndZonk tc_name $ \ kind tc_bndrs _nb_eta res_kind -> do
    
    3418 3418
       { traceTc "tcFamDecl1 open type family:" (ppr tc_name)
    
    3419 3419
       ; checkFamFlag tc_name
    
    ... ... @@ -3424,7 +3424,7 @@ tcFamDecl1 parent (FamilyDecl { fdInfo = fam_info
    3424 3424
                                    parent inj'
    
    3425 3425
       ; return (tycon, []) }
    
    3426 3426
     
    
    3427
    -  | ClosedTypeFamily mb_eqns <- fam_info
    
    3427
    +  | ClosedTypeFamily _ mb_eqns <- fam_info
    
    3428 3428
       = -- Closed type families are a little tricky, because they contain the definition
    
    3429 3429
         -- of both the type family and the equations for a CoAxiom.
    
    3430 3430
         do { traceTc "tcFamDecl1 Closed type family:" (ppr tc_name)
    

  • compiler/GHC/ThToHs.hs
    ... ... @@ -373,7 +373,7 @@ cvtDec (DataFamilyD tc tvs kind)
    373 373
       = do { (_, tc', tvs') <- cvt_tycl_hdr [] tc tvs
    
    374 374
            ; result <- cvtMaybeKindToFamilyResultSig kind
    
    375 375
            ; returnJustLA $ TyClD noExtField $ FamDecl noExtField $
    
    376
    -         FamilyDecl noAnn DataFamily TopLevel tc' tvs' Prefix result Nothing }
    
    376
    +         FamilyDecl noAnn (DataFamily noExtField) TopLevel tc' tvs' Prefix result Nothing }
    
    377 377
     
    
    378 378
     cvtDec (DataInstD ctxt bndrs tys ksig constrs derivs)
    
    379 379
       = do { (ctxt', tc', bndrs', typats') <- cvt_datainst_hdr ctxt bndrs tys
    
    ... ... @@ -427,14 +427,14 @@ cvtDec (TySynInstD eqn)
    427 427
     cvtDec (OpenTypeFamilyD head)
    
    428 428
       = do { (tc', tyvars', result', injectivity') <- cvt_tyfam_head head
    
    429 429
            ; returnJustLA $ TyClD noExtField $ FamDecl noExtField $
    
    430
    -         FamilyDecl noAnn OpenTypeFamily TopLevel tc' tyvars' Prefix result' injectivity'
    
    430
    +         FamilyDecl noAnn (OpenTypeFamily noExtField) TopLevel tc' tyvars' Prefix result' injectivity'
    
    431 431
            }
    
    432 432
     
    
    433 433
     cvtDec (ClosedTypeFamilyD head eqns)
    
    434 434
       = do { (tc', tyvars', result', injectivity') <- cvt_tyfam_head head
    
    435 435
            ; eqns' <- mapM cvtTySynEqn eqns
    
    436 436
            ; returnJustLA $ TyClD noExtField $ FamDecl noExtField $
    
    437
    -         FamilyDecl noAnn (ClosedTypeFamily (Just eqns')) TopLevel tc' tyvars' Prefix
    
    437
    +         FamilyDecl noAnn (ClosedTypeFamily noExtField (Just eqns')) TopLevel tc' tyvars' Prefix
    
    438 438
                                result' injectivity' }
    
    439 439
     
    
    440 440
     cvtDec (TH.RoleAnnotD tc roles)
    

  • compiler/Language/Haskell/Syntax/Decls.hs
    ... ... @@ -503,15 +503,15 @@ isFamilyDecl _other = False
    503 503
     -- | type family declaration
    
    504 504
     isTypeFamilyDecl :: TyClDecl pass -> Bool
    
    505 505
     isTypeFamilyDecl (FamDecl _ (FamilyDecl { fdInfo = info })) = case info of
    
    506
    -  OpenTypeFamily      -> True
    
    506
    +  OpenTypeFamily {}   -> True
    
    507 507
       ClosedTypeFamily {} -> True
    
    508 508
       _                   -> False
    
    509 509
     isTypeFamilyDecl _ = False
    
    510 510
     
    
    511 511
     -- | open type family info
    
    512 512
     isOpenTypeFamilyInfo :: FamilyInfo pass -> Bool
    
    513
    -isOpenTypeFamilyInfo OpenTypeFamily = True
    
    514
    -isOpenTypeFamilyInfo _              = False
    
    513
    +isOpenTypeFamilyInfo OpenTypeFamily {} = True
    
    514
    +isOpenTypeFamilyInfo _                 = False
    
    515 515
     
    
    516 516
     -- | closed type family info
    
    517 517
     isClosedTypeFamilyInfo :: FamilyInfo pass -> Bool
    
    ... ... @@ -520,7 +520,7 @@ isClosedTypeFamilyInfo _ = False
    520 520
     
    
    521 521
     -- | data family declaration
    
    522 522
     isDataFamilyDecl :: TyClDecl pass -> Bool
    
    523
    -isDataFamilyDecl (FamDecl _ (FamilyDecl { fdInfo = DataFamily })) = True
    
    523
    +isDataFamilyDecl (FamDecl _ (FamilyDecl { fdInfo = DataFamily _ })) = True
    
    524 524
     isDataFamilyDecl _other      = False
    
    525 525
     
    
    526 526
     -- Dealing with names
    
    ... ... @@ -771,11 +771,12 @@ data InjectivityAnn pass
    771 771
       | XInjectivityAnn !(XXInjectivityAnn pass)
    
    772 772
     
    
    773 773
     data FamilyInfo pass
    
    774
    -  = DataFamily
    
    775
    -  | OpenTypeFamily
    
    774
    +  = DataFamily (XDataFamily pass)
    
    775
    +  | OpenTypeFamily (XOpenTypeFamily pass)
    
    776 776
          -- | 'Nothing' if we're in an hs-boot file and the user
    
    777 777
          -- said "type family Foo x where .."
    
    778
    -  | ClosedTypeFamily (Maybe [LTyFamInstEqn pass])
    
    778
    +  | ClosedTypeFamily (XClosedTypeFamily pass) (Maybe [LTyFamInstEqn pass])
    
    779
    +  | XFamilyInfo !(XXFamilyInfo pass)
    
    779 780
     
    
    780 781
     {- Note [Closed type family mb_parent_tycon]
    
    781 782
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    

  • compiler/Language/Haskell/Syntax/Extension.hs
    ... ... @@ -473,6 +473,13 @@ type family XXRoleAnnotDecl x
    473 473
     type family XCInjectivityAnn  x
    
    474 474
     type family XXInjectivityAnn  x
    
    475 475
     
    
    476
    +-- -------------------------------------
    
    477
    +-- FamilyInfo type families
    
    478
    +type family XDataFamily       x
    
    479
    +type family XOpenTypeFamily   x
    
    480
    +type family XClosedTypeFamily x
    
    481
    +type family XXFamilyInfo      x
    
    482
    +
    
    476 483
     -- =====================================================================
    
    477 484
     -- Type families for the HsModule extension points
    
    478 485
     
    

  • testsuite/tests/haddock/should_compile_flag_haddock/T17544.stderr
    ... ... @@ -930,7 +930,8 @@
    930 930
                 (EpTok
    
    931 931
                  (EpaSpan { <no location info> }))
    
    932 932
                 (EpTok (EpaSpan { <no location info> })))
    
    933
    -           (DataFamily)
    
    933
    +           (DataFamily
    
    934
    +            (NoExtField))
    
    934 935
                (NotTopLevel)
    
    935 936
                (L
    
    936 937
                 (EpAnn
    
    ... ... @@ -1325,7 +1326,8 @@
    1325 1326
                 (EpTok
    
    1326 1327
                  (EpaSpan { <no location info> }))
    
    1327 1328
                 (EpTok (EpaSpan { <no location info> })))
    
    1328
    -           (DataFamily)
    
    1329
    +           (DataFamily
    
    1330
    +            (NoExtField))
    
    1329 1331
                (NotTopLevel)
    
    1330 1332
                (L
    
    1331 1333
                 (EpAnn
    
    ... ... @@ -1720,7 +1722,8 @@
    1720 1722
                 (EpTok
    
    1721 1723
                  (EpaSpan { <no location info> }))
    
    1722 1724
                 (EpTok (EpaSpan { <no location info> })))
    
    1723
    -           (DataFamily)
    
    1725
    +           (DataFamily
    
    1726
    +            (NoExtField))
    
    1724 1727
                (NotTopLevel)
    
    1725 1728
                (L
    
    1726 1729
                 (EpAnn
    
    ... ... @@ -2115,7 +2118,8 @@
    2115 2118
                 (EpTok
    
    2116 2119
                  (EpaSpan { <no location info> }))
    
    2117 2120
                 (EpTok (EpaSpan { <no location info> })))
    
    2118
    -           (DataFamily)
    
    2121
    +           (DataFamily
    
    2122
    +            (NoExtField))
    
    2119 2123
                (NotTopLevel)
    
    2120 2124
                (L
    
    2121 2125
                 (EpAnn
    
    ... ... @@ -2510,7 +2514,8 @@
    2510 2514
                 (EpTok
    
    2511 2515
                  (EpaSpan { <no location info> }))
    
    2512 2516
                 (EpTok (EpaSpan { <no location info> })))
    
    2513
    -           (DataFamily)
    
    2517
    +           (DataFamily
    
    2518
    +            (NoExtField))
    
    2514 2519
                (NotTopLevel)
    
    2515 2520
                (L
    
    2516 2521
                 (EpAnn
    
    ... ... @@ -2905,7 +2910,8 @@
    2905 2910
                 (EpTok
    
    2906 2911
                  (EpaSpan { <no location info> }))
    
    2907 2912
                 (EpTok (EpaSpan { <no location info> })))
    
    2908
    -           (DataFamily)
    
    2913
    +           (DataFamily
    
    2914
    +            (NoExtField))
    
    2909 2915
                (NotTopLevel)
    
    2910 2916
                (L
    
    2911 2917
                 (EpAnn
    

  • testsuite/tests/parser/should_compile/DumpParsedAst.stderr
    ... ... @@ -364,6 +364,7 @@
    364 364
              (EpaSpan { <no location info> }))
    
    365 365
             (EpTok (EpaSpan { <no location info> })))
    
    366 366
            (ClosedTypeFamily
    
    367
    +        (NoExtField)
    
    367 368
             (Just
    
    368 369
              [(L
    
    369 370
                (EpAnn
    
    ... ... @@ -1148,6 +1149,7 @@
    1148 1149
              (EpaSpan { <no location info> }))
    
    1149 1150
             (EpTok (EpaSpan { <no location info> })))
    
    1150 1151
            (ClosedTypeFamily
    
    1152
    +        (NoExtField)
    
    1151 1153
             (Just
    
    1152 1154
              [(L
    
    1153 1155
                (EpAnn
    
    ... ... @@ -1545,7 +1547,8 @@
    1545 1547
             (EpTok
    
    1546 1548
              (EpaSpan { <no location info> }))
    
    1547 1549
             (EpTok (EpaSpan { <no location info> })))
    
    1548
    -       (DataFamily)
    
    1550
    +       (DataFamily
    
    1551
    +        (NoExtField))
    
    1549 1552
            (TopLevel)
    
    1550 1553
            (L
    
    1551 1554
             (EpAnn
    

  • testsuite/tests/parser/should_compile/DumpRenamedAst.stderr
    ... ... @@ -311,6 +311,7 @@
    311 311
                (EpaSpan { <no location info> }))
    
    312 312
               (EpTok (EpaSpan { <no location info> })))
    
    313 313
              (ClosedTypeFamily
    
    314
    +          (NoExtField)
    
    314 315
               (Just
    
    315 316
                [(L
    
    316 317
                  (EpAnn
    
    ... ... @@ -798,7 +799,8 @@
    798 799
               (EpTok
    
    799 800
                (EpaSpan { <no location info> }))
    
    800 801
               (EpTok (EpaSpan { <no location info> })))
    
    801
    -         (DataFamily)
    
    802
    +         (DataFamily
    
    803
    +          (NoExtField))
    
    802 804
              (TopLevel)
    
    803 805
              (L
    
    804 806
               (EpAnn
    
    ... ... @@ -1183,6 +1185,7 @@
    1183 1185
                (EpaSpan { <no location info> }))
    
    1184 1186
               (EpTok (EpaSpan { <no location info> })))
    
    1185 1187
              (ClosedTypeFamily
    
    1188
    +          (NoExtField)
    
    1186 1189
               (Just
    
    1187 1190
                [(L
    
    1188 1191
                  (EpAnn
    
    ... ... @@ -1766,7 +1769,8 @@
    1766 1769
                   (EpTok
    
    1767 1770
                    (EpaSpan { <no location info> }))
    
    1768 1771
                   (EpTok (EpaSpan { <no location info> })))
    
    1769
    -             (OpenTypeFamily)
    
    1772
    +             (OpenTypeFamily
    
    1773
    +              (NoExtField))
    
    1770 1774
                  (NotTopLevel)
    
    1771 1775
                  (L
    
    1772 1776
                   (EpAnn
    

  • testsuite/tests/parser/should_compile/KindSigs.stderr
    ... ... @@ -113,6 +113,7 @@
    113 113
              (EpaSpan { <no location info> }))
    
    114 114
             (EpTok (EpaSpan { <no location info> })))
    
    115 115
            (ClosedTypeFamily
    
    116
    +        (NoExtField)
    
    116 117
             (Just
    
    117 118
              [(L
    
    118 119
                (EpAnn
    

  • utils/check-exact/ExactPrint.hs
    ... ... @@ -3844,7 +3844,7 @@ instance ExactPrint (FamilyDecl GhcPs) where
    3844 3844
               return (vb', Just inj')
    
    3845 3845
         (w', oc', dd', cc', info') <-
    
    3846 3846
                  case info of
    
    3847
    -               ClosedTypeFamily mb_eqns -> do
    
    3847
    +               ClosedTypeFamily x mb_eqns -> do
    
    3848 3848
                      w' <- markEpToken w
    
    3849 3849
                      oc' <- markEpToken oc
    
    3850 3850
                      (dd', mb_eqns') <-
    
    ... ... @@ -3856,7 +3856,7 @@ instance ExactPrint (FamilyDecl GhcPs) where
    3856 3856
                            eqns' <- mapM markAnnotated eqns
    
    3857 3857
                            return (dd, Just eqns')
    
    3858 3858
                      cc' <- markEpToken cc
    
    3859
    -                 return (w',oc',dd',cc', ClosedTypeFamily mb_eqns')
    
    3859
    +                 return (w',oc',dd',cc', ClosedTypeFamily x mb_eqns')
    
    3860 3860
                    _ -> return (w,oc,dd,cc, info)
    
    3861 3861
         return (FamilyDecl { fdExt = AnnFamilyDecl [] [] t' d' f' dc' eq' vb' w' oc' dd' cc'
    
    3862 3862
                            , fdInfo = info'
    
    ... ... @@ -3890,8 +3890,8 @@ instance ExactPrint (FamilyDecl GhcPs) where
    3890 3890
     
    
    3891 3891
     
    
    3892 3892
     exactFlavour :: (Monad m, Monoid w) => (EpToken "data", EpToken "type") -> FamilyInfo GhcPs -> EP w m (EpToken "data", EpToken "type")
    
    3893
    -exactFlavour (td,tt) DataFamily            = (\td' -> (td',tt)) <$> markEpToken td
    
    3894
    -exactFlavour (td,tt) OpenTypeFamily        = (td,)              <$> markEpToken tt
    
    3893
    +exactFlavour (td,tt) DataFamily {}         = (\td' -> (td',tt)) <$> markEpToken td
    
    3894
    +exactFlavour (td,tt) OpenTypeFamily {}     = (td,)              <$> markEpToken tt
    
    3895 3895
     exactFlavour (td,tt) (ClosedTypeFamily {}) = (td,)              <$> markEpToken tt
    
    3896 3896
     
    
    3897 3897
     -- ---------------------------------------------------------------------
    

  • utils/haddock/haddock-api/src/Haddock/Backends/Hoogle.hs
    ... ... @@ -254,7 +254,7 @@ ppFam sDocContext decl@(FamilyDecl{fdInfo = info}) =
    254 254
         decl' = case info of
    
    255 255
           -- We don't need to print out a closed type family's equations
    
    256 256
           -- for Hoogle, so pretend it doesn't have any.
    
    257
    -      ClosedTypeFamily{} -> decl{fdInfo = OpenTypeFamily}
    
    257
    +      ClosedTypeFamily{} -> decl{fdInfo = OpenTypeFamily noExtField}
    
    258 258
           _ -> decl
    
    259 259
     
    
    260 260
     ppInstance :: DynFlags -> UnitState -> ClsInst -> [String]
    

  • utils/haddock/haddock-api/src/Haddock/Backends/LaTeX.hs
    ... ... @@ -373,11 +373,11 @@ ppFamDecl associated doc instances decl@(FamDecl{}) unicode =
    373 373
         body = Maybe.catMaybes [familyEqns, documentationToLaTeX doc]
    
    374 374
     
    
    375 375
         whereBit = case fdInfo (tcdFam decl) of
    
    376
    -      ClosedTypeFamily _ -> keyword "where"
    
    376
    +      ClosedTypeFamily _ _ -> keyword "where"
    
    377 377
           _ -> empty
    
    378 378
     
    
    379 379
         familyEqns
    
    380
    -      | FamilyDecl{fdInfo = ClosedTypeFamily (Just eqns)} <- tcdFam decl
    
    380
    +      | FamilyDecl{fdInfo = ClosedTypeFamily _ (Just eqns)} <- tcdFam decl
    
    381 381
           , not (null eqns) =
    
    382 382
               Just
    
    383 383
                 ( text "\\haddockbeginargs"
    
    ... ... @@ -429,9 +429,9 @@ ppFamHeader
    429 429
         famly leader <+> famName <+> famSig <+> injAnn
    
    430 430
         where
    
    431 431
           leader = case info of
    
    432
    -        OpenTypeFamily -> keyword "type"
    
    433
    -        ClosedTypeFamily _ -> keyword "type"
    
    434
    -        DataFamily -> keyword "data"
    
    432
    +        OpenTypeFamily _ -> keyword "type"
    
    433
    +        ClosedTypeFamily _ _ -> keyword "type"
    
    434
    +        DataFamily _ -> keyword "data"
    
    435 435
     
    
    436 436
           famly
    
    437 437
             | associated = id
    

  • utils/haddock/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs
    ... ... @@ -548,7 +548,7 @@ ppFamDecl summary associated links instances fixities loc doc decl splice unicod
    548 548
             ppFamHeader summary associated decl unicode qual <+> ppFixities fixities qual
    
    549 549
     
    
    550 550
         instancesBit
    
    551
    -      | FamilyDecl{fdInfo = ClosedTypeFamily mb_eqns} <- decl
    
    551
    +      | FamilyDecl{fdInfo = ClosedTypeFamily _ mb_eqns} <- decl
    
    552 552
           , not summary =
    
    553 553
               subEquations pkg qual $ map (ppFamDeclEqn . unLoc) $ Maybe.fromMaybe [] mb_eqns
    
    554 554
           | otherwise =
    
    ... ... @@ -603,7 +603,7 @@ ppFamHeader
    603 603
           ]
    
    604 604
         where
    
    605 605
           whereBit = case info of
    
    606
    -        ClosedTypeFamily _ -> keyword "where ..."
    
    606
    +        ClosedTypeFamily _ _ -> keyword "where ..."
    
    607 607
             _ -> noHtml
    
    608 608
     
    
    609 609
           injAnn = case injectivity of
    
    ... ... @@ -622,9 +622,9 @@ ppFamilyLeader :: Bool -> FamilyInfo DocNameI -> Html
    622 622
     ppFamilyLeader assoc info = keyword (typ ++ if assoc then "" else " family")
    
    623 623
       where
    
    624 624
         typ = case info of
    
    625
    -      OpenTypeFamily -> "type"
    
    626
    -      ClosedTypeFamily _ -> "type"
    
    627
    -      DataFamily -> "data"
    
    625
    +      OpenTypeFamily _ -> "type"
    
    626
    +      ClosedTypeFamily _ _ -> "type"
    
    627
    +      DataFamily _ -> "data"
    
    628 628
     
    
    629 629
     -- | Print the signature attached to a family
    
    630 630
     ppResultSig :: FamilyResultSig DocNameI -> Unicode -> Qualification -> Html
    

  • utils/haddock/haddock-api/src/Haddock/Convert.hs
    ... ... @@ -306,20 +306,20 @@ synifyTyCon _prr _coax tc
    306 306
       | Just flav <- famTyConFlav_maybe tc =
    
    307 307
           case flav of
    
    308 308
             DataFamilyTyCon{} ->
    
    309
    -          mkFamDecl DataFamily
    
    310
    -        OpenTypeFamilyTyCon -> mkFamDecl OpenTypeFamily
    
    309
    +          mkFamDecl (DataFamily noExtField)
    
    310
    +        OpenTypeFamilyTyCon -> mkFamDecl (OpenTypeFamily noExtField)
    
    311 311
             ClosedTypeFamilyTyCon ctf ->
    
    312 312
               case ctf of
    
    313 313
                 CTF mb
    
    314 314
                   | Just (CoAxiom{co_ax_branches = branches}) <- mb
    
    315 315
                   -> mkFamDecl $
    
    316
    -                   ClosedTypeFamily $
    
    316
    +                   ClosedTypeFamily noExtField $
    
    317 317
                          Just $
    
    318 318
                            map (noLocA . synifyAxBranch tc) (fromBranches branches)
    
    319 319
                   | otherwise
    
    320
    -              -> mkFamDecl $ ClosedTypeFamily $ Just []
    
    321
    -            CTF_BuiltIn {} -> mkFamDecl $ ClosedTypeFamily $ Just []
    
    322
    -            CTF_Abstract -> mkFamDecl $ ClosedTypeFamily Nothing
    
    320
    +              -> mkFamDecl $ ClosedTypeFamily noExtField $ Just []
    
    321
    +            CTF_BuiltIn {} -> mkFamDecl $ ClosedTypeFamily noExtField $ Just []
    
    322
    +            CTF_Abstract -> mkFamDecl $ ClosedTypeFamily noExtField Nothing
    
    323 323
       where
    
    324 324
         resultVar = tyConFamilyResVar_maybe tc
    
    325 325
         mkFamDecl i =
    

  • utils/haddock/haddock-api/src/Haddock/Interface/Rename.hs
    ... ... @@ -686,12 +686,12 @@ renameFamilyDecl
    686 686
           )
    
    687 687
     
    
    688 688
     renameFamilyInfo :: FamilyInfo GhcRn -> RnM (FamilyInfo DocNameI)
    
    689
    -renameFamilyInfo DataFamily = return DataFamily
    
    690
    -renameFamilyInfo OpenTypeFamily = return OpenTypeFamily
    
    691
    -renameFamilyInfo (ClosedTypeFamily eqns) =
    
    689
    +renameFamilyInfo (DataFamily x) = return (DataFamily x)
    
    690
    +renameFamilyInfo (OpenTypeFamily x) = return (OpenTypeFamily x)
    
    691
    +renameFamilyInfo (ClosedTypeFamily x eqns) =
    
    692 692
       do
    
    693 693
         eqns' <- mapM (mapM (mapM renameTyFamInstEqn)) eqns
    
    694
    -    return $ ClosedTypeFamily eqns'
    
    694
    +    return $ ClosedTypeFamily x eqns'
    
    695 695
     
    
    696 696
     renameDataDefn :: HsDataDefn GhcRn -> RnM (HsDataDefn DocNameI)
    
    697 697
     renameDataDefn
    

  • utils/haddock/haddock-api/src/Haddock/Types.hs
    ... ... @@ -1036,6 +1036,11 @@ type instance XSplicePat DocNameI = DataConCantHappen
    1036 1036
     
    
    1037 1037
     type instance XCInjectivityAnn DocNameI = NoExtField
    
    1038 1038
     
    
    1039
    +type instance XDataFamily       DocNameI = NoExtField
    
    1040
    +type instance XOpenTypeFamily   DocNameI = NoExtField
    
    1041
    +type instance XClosedTypeFamily DocNameI = NoExtField
    
    1042
    +type instance XXFamilyInfo      DocNameI = DataConCantHappen
    
    1043
    +
    
    1039 1044
     type instance XCFunDep DocNameI = NoExtField
    
    1040 1045
     
    
    1041 1046
     type instance XCTyFamInstDecl DocNameI = NoExtField