[Git][ghc/ghc][wip/marge_bot_batch_merge_job] 3 commits: fix: Change type signatures in NonEmpty export comments to reflect reality

Marge Bot (@marge-bot) gitlab at gitlab.haskell.org
Wed Nov 22 10:37:44 UTC 2023



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


Commits:
17ec3e97 by Owen Shepherd at 2023-11-22T09:37:28+01:00
fix: Change type signatures in NonEmpty export comments to reflect reality

This fixes several typos in the comments of
Data.List.NonEmpty export list items.

- - - - -
55ec8ec1 by Samuel Thibault at 2023-11-22T05:37:33-05:00
Fix the platform string for GNU/Hurd

As commited in Cargo
https://github.com/haskell/cabal/pull/9434
there is confusion between "gnu" and "hurd". This got fixed in Cargo, we
need the converse in Hadrian.

Fixes #24180

- - - - -
8306ea93 by Alan Zimmerman at 2023-11-22T05:37:34-05:00
EPA: Tuple Present no longer has annotation

The Present constructor for a Tuple argument will never have an exact
print annotation. So make this impossible.

- - - - -


8 changed files:

- compiler/GHC/Hs/Expr.hs
- compiler/GHC/Hs/Utils.hs
- compiler/GHC/Parser/PostProcess.hs
- compiler/GHC/Tc/TyCl/PatSyn.hs
- compiler/GHC/ThToHs.hs
- hadrian/src/Hadrian/Haskell/Cabal.hs
- libraries/base/src/Data/List/NonEmpty.hs
- utils/check-exact/ExactPrint.hs


Changes:

=====================================
compiler/GHC/Hs/Expr.hs
=====================================
@@ -416,7 +416,7 @@ type instance XXPragE        (GhcPass _) = DataConCantHappen
 type instance XCDotFieldOcc (GhcPass _) = EpAnn AnnFieldLabel
 type instance XXDotFieldOcc (GhcPass _) = DataConCantHappen
 
-type instance XPresent         (GhcPass _) = EpAnn [AddEpAnn]
+type instance XPresent         (GhcPass _) = NoExtField
 
 type instance XMissing         GhcPs = EpAnn EpaLocation
 type instance XMissing         GhcRn = NoExtField


=====================================
compiler/GHC/Hs/Utils.hs
=====================================
@@ -666,7 +666,7 @@ mkLHsTupleExpr :: [LHsExpr (GhcPass p)] -> XExplicitTuple (GhcPass p)
 -- Makes a pre-typechecker boxed tuple, deals with 1 case
 mkLHsTupleExpr [e] _ = e
 mkLHsTupleExpr es ext
-  = noLocA $ ExplicitTuple ext (map (Present noAnn) es) Boxed
+  = noLocA $ ExplicitTuple ext (map (Present noExtField) es) Boxed
 
 mkLHsVarTuple :: IsSrcSpanAnn p a
                => [IdP (GhcPass p)]  -> XExplicitTuple (GhcPass p)


=====================================
compiler/GHC/Parser/PostProcess.hs
=====================================
@@ -3151,7 +3151,7 @@ mkSumOrTupleExpr l boxity (Tuple es) anns = do
   where
     toTupArg :: Either (EpAnn EpaLocation) (LHsExpr GhcPs) -> HsTupArg GhcPs
     toTupArg (Left ann) = missingTupArg ann
-    toTupArg (Right a)  = Present noAnn a
+    toTupArg (Right a)  = Present noExtField a
 
 -- Sum
 -- mkSumOrTupleExpr l Unboxed (Sum alt arity e) =


