[Git][ghc/ghc][wip/marge_bot_batch_merge_job] 6 commits: Add `Eq` and `Ord` instances for `Generically1`

Marge Bot (@marge-bot) gitlab at gitlab.haskell.org
Tue Sep 20 18:44:39 UTC 2022



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


Commits:
c4c2cca0 by John Ericson at 2022-09-20T13:11:49-04:00
Add `Eq` and `Ord` instances for `Generically1`

These are needed so the subsequent commit overhauling the `*1` classes
type-checks.

- - - - -
7beb356e by John Ericson at 2022-09-20T13:11:50-04:00
Relax instances for Functor combinators; put superclass on Class1 and Class2 to make non-breaking

This change is approved by the Core Libraries commitee in
https://github.com/haskell/core-libraries-committee/issues/10

The first change makes the `Eq`, `Ord`, `Show`, and `Read` instances for
`Sum`, `Product`, and `Compose` match those for `:+:`, `:*:`, and `:.:`.
These have the proper flexible contexts that are exactly what the
instance needs:

For example, instead of
```haskell
instance (Eq1 f, Eq1 g, Eq a) => Eq (Compose f g a) where
  (==) = eq1
```
we do
```haskell
deriving instance Eq (f (g a)) => Eq (Compose f g a)
```

But, that change alone is rather breaking, because until now `Eq (f a)`
and `Eq1 f` (and respectively the other classes and their `*1`
equivalents too) are *incomparable* constraints. This has always been an
annoyance of working with the `*1` classes, and now it would rear it's
head one last time as an pesky migration.

Instead, we give the `*1` classes superclasses, like so:
```haskell
(forall a. Eq a => Eq (f a)) => Eq1 f
```
along with some laws that canonicity is preserved, like:
```haskell
liftEq (==) = (==)
```

and likewise for `*2` classes:
```haskell
(forall a. Eq a => Eq1 (f a)) => Eq2 f
```
and laws:
```haskell
liftEq2 (==) = liftEq1
```

The `*1` classes also have default methods using the `*2` classes where
possible.

What this means, as explained in the docs, is that `*1` classes really
are generations of the regular classes, indicating that the methods can
be split into a canonical lifting combined with a canonical inner, with
the super class "witnessing" the laws[1] in a fashion.

Circling back to the pragmatics of migrating, note that the superclass
means evidence for the old `Sum`, `Product`, and `Compose` instances is
(more than) sufficient, so breakage is less likely --- as long no
instances are "missing", existing polymorphic code will continue to
work.

Breakage can occur when a datatype implements the `*1` class but not the
corresponding regular class, but this is almost certainly an oversight.
For example, containers made that mistake for `Tree` and `Ord`, which I
fixed in https://github.com/haskell/containers/pull/761, but fixing the
issue by adding `Ord1` was extremely *un*controversial.

`Generically1` was also missing `Eq`, `Ord`, `Read,` and `Show`
instances. It is unlikely this would have been caught without
implementing this change.

-----

[1]: In fact, someday, when the laws are part of the language and not
only documentation, we might be able to drop the superclass field of the
dictionary by using the laws to recover the superclass in an
instance-agnostic manner, e.g. with a *non*-overloaded function with
type:

```haskell
DictEq1 f -> DictEq a -> DictEq (f a)
```

But I don't wish to get into optomizations now, just demonstrate the
close relationship between the law and the superclass.

Bump haddock submodule because of test output changing.

- - - - -
6a8c6b5e by Tom Ellis at 2022-09-20T13:12:27-04:00
Add notes to ghc-prim Haddocks that users should not import it

- - - - -
ee9d0f5c by matoro at 2022-09-20T13:13:06-04:00
docs: clarify that LLVM codegen is not available in unregisterised mode

The current docs are misleading and suggest that it is possible to use
LLVM codegen from an unregisterised build.  This is not the case;
attempting to pass `-fllvm` to an unregisterised build warns:

```
when making flags consistent: warning:
    Target platform uses unregisterised ABI, so compiling via C
```

and uses the C codegen anyway.

- - - - -
3a1a7fa1 by Nicolas Trangez at 2022-09-20T14:44:20-04:00
rts: remove copy-paste error from `cabal.rts.in`

This was, likely accidentally, introduced in 4bf542bf1c.

See: 4bf542bf1cdf2fa468457fc0af21333478293476

- - - - -
fb6d2998 by Matthew Pickering at 2022-09-20T14:44:20-04:00
hadrian: Add extra_dependencies edges for all different ways

The hack to add extra dependencies needed by DeriveLift extension missed
the cases for profiles and dynamic ways. For the profiled way this leads
to errors like:

```
GHC error in desugarer lookup in Data.IntSet.Internal:
  Failed to load interface for ‘Language.Haskell.TH.Lib.Internal’
  Perhaps you haven't installed the profiling libraries for package ‘template-haskell’?
  Use -v (or `:set -v` in ghci) to see a list of the files searched for.
ghc: panic! (the 'impossible' happened)
  GHC version 9.5.20220916:
        initDs
```

Therefore the fix is to add these extra edges in.

Fixes #22197

- - - - -


18 changed files:

- docs/users_guide/codegens.rst
- hadrian/src/Rules/Dependencies.hs
- libraries/base/Data/Functor/Classes.hs
- libraries/base/Data/Functor/Compose.hs
- libraries/base/Data/Functor/Product.hs
- libraries/base/Data/Functor/Sum.hs
- libraries/base/GHC/Generics.hs
- libraries/base/changelog.md
- libraries/ghc-prim/GHC/Classes.hs
- libraries/ghc-prim/GHC/Debug.hs
- libraries/ghc-prim/GHC/Prim/Exception.hs
- libraries/ghc-prim/GHC/Prim/Ext.hs
- libraries/ghc-prim/GHC/Prim/Panic.hs
- libraries/ghc-prim/GHC/Tuple.hs
- libraries/ghc-prim/ghc-prim.cabal
- rts/rts.cabal.in
- utils/genprimopcode/Main.hs
- utils/haddock


Changes:

=====================================
docs/users_guide/codegens.rst
=====================================
@@ -108,10 +108,9 @@ disabling some of the platform-specific tricks that GHC normally uses to
 make programs go faster. When compiling unregisterised, GHC simply
 generates a C file which is compiled via gcc.
 
-When GHC is build in unregisterised mode only the LLVM and C code
-generators will be available. The native code generator won't be. LLVM
-usually offers a substantial performance benefit over the C backend in
-unregisterised mode.
+When GHC is built in unregisterised mode only the C code generator is
+available.  Neither the LLVM nor native code generator can be used by an
+unregisterised build.
 
 Unregisterised compilation can be useful when porting GHC to a new
 machine, since it reduces the prerequisite tools to ``gcc``, ``as``, and


=====================================
hadrian/src/Rules/Dependencies.hs
=====================================
@@ -14,6 +14,7 @@ import Target
 import Utilities
 import Packages
 import qualified Data.Map as M
+import qualified Data.Set as S
 
 import qualified Text.Parsec as Parsec
 
@@ -22,7 +23,7 @@ import qualified Text.Parsec as Parsec
 -- until it does we need to add this dependency ourselves.
 extra_dependencies :: M.Map Package (Stage -> Action [(FilePath, FilePath)])
 extra_dependencies =
-  M.fromList [(containers, fmap sequence (sequence
+  M.fromList [(containers, fmap (fmap concat . sequence) (sequence
     [dep (containers, "Data.IntSet.Internal") th_internal
     ,dep (containers, "Data.Set.Internal") th_internal
     ,dep (containers, "Data.Sequence.Internal") th_internal
@@ -32,9 +33,12 @@ extra_dependencies =
 
   where
     th_internal = (templateHaskell, "Language.Haskell.TH.Lib.Internal")
-    dep (p1, m1) (p2, m2) s = (,) <$> path s p1 m1 <*> path s p2 m2
-    path stage p m =
-      let context = Context stage p vanilla Inplace
+    dep (p1, m1) (p2, m2) s = do
+        let context = Context s p1 (error "extra_dependencies: way not set") (error "extra_dependencies: iplace not set")
+        ways <- interpretInContext context getLibraryWays
+        mapM (\way -> (,) <$> path s way p1 m1 <*> path s way p2 m2) (S.toList ways)
+    path stage way p m =
+      let context = Context stage p way Inplace
       in objectPath context . moduleSource $ m
 
 formatExtra :: (FilePath, FilePath) -> String


=====================================
libraries/base/Data/Functor/Classes.hs
=====================================
@@ -1,7 +1,10 @@
 {-# LANGUAGE FlexibleContexts     #-}
+{-# LANGUAGE DefaultSignatures    #-}
 {-# LANGUAGE InstanceSigs         #-}
 {-# LANGUAGE Safe                 #-}
+{-# LANGUAGE TypeOperators        #-}
 {-# LANGUAGE UndecidableInstances #-}
+{-# LANGUAGE QuantifiedConstraints #-}
 -----------------------------------------------------------------------------
 -- |
 -- Module      :  Data.Functor.Classes
@@ -91,8 +94,18 @@ import Text.Show (showListWith)
 
 -- | Lifting of the 'Eq' class to unary type constructors.
 --
+-- Any instance should be subject to the following law that canonicity
+-- is preserved:
+--
+-- @liftEq (==)@ = @(==)@
+--
+-- This class therefore represents the generalization of 'Eq' by
+-- decomposing its main method into a canonical lifting on a canonical
+-- inner method, so that the lifting can be reused for other arguments
+-- than the canonical one.
+--
 -- @since 4.9.0.0
-class Eq1 f where
+class (forall a. Eq a => Eq (f a)) => Eq1 f where
     -- | Lift an equality test through the type constructor.
     --
     -- The function will usually be applied to an equality function,
@@ -102,6 +115,10 @@ class Eq1 f where
     --
     -- @since 4.9.0.0
     liftEq :: (a -> b -> Bool) -> f a -> f b -> Bool
+    default liftEq
+        :: (f ~ f' c, Eq2 f', Eq c)
+        => (a -> b -> Bool) -> f a -> f b -> Bool
+    liftEq = liftEq2 (==)
 
 -- | Lift the standard @('==')@ function through the type constructor.
 --
@@ -111,8 +128,18 @@ eq1 = liftEq (==)
 
 -- | Lifting of the 'Ord' class to unary type constructors.
 --
+-- Any instance should be subject to the following law that canonicity
+-- is preserved:
+--
+-- @liftCompare compare@ = 'compare'
+--
+-- This class therefore represents the generalization of 'Ord' by
+-- decomposing its main method into a canonical lifting on a canonical
+-- inner method, so that the lifting can be reused for other arguments
+-- than the canonical one.
+--
 -- @since 4.9.0.0
-class (Eq1 f) => Ord1 f where
+class (Eq1 f, forall a. Ord a => Ord (f a)) => Ord1 f where
     -- | Lift a 'compare' function through the type constructor.
     --
     -- The function will usually be applied to a comparison function,
@@ -122,6 +149,10 @@ class (Eq1 f) => Ord1 f where
     --
     -- @since 4.9.0.0
     liftCompare :: (a -> b -> Ordering) -> f a -> f b -> Ordering
+    default liftCompare
+        :: (f ~ f' c, Ord2 f', Ord c)
+        => (a -> b -> Ordering) -> f a -> f b -> Ordering
+    liftCompare = liftCompare2 compare
 
 -- | Lift the standard 'compare' function through the type constructor.
 --
@@ -131,6 +162,22 @@ compare1 = liftCompare compare
 
 -- | Lifting of the 'Read' class to unary type constructors.
 --
+-- Any instance should be subject to the following laws that canonicity
+-- is preserved:
+--
+-- @liftReadsPrec readsPrec readList@ = 'readsPrec'
+--
+-- @liftReadList readsPrec readList@ = 'readList'
+--
+-- @liftReadPrec readPrec readListPrec@ = 'readPrec'
+--
+-- @liftReadListPrec readPrec readListPrec@ = 'readListPrec'
+--
+-- This class therefore represents the generalization of 'Read' by
+-- decomposing it's methods into a canonical lifting on a canonical
+-- inner method, so that the lifting can be reused for other arguments
+-- than the canonical one.
+--
 -- Both 'liftReadsPrec' and 'liftReadPrec' exist to match the interface
 -- provided in the 'Read' type class, but it is recommended to implement
 -- 'Read1' instances using 'liftReadPrec' as opposed to 'liftReadsPrec', since
@@ -145,7 +192,7 @@ compare1 = liftCompare compare
 -- For more information, refer to the documentation for the 'Read' class.
 --
 -- @since 4.9.0.0
-class Read1 f where
+class (forall a. Read a => Read (f a)) => Read1 f where
     {-# MINIMAL liftReadsPrec | liftReadPrec #-}
 
     -- | 'readsPrec' function for an application of the type constructor
@@ -219,14 +266,30 @@ liftReadListPrecDefault rp rl = list (liftReadPrec rp rl)
 
 -- | Lifting of the 'Show' class to unary type constructors.
 --
+-- Any instance should be subject to the following laws that canonicity
+-- is preserved:
+--
+-- @liftShowsPrec showsPrec showList@ = 'showsPrec'
+--
+-- @liftShowList showsPrec showList@ = 'showList'
+--
+-- This class therefore represents the generalization of 'Show' by
+-- decomposing it's methods into a canonical lifting on a canonical
+-- inner method, so that the lifting can be reused for other arguments
+-- than the canonical one.
+--
 -- @since 4.9.0.0
-class Show1 f where
+class (forall a. Show a => Show (f a)) => Show1 f where
     -- | 'showsPrec' function for an application of the type constructor
     -- based on 'showsPrec' and 'showList' functions for the argument type.
     --
     -- @since 4.9.0.0
     liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) ->
         Int -> f a -> ShowS
+    default liftShowsPrec
+        :: (f ~ f' b, Show2 f', Show b)
+        => (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> f a -> ShowS
+    liftShowsPrec = liftShowsPrec2 showsPrec showList
 
     -- | 'showList' function for an application of the type constructor
     -- based on 'showsPrec' and 'showList' functions for the argument type.
@@ -248,7 +311,7 @@ showsPrec1 = liftShowsPrec showsPrec showList
 -- | Lifting of the 'Eq' class to binary type constructors.
 --
 -- @since 4.9.0.0
-class Eq2 f where
+class (forall a. Eq a => Eq1 (f a)) => Eq2 f where
     -- | Lift equality tests through the type constructor.
     --
     -- The function will usually be applied to equality functions,
@@ -268,7 +331,7 @@ eq2 = liftEq2 (==) (==)
 -- | Lifting of the 'Ord' class to binary type constructors.
 --
 -- @since 4.9.0.0
-class (Eq2 f) => Ord2 f where
+class (Eq2 f, forall a. Ord a => Ord1 (f a)) => Ord2 f where
     -- | Lift 'compare' functions through the type constructor.
     --
     -- The function will usually be applied to comparison functions,
@@ -302,7 +365,7 @@ compare2 = liftCompare2 compare compare
 -- For more information, refer to the documentation for the 'Read' class.
 --
 -- @since 4.9.0.0
-class Read2 f where
+class (forall a. Read a => Read1 (f a)) => Read2 f where
     {-# MINIMAL liftReadsPrec2 | liftReadPrec2 #-}
 
     -- | 'readsPrec' function for an application of the type constructor
@@ -385,7 +448,7 @@ liftReadListPrec2Default rp1 rl1 rp2 rl2 = list (liftReadPrec2 rp1 rl1 rp2 rl2)
 -- | Lifting of the 'Show' class to binary type constructors.
 --
 -- @since 4.9.0.0
-class Show2 f where
+class (forall a. Show a => Show1 (f a)) => Show2 f where
     -- | 'showsPrec' function for an application of the type constructor
     -- based on 'showsPrec' and 'showList' functions for the argument types.
     --


=====================================
libraries/base/Data/Functor/Compose.hs
=====================================
@@ -5,6 +5,7 @@
 {-# LANGUAGE PolyKinds #-}
 {-# LANGUAGE ScopedTypeVariables #-}
 {-# LANGUAGE Trustworthy #-}
+{-# LANGUAGE StandaloneDeriving #-}
 
 -----------------------------------------------------------------------------
 -- |
@@ -32,7 +33,7 @@ import Data.Coerce (coerce)
 import Data.Data (Data)
 import Data.Type.Equality (TestEquality(..), (:~:)(..))
 import GHC.Generics (Generic, Generic1)
-import Text.Read (Read(..), readListDefault, readListPrecDefault)
+import Text.Read ()
 
 infixr 9 `Compose`
 
@@ -47,6 +48,17 @@ newtype Compose f g a = Compose { getCompose :: f (g a) }
            , Monoid    -- ^ @since 4.16.0.0
            )
 
+-- Instances of Prelude classes
+
+-- | @since 4.18.0.0
+deriving instance Eq (f (g a)) => Eq (Compose f g a)
+-- | @since 4.18.0.0
+deriving instance Ord (f (g a)) => Ord (Compose f g a)
+-- | @since 4.18.0.0
+deriving instance Read (f (g a)) => Read (Compose f g a)
+-- | @since 4.18.0.0
+deriving instance Show (f (g a)) => Show (Compose f g a)
+
 -- Instances of lifted Prelude classes
 
 -- | @since 4.9.0.0
@@ -77,27 +89,6 @@ instance (Show1 f, Show1 g) => Show1 (Compose f g) where
         sp' = liftShowsPrec sp sl
         sl' = liftShowList sp sl
 
--- Instances of Prelude classes
-
--- | @since 4.9.0.0
-instance (Eq1 f, Eq1 g, Eq a) => Eq (Compose f g a) where
-    (==) = eq1
-
--- | @since 4.9.0.0
-instance (Ord1 f, Ord1 g, Ord a) => Ord (Compose f g a) where
-    compare = compare1
-
--- | @since 4.9.0.0
-instance (Read1 f, Read1 g, Read a) => Read (Compose f g a) where
-    readPrec = readPrec1
-
-    readListPrec = readListPrecDefault
-    readList     = readListDefault
-
--- | @since 4.9.0.0
-instance (Show1 f, Show1 g, Show a) => Show (Compose f g a) where
-    showsPrec = showsPrec1
-
 -- Functor instances
 
 -- | @since 4.9.0.0


=====================================
libraries/base/Data/Functor/Product.hs
=====================================
@@ -2,6 +2,7 @@
 {-# LANGUAGE DeriveGeneric #-}
 {-# LANGUAGE PolyKinds #-}
 {-# LANGUAGE Safe #-}
+{-# LANGUAGE StandaloneDeriving #-}
 -----------------------------------------------------------------------------
 -- |
 -- Module      :  Data.Functor.Product
@@ -28,7 +29,7 @@ import Control.Monad.Zip (MonadZip(mzipWith))
 import Data.Data (Data)
 import Data.Functor.Classes
 import GHC.Generics (Generic, Generic1)
-import Text.Read (Read(..), readListDefault, readListPrecDefault)
+import Text.Read ()
 
 -- | Lifted product of functors.
 data Product f g a = Pair (f a) (g a)
@@ -37,6 +38,15 @@ data Product f g a = Pair (f a) (g a)
            , Generic1 -- ^ @since 4.9.0.0
            )
 
+-- | @since 4.18.0.0
+deriving instance (Eq (f a), Eq (g a)) => Eq (Product f g a)
+-- | @since 4.18.0.0
+deriving instance (Ord (f a), Ord (g a)) => Ord (Product f g a)
+-- | @since 4.18.0.0
+deriving instance (Read (f a), Read (g a)) => Read (Product f g a)
+-- | @since 4.18.0.0
+deriving instance (Show (f a), Show (g a)) => Show (Product f g a)
+
 -- | @since 4.9.0.0
 instance (Eq1 f, Eq1 g) => Eq1 (Product f g) where
     liftEq eq (Pair x1 y1) (Pair x2 y2) = liftEq eq x1 x2 && liftEq eq y1 y2
@@ -59,25 +69,6 @@ instance (Show1 f, Show1 g) => Show1 (Product f g) where
     liftShowsPrec sp sl d (Pair x y) =
         showsBinaryWith (liftShowsPrec sp sl) (liftShowsPrec sp sl) "Pair" d x y
 
--- | @since 4.9.0.0
-instance (Eq1 f, Eq1 g, Eq a) => Eq (Product f g a)
-    where (==) = eq1
-
--- | @since 4.9.0.0
-instance (Ord1 f, Ord1 g, Ord a) => Ord (Product f g a) where
-    compare = compare1
-
--- | @since 4.9.0.0
-instance (Read1 f, Read1 g, Read a) => Read (Product f g a) where
-    readPrec = readPrec1
-
-    readListPrec = readListPrecDefault
-    readList     = readListDefault
-
--- | @since 4.9.0.0
-instance (Show1 f, Show1 g, Show a) => Show (Product f g a) where
-    showsPrec = showsPrec1
-
 -- | @since 4.9.0.0
 instance (Functor f, Functor g) => Functor (Product f g) where
     fmap f (Pair x y) = Pair (fmap f x) (fmap f y)


=====================================
libraries/base/Data/Functor/Sum.hs
=====================================
@@ -2,6 +2,7 @@
 {-# LANGUAGE DeriveGeneric #-}
 {-# LANGUAGE PolyKinds #-}
 {-# LANGUAGE Safe #-}
+{-# LANGUAGE StandaloneDeriving #-}
 -----------------------------------------------------------------------------
 -- |
 -- Module      :  Data.Functor.Sum
@@ -25,7 +26,7 @@ import Control.Applicative ((<|>))
 import Data.Data (Data)
 import Data.Functor.Classes
 import GHC.Generics (Generic, Generic1)
-import Text.Read (Read(..), readListDefault, readListPrecDefault)
+import Text.Read ()
 
 -- | Lifted sum of functors.
 data Sum f g a = InL (f a) | InR (g a)
@@ -34,6 +35,15 @@ data Sum f g a = InL (f a) | InR (g a)
            , Generic1 -- ^ @since 4.9.0.0
            )
 
+-- | @since 4.18.0.0
+deriving instance (Eq (f a), Eq (g a)) => Eq (Sum f g a)
+-- | @since 4.18.0.0
+deriving instance (Ord (f a), Ord (g a)) => Ord (Sum f g a)
+-- | @since 4.18.0.0
+deriving instance (Read (f a), Read (g a)) => Read (Sum f g a)
+-- | @since 4.18.0.0
+deriving instance (Show (f a), Show (g a)) => Show (Sum f g a)
+
 -- | @since 4.9.0.0
 instance (Eq1 f, Eq1 g) => Eq1 (Sum f g) where
     liftEq eq (InL x1) (InL x2) = liftEq eq x1 x2
@@ -64,22 +74,6 @@ instance (Show1 f, Show1 g) => Show1 (Sum f g) where
     liftShowsPrec sp sl d (InR y) =
         showsUnaryWith (liftShowsPrec sp sl) "InR" d y
 
--- | @since 4.9.0.0
-instance (Eq1 f, Eq1 g, Eq a) => Eq (Sum f g a) where
-    (==) = eq1
--- | @since 4.9.0.0
-instance (Ord1 f, Ord1 g, Ord a) => Ord (Sum f g a) where
-    compare = compare1
--- | @since 4.9.0.0
-instance (Read1 f, Read1 g, Read a) => Read (Sum f g a) where
-    readPrec = readPrec1
-
-    readListPrec = readListPrecDefault
-    readList     = readListDefault
--- | @since 4.9.0.0
-instance (Show1 f, Show1 g, Show a) => Show (Sum f g a) where
-    showsPrec = showsPrec1
-
 -- | @since 4.9.0.0
 instance (Functor f, Functor g) => Functor (Sum f g) where
     fmap f (InL x) = InL (fmap f x)


=====================================
libraries/base/GHC/Generics.hs
=====================================
@@ -1480,6 +1480,15 @@ type    Generically1 :: forall k. (k -> Type) -> (k -> Type)
 newtype Generically1 f a where
   Generically1 :: forall {k} f a. f a -> Generically1 @k f a
 
+-- | @since 4.18.0.0
+instance (Generic1 f, Eq (Rep1 f a)) => Eq (Generically1 f a) where
+   Generically1 x == Generically1 y = from1 x == from1 y
+   Generically1 x /= Generically1 y = from1 x /= from1 y
+
+-- | @since 4.18.0.0
+instance (Generic1 f, Ord (Rep1 f a)) => Ord (Generically1 f a) where
+   Generically1 x `compare` Generically1 y = from1 x `compare` from1 y
+
 -- | @since 4.17.0.0
 instance (Generic1 f, Functor (Rep1 f)) => Functor (Generically1 f) where
   fmap :: (a -> a') -> (Generically1 f a -> Generically1 f a')


=====================================
libraries/base/changelog.md
=====================================
@@ -30,6 +30,12 @@
     for the related discussion,
     as well as [the migration guide](https://github.com/haskell/core-libraries-committee/blob/main/guides/export-lifta2-prelude.md)
   * Update to Unicode 15.0.0.
+  * Add `Eq` and `Ord` instances for `Generically1`.
+  * Relax instances for Functor combinators; put superclass on Class1 and Class2
+    to make non-breaking. See [CLC
+    #10](https://github.com/haskell/core-libraries-committee/issues/10) for the
+    related discussion, as well as [the migration
+    guide](https://github.com/haskell/core-libraries-committee/blob/main/guides/functor-combinator-instances-and-class1s.md).
 
 ## 4.17.0.0 *August 2022*
 


=====================================
libraries/ghc-prim/GHC/Classes.hs
=====================================
@@ -27,6 +27,9 @@
 -- Portability :  non-portable (GHC extensions)
 --
 -- Basic classes.
+-- Do not import this module directly.  It is an GHC internal only
+-- module.  Some of its contents are instead available from @Prelude@
+-- and @GHC.Int at .
 --
 -----------------------------------------------------------------------------
 
@@ -35,6 +38,8 @@ module GHC.Classes(
     IP(..),
 
     -- * Equality and ordering
+    -- | Do not import these classes from this module. Import them
+    -- from @Prelude@ instead.
     Eq(..),
     Ord(..),
     -- ** Monomorphic equality operators
@@ -48,6 +53,8 @@ module GHC.Classes(
     gtWord, geWord, leWord, ltWord, compareWord, compareWord#,
 
     -- * Functions over Bool
+    -- | Do not import these functions from this module. Import them
+    -- from @Prelude@ instead.
     (&&), (||), not,
 
     -- * Integer arithmetic


=====================================
libraries/ghc-prim/GHC/Debug.hs
=====================================
@@ -1,6 +1,8 @@
 {-# LANGUAGE Trustworthy #-}
 {-# LANGUAGE MagicHash, NoImplicitPrelude, UnboxedTuples, UnliftedFFITypes #-}
 
+-- | Users should not import this module.  It is GHC internal only.
+
 module GHC.Debug ( debugLn, debugErrLn ) where
 
 import GHC.Prim


=====================================
libraries/ghc-prim/GHC/Prim/Exception.hs
=====================================
@@ -6,6 +6,8 @@
 {-# LANGUAGE EmptyCase #-}
 
 -- | Primitive exceptions.
+--
+-- Users should not import this module.  It is GHC internal only.
 module GHC.Prim.Exception
    ( raiseOverflow
    , raiseUnderflow


=====================================
libraries/ghc-prim/GHC/Prim/Ext.hs
=====================================
@@ -18,6 +18,9 @@
 
 -- | Extra C-- routines exposed from the RTS
 --
+-- Users should not import this module.  It is GHC internal only.  Use
+-- "GHC.Conc" instead.
+--
 -- Actual primops are emitted by the compiler itself. They are special bits of
 -- code with backend support. The foreign functions in this module aren't actual
 -- primops because the compiler doesn't care about them at all: they just are


=====================================
libraries/ghc-prim/GHC/Prim/Panic.hs
=====================================
@@ -6,6 +6,8 @@
 {-# LANGUAGE EmptyCase #-}
 
 -- | Primitive panics.
+--
+-- Users should not import this module.  It is GHC internal only.
 module GHC.Prim.Panic
    ( absentSumFieldError
    , panicError


=====================================
libraries/ghc-prim/GHC/Tuple.hs
=====================================
@@ -12,6 +12,8 @@
 --
 -- The tuple data types
 --
+-- Users should not import this module.  It is GHC internal only.
+--
 -----------------------------------------------------------------------------
 
 module GHC.Tuple where


=====================================
libraries/ghc-prim/ghc-prim.cabal
=====================================
@@ -12,6 +12,11 @@ build-type:     Custom
 description:
     This package contains the primitive types and operations supplied by GHC.
 
+    It is an internal package, only for the use of GHC developers.
+    GHC users should not use it!  If you do use it then expect
+    breaking changes at any time without warning.  You should prefer
+    to import @GHC.Exts@ from the @base@ package instead.
+
 extra-source-files: changelog.md
 
 source-repository head


=====================================
rts/rts.cabal.in
=====================================
@@ -419,9 +419,6 @@ library
         -- This symbol is useful in gdb, but not referred to anywhere,
         -- so we need to force it to be included in the binary.
         ld-options: "-Wl,-u,findPtr"
-         -- This symbol is useful in gdb, but not referred to anywhere,
-         -- so we need to force it to be included in the binary.
-         "-Wl,-u,findPtr"
 
     if os(windows)
       if flag(leading-underscore)


=====================================
utils/genprimopcode/Main.hs
=====================================
@@ -446,7 +446,9 @@ In PrimopWrappers we set some crucial GHC options
 
 gen_wrappers :: Info -> String
 gen_wrappers (Info _ entries)
-   =    "{-# LANGUAGE MagicHash, NoImplicitPrelude, UnboxedTuples #-}\n"
+   =    "-- | Users should not import this module.  It is GHC internal only.\n"
+     ++ "-- Use \"GHC.Exts\" instead.\n"
+     ++ "{-# LANGUAGE MagicHash, NoImplicitPrelude, UnboxedTuples #-}\n"
         -- Dependencies on Prelude must be explicit in libraries/base, but we
         -- don't need the Prelude here so we add NoImplicitPrelude.
      ++ "{-# OPTIONS_GHC -Wno-deprecations -O0 -fno-do-eta-reduction #-}\n"


=====================================
utils/haddock
=====================================
@@ -1 +1 @@
-Subproject commit b5e40b15228fdca5ce7d4e2f2241156d0b085261
+Subproject commit 7e4326f999056fb7b0b955ccadf5eab86b755a0d



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/45886dc1297631659ff2b6e1bf935da964f25b5e...fb6d299865968d0a8f559668d3c809ce887ed9a7

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/45886dc1297631659ff2b6e1bf935da964f25b5e...fb6d299865968d0a8f559668d3c809ce887ed9a7
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/20220920/edfd8d84/attachment-0001.html>


More information about the ghc-commits mailing list