[Git][ghc/ghc][wip/jacco/ast] fixup! ttg: Use List instead of Bag in AST for LHsBindsLR

Rodrigo Mesquita (@alt-romes) gitlab at gitlab.haskell.org
Mon Jun 10 08:25:26 UTC 2024



Rodrigo Mesquita pushed to branch wip/jacco/ast at Glasgow Haskell Compiler / GHC


Commits:
a1276759 by Rodrigo Mesquita at 2024-06-10T10:24:57+02:00
fixup! ttg: Use List instead of Bag in AST for LHsBindsLR

- - - - -


1 changed file:

- utils/check-exact/Utils.hs


Changes:

=====================================
utils/check-exact/Utils.hs
=====================================
@@ -486,7 +486,7 @@ hsDeclsClassDecl dec = case dec of
       decls
           = orderedDecls sortKey $ Map.fromList
               [(ClsSigTag,    map (\(L l s) -> (srs l, L l (SigD noExtField s))) sigs),
-               (ClsMethodTag, map (\(L l s) -> (srs l, L l (ValD noExtField s))) (bagToList methods)),
+               (ClsMethodTag, map (\(L l s) -> (srs l, L l (ValD noExtField s))) methods),
                (ClsAtTag,     map (\(L l s) -> (srs l, L l (TyClD noExtField $ FamDecl noExtField s))) ats),
                (ClsAtdTag,    map (\(L l s) -> (srs l, L l (InstD noExtField $ TyFamInstD noExtField s))) at_defs)
               ]
@@ -510,12 +510,12 @@ partitionWithSortKey
       [LTyFamInstDecl GhcPs], [LDataFamInstDecl GhcPs], [LDocDecl GhcPs])
 partitionWithSortKey = go
   where
-    go [] = ([], emptyBag, [], [], [], [], [])
+    go [] = ([], [], [], [], [], [], [])
     go ((L l decl) : ds) =
       let (tags, bs, ss, ts, tfis, dfis, docs) = go ds in
       case decl of
         ValD _ b
-          -> (ClsMethodTag:tags, L l b `consBag` bs, ss, ts, tfis, dfis, docs)
+          -> (ClsMethodTag:tags, L l b : bs, ss, ts, tfis, dfis, docs)
         SigD _ s
           -> (ClsSigTag:tags, bs, L l s : ss, ts, tfis, dfis, docs)
         TyClD _ (FamDecl _ t)
@@ -553,7 +553,7 @@ hsDeclsLocalBinds :: HsLocalBinds GhcPs -> [LHsDecl GhcPs]
 hsDeclsLocalBinds lb = case lb of
     HsValBinds _ (ValBinds sortKey bs sigs) ->
       let
-        bds = map wrapDecl (bagToList bs)
+        bds = map wrapDecl bs
         sds = map wrapSig sigs
       in
         orderedDeclsBinds sortKey bds sds
@@ -564,7 +564,7 @@ hsDeclsLocalBinds lb = case lb of
 hsDeclsValBinds :: (HsValBindsLR GhcPs GhcPs) -> [LHsDecl GhcPs]
 hsDeclsValBinds (ValBinds sortKey bs sigs) =
       let
-        bds = map wrapDecl (bagToList bs)
+        bds = map wrapDecl bs
         sds = map wrapSig sigs
       in
         orderedDeclsBinds sortKey bds sds



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/a127675955f154e7e49fd6e0141484d3bfd25e14

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/a127675955f154e7e49fd6e0141484d3bfd25e14
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20240610/f699e7b5/attachment-0001.html>


More information about the ghc-commits mailing list