=====================================
compiler/GHC/Tc/TyCl/PatSyn.hs
=====================================
@@ -1037,7 +1037,7 @@ tcPatToExpr args pat = go pat
            ; return $ ExplicitList noExtField exprs }
     go1 (TuplePat _ pats box)       = do { exprs <- mapM go pats
                                          ; return $ ExplicitTuple noExtField
-                                           (map (Present noAnn) exprs) box }
+                                           (map (Present noExtField) exprs) box }
     go1 (SumPat _ pat alt arity)    = do { expr <- go1 (unLoc pat)
                                          ; return $ ExplicitSum noExtField alt arity
                                                                    (noLocA expr)


=====================================
compiler/GHC/ThToHs.hs
=====================================
@@ -1218,7 +1218,7 @@ cvtDD (FromThenToR x y z) = do { x' <- cvtl x; y' <- cvtl y; z' <- cvtl z; retur
 
 cvt_tup :: [Maybe Exp] -> Boxity -> CvtM (HsExpr GhcPs)
 cvt_tup es boxity = do { let cvtl_maybe Nothing  = return (missingTupArg noAnn)
-                             cvtl_maybe (Just e) = fmap (Present noAnn) (cvtl e)
+                             cvtl_maybe (Just e) = fmap (Present noExtField) (cvtl e)
                        ; es' <- mapM cvtl_maybe es
                        ; return $ ExplicitTuple
                                     noAnn


=====================================
hadrian/src/Hadrian/Haskell/Cabal.hs
=====================================
@@ -75,5 +75,6 @@ cabalOsString :: String -> String
 cabalOsString "mingw32"  = "windows"
 cabalOsString "darwin"   = "osx"
 cabalOsString "solaris2" = "solaris"
+cabalOsString "gnu"      = "hurd"
 cabalOsString other      = other
 


=====================================
libraries/base/src/Data/List/NonEmpty.hs
=====================================
@@ -44,11 +44,11 @@ module Data.List.NonEmpty (
    , (<|), cons  -- :: a -> NonEmpty a -> NonEmpty a
    , uncons      -- :: NonEmpty a -> (a, Maybe (NonEmpty a))
    , unfoldr     -- :: (a -> (b, Maybe a)) -> a -> NonEmpty b
-   , sort        -- :: NonEmpty a -> NonEmpty a
+   , sort        -- :: Ord a => NonEmpty a -> NonEmpty a
    , reverse     -- :: NonEmpty a -> NonEmpty a
-   , inits       -- :: Foldable f => f a -> NonEmpty a
+   , inits       -- :: Foldable f => f a -> NonEmpty [a]
    , inits1      -- :: NonEmpty a -> NonEmpty (NonEmpty a)
-   , tails       -- :: Foldable f => f a -> NonEmpty a
+   , tails       -- :: Foldable f => f a -> NonEmpty [a]
    , tails1      -- :: NonEmpty a -> NonEmpty (NonEmpty a)
    , append      -- :: NonEmpty a -> NonEmpty a -> NonEmpty a
    , appendList  -- :: NonEmpty a -> [a] -> NonEmpty a
@@ -57,31 +57,31 @@ module Data.List.NonEmpty (
    , iterate     -- :: (a -> a) -> a -> NonEmpty a
    , repeat      -- :: a -> NonEmpty a
    , cycle       -- :: NonEmpty a -> NonEmpty a
-   , unfold      -- :: (a -> (b, Maybe a) -> a -> NonEmpty b
+   , unfold      -- :: (a -> (b, Maybe a)) -> a -> NonEmpty b
    , insert      -- :: (Foldable f, Ord a) => a -> f a -> NonEmpty a
    , some1       -- :: Alternative f => f a -> f (NonEmpty a)
    -- * Extracting sublists
    , take        -- :: Int -> NonEmpty a -> [a]
    , drop        -- :: Int -> NonEmpty a -> [a]
    , splitAt     -- :: Int -> NonEmpty a -> ([a], [a])
-   , takeWhile   -- :: Int -> NonEmpty a -> [a]
-   , dropWhile   -- :: Int -> NonEmpty a -> [a]
-   , span        -- :: Int -> NonEmpty a -> ([a],[a])
-   , break       -- :: Int -> NonEmpty a -> ([a],[a])
+   , takeWhile   -- :: (a -> Bool) -> NonEmpty a -> [a]
+   , dropWhile   -- :: (a -> Bool) -> NonEmpty a -> [a]
+   , span        -- :: (a -> Bool) -> NonEmpty a -> ([a], [a])
+   , break       -- :: (a -> Bool) -> NonEmpty a -> ([a], [a])
    , filter      -- :: (a -> Bool) -> NonEmpty a -> [a]
    , partition   -- :: (a -> Bool) -> NonEmpty a -> ([a],[a])
-   , group       -- :: Foldable f => Eq a => f a -> [NonEmpty a]
+   , group       -- :: (Foldable f, Eq a) => f a -> [NonEmpty a]
    , groupBy     -- :: Foldable f => (a -> a -> Bool) -> f a -> [NonEmpty a]
    , groupWith     -- :: (Foldable f, Eq b) => (a -> b) -> f a -> [NonEmpty a]
-   , groupAllWith  -- :: (Foldable f, Ord b) => (a -> b) -> f a -> [NonEmpty a]
+   , groupAllWith  -- :: Ord b => (a -> b) -> [a] -> [NonEmpty a]
    , group1      -- :: Eq a => NonEmpty a -> NonEmpty (NonEmpty a)
    , groupBy1    -- :: (a -> a -> Bool) -> NonEmpty a -> NonEmpty (NonEmpty a)
-   , groupWith1     -- :: (Foldable f, Eq b) => (a -> b) -> f a -> NonEmpty (NonEmpty a)
-   , groupAllWith1  -- :: (Foldable f, Ord b) => (a -> b) -> f a -> NonEmpty (NonEmpty a)
-   , permutations
-   , permutations1
+   , groupWith1     -- :: Eq b => (a -> b) -> NonEmpty a -> NonEmpty (NonEmpty a)
+   , groupAllWith1  -- :: Ord b => (a -> b) -> NonEmpty a -> NonEmpty (NonEmpty a)
+   , permutations   -- :: [a] -> NonEmpty [a]
+   , permutations1  -- :: NonEmpty a -> NonEmpty (NonEmpty a)
    -- * Sublist predicates
-   , isPrefixOf  -- :: Foldable f => f a -> NonEmpty a -> Bool
+   , isPrefixOf  -- :: Eq a => [a] -> NonEmpty a -> Bool
    -- * \"Set\" operations
    , nub         -- :: Eq a => NonEmpty a -> NonEmpty a
    , nubBy       -- :: (a -> a -> Bool) -> NonEmpty a -> NonEmpty a
@@ -90,12 +90,12 @@ module Data.List.NonEmpty (
    -- * Zipping and unzipping streams
    , zip         -- :: NonEmpty a -> NonEmpty b -> NonEmpty (a,b)
    , zipWith     -- :: (a -> b -> c) -> NonEmpty a -> NonEmpty b -> NonEmpty c
-   , unzip       -- :: NonEmpty (a, b) -> (NonEmpty a, NonEmpty b)
+   , unzip       -- :: Functor f => f (a,b) -> (f a, f b)
    -- * Converting to and from a list
    , fromList    -- :: [a] -> NonEmpty a
    , toList      -- :: NonEmpty a -> [a]
    , nonEmpty    -- :: [a] -> Maybe (NonEmpty a)
-   , xor         -- :: NonEmpty a -> Bool
+   , xor         -- :: NonEmpty Bool -> Bool
    ) where
 
 


=====================================
utils/check-exact/ExactPrint.hs
=====================================
@@ -3431,10 +3431,10 @@ instance ExactPrint (DotFieldOcc GhcPs) where
 -- ---------------------------------------------------------------------
 
 instance ExactPrint (HsTupArg GhcPs) where
-  getAnnotationEntry (Present an _) = fromAnn an
+  getAnnotationEntry (Present _ _) = NoEntryVal
   getAnnotationEntry (Missing an)   = fromAnn an
 
-  setAnnotationAnchor (Present an a) anc ts cs = Present (setAnchorEpa an anc ts cs) a
+  setAnnotationAnchor (Present a b) _ _ _ = Present a b
   setAnnotationAnchor (Missing an)   anc ts cs = Missing (setAnchorEpa an anc ts cs)
 
   exact (Present a e) = Present a <$> markAnnotated e



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/6e2b05313c4119649f71f666af2b18ce6f2825b5...8306ea93da82677c5af37f9cb5203bc1a84cd50b

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/6e2b05313c4119649f71f666af2b18ce6f2825b5...8306ea93da82677c5af37f9cb5203bc1a84cd50b
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/20231122/e3e82ced/attachment-0001.html>


More information about the ghc-commits mailing list