[Git][ghc/ghc][wip/ttg-booleanformula] 2 commits: made fromIfaceBooleanFormula local

Hassan Al-Awwadi (@hassan.awwadi) gitlab at gitlab.haskell.org
Mon Oct 28 17:48:37 UTC 2024



Hassan Al-Awwadi pushed to branch wip/ttg-booleanformula at Glasgow Haskell Compiler / GHC


Commits:
1ed93755 by Hassan Al-Awwadi at 2024-10-28T17:15:37+01:00
made fromIfaceBooleanFormula local

- - - - -
01d86e8f by Hassan Al-Awwadi at 2024-10-28T18:48:22+01:00
no Haddock style comment here

- - - - -


2 changed files:

- compiler/GHC/Iface/Syntax.hs
- compiler/GHC/IfaceToCore.hs


Changes:

=====================================
compiler/GHC/Iface/Syntax.hs
=====================================
@@ -37,7 +37,6 @@ module GHC.Iface.Syntax (
         ifaceDeclFingerprints,
         fromIfaceWarnings,
         fromIfaceWarningTxt,
-        fromIfaceBooleanFormula,
         -- Free Names
         freeNamesIfDecl, freeNamesIfRule, freeNamesIfFamInst,
         freeNamesIfConDecls,
@@ -224,17 +223,6 @@ data IfaceBooleanFormula
   | IfParens IfaceBooleanFormula
   deriving Eq
 
--- | note that this makes unbound names, so if you actually want
--- proper Names, you'll need to properly Rename it (lookupIfaceTop).
--- You want proper Names for most things, except pretty printing
--- and the like.
-fromIfaceBooleanFormula :: IfaceBooleanFormula -> BooleanFormula GhcRn
-fromIfaceBooleanFormula = go
-  where
-   go (IfVar nm   ) = Var    $ noLocA . mkUnboundName . mkVarOccFS . ifLclNameFS $ nm
-   go (IfAnd bfs  ) = And    $ map (noLocA . go) bfs
-   go (IfOr bfs   ) = Or     $ map (noLocA . go) bfs
-   go (IfParens bf) = Parens $     (noLocA . go) bf
 
 data IfaceTyConParent
   = IfNoParent
@@ -1056,6 +1044,13 @@ pprIfaceDecl ss (IfaceClass { ifName  = clas
           (\_ def -> let fs = getOccFS def in cparen (isLexSym fs) (ppr fs)) 0 minDef <+>
         text "#-}"
 
+      fromIfaceBooleanFormula :: IfaceBooleanFormula -> BooleanFormula GhcRn
+      fromIfaceBooleanFormula = go
+        where
+         go (IfVar nm   ) = Var    $ noLocA . mkUnboundName . mkVarOccFS . ifLclNameFS $ nm
+         go (IfAnd bfs  ) = And    $ map (noLocA . go) bfs
+         go (IfOr bfs   ) = Or     $ map (noLocA . go) bfs
+         go (IfParens bf) = Parens $     (noLocA . go) bf
 
 
       -- See Note [Suppressing binder signatures] in GHC.Iface.Type


=====================================
compiler/GHC/IfaceToCore.hs
=====================================
@@ -313,7 +313,7 @@ mergeIfaceDecl d1 d2
     -- we merge, see 'mergeSignatures'
     | otherwise              = d1 `withRolesFrom` d2
       where
-        -- | the reason we need to duplicate mkOr here, instead of
+        -- The reason we need to duplicate mkOr here, instead of
         -- using BooleanFormula's mkOr and just doing the loop like:
         -- `toIfaceBooleanFormula . mkOr . fromIfaceBooleanFormula`
         -- is quite subtle. Say we have the following minimal pragma:



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/31f8781e90f6c1fa484f356f77f0ac0df19c895a...01d86e8fbaab6759b499c1aa6bdd880574760984

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/31f8781e90f6c1fa484f356f77f0ac0df19c895a...01d86e8fbaab6759b499c1aa6bdd880574760984
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/20241028/2189f747/attachment-0001.html>


More information about the ghc-commits mailing list