Teo Camarasu pushed to branch wip/T26930 at Glasgow Haskell Compiler / GHC
Commits:
-
316765d2
by Teo Camarasu at 2026-02-17T23:25:50+00:00
15 changed files:
- libraries/ghc-internal/src/GHC/Internal/ByteOrder.hs
- − libraries/ghc-internal/src/GHC/Internal/ByteOrder.hs-boot
- libraries/ghc-internal/src/GHC/Internal/Control/Arrow.hs
- libraries/ghc-internal/src/GHC/Internal/Control/Monad/Fix.hs
- libraries/ghc-internal/src/GHC/Internal/Data/Foldable.hs
- libraries/ghc-internal/src/GHC/Internal/Data/Functor/Const.hs
- libraries/ghc-internal/src/GHC/Internal/Data/Functor/Identity.hs
- libraries/ghc-internal/src/GHC/Internal/Data/Monoid.hs
- libraries/ghc-internal/src/GHC/Internal/Data/Semigroup/Internal.hs
- libraries/ghc-internal/src/GHC/Internal/Data/Traversable.hs
- libraries/ghc-internal/src/GHC/Internal/Functor/ZipList.hs
- libraries/ghc-internal/src/GHC/Internal/Generics.hs
- libraries/ghc-internal/src/GHC/Internal/IO/Exception.hs
- libraries/ghc-internal/src/GHC/Internal/Read.hs
- libraries/ghc-internal/src/GHC/Internal/Unicode/Bits.hs
Changes:
| ... | ... | @@ -27,8 +27,6 @@ module GHC.Internal.ByteOrder |
| 27 | 27 | |
| 28 | 28 | import GHC.Internal.Base
|
| 29 | 29 | import GHC.Internal.Enum
|
| 30 | -import GHC.Internal.Generics (Generic)
|
|
| 31 | -import GHC.Internal.Text.Read
|
|
| 32 | 30 | import GHC.Internal.Text.Show
|
| 33 | 31 | |
| 34 | 32 | -- | Byte ordering.
|
| ... | ... | @@ -39,9 +37,7 @@ data ByteOrder |
| 39 | 37 | , Ord -- ^ @since base-4.11.0.0
|
| 40 | 38 | , Bounded -- ^ @since base-4.11.0.0
|
| 41 | 39 | , Enum -- ^ @since base-4.11.0.0
|
| 42 | - , Read -- ^ @since base-4.11.0.0
|
|
| 43 | 40 | , Show -- ^ @since base-4.11.0.0
|
| 44 | - , Generic -- ^ @since base-4.15.0.0
|
|
| 45 | 41 | )
|
| 46 | 42 | |
| 47 | 43 | -- | The byte ordering of the target machine.
|
| 1 | -{-# LANGUAGE NoImplicitPrelude #-}
|
|
| 2 | - |
|
| 3 | -{-
|
|
| 4 | -This SOURCE-imported hs-boot module cuts a big dependency loop:
|
|
| 5 | - |
|
| 6 | -module ‘GHC.Stable’
|
|
| 7 | -imports module ‘GHC.Ptr’
|
|
| 8 | -imports module ‘Numeric’
|
|
| 9 | -imports module ‘GHC.Read’
|
|
| 10 | -imports module ‘GHC.Unicode’
|
|
| 11 | -imports module ‘GHC.Unicode.Internal.Char.UnicodeData.GeneralCategory’
|
|
| 12 | -imports module ‘GHC.Unicode.Internal.Bits’
|
|
| 13 | -imports module ‘GHC.ByteOrder’
|
|
| 14 | -imports module ‘GHC.Generics’
|
|
| 15 | -imports module ‘Data.Ord’
|
|
| 16 | -imports module ‘Foreign.Storable’
|
|
| 17 | -imports module ‘GHC.Stable’
|
|
| 18 | --}
|
|
| 19 | - |
|
| 20 | -module GHC.Internal.ByteOrder where
|
|
| 21 | - |
|
| 22 | --- See W1 of Note [Tracking dependencies on primitives] in GHC.Internal.Base
|
|
| 23 | -import GHC.Internal.Types ()
|
|
| 24 | - |
|
| 25 | -data ByteOrder
|
|
| 26 | - = BigEndian
|
|
| 27 | - | LittleEndian
|
|
| 28 | - |
|
| 29 | -targetByteOrder :: ByteOrder |
| ... | ... | @@ -51,7 +51,7 @@ import GHC.Internal.Data.Tuple ( uncurry ) |
| 51 | 51 | import GHC.Internal.Data.Either
|
| 52 | 52 | import GHC.Internal.Control.Category
|
| 53 | 53 | import GHC.Internal.Base hiding ( (.), id )
|
| 54 | -import GHC.Internal.Generics (Generic, Generic1)
|
|
| 54 | +import GHC.Internal.Generics
|
|
| 55 | 55 | |
| 56 | 56 | infixr 5 <+>
|
| 57 | 57 | infixr 3 ***
|
| ... | ... | @@ -179,12 +179,6 @@ instance Arrow (->) where |
| 179 | 179 | -- | Kleisli arrows of a monad.
|
| 180 | 180 | newtype Kleisli m a b = Kleisli { runKleisli :: a -> m b }
|
| 181 | 181 | |
| 182 | --- | @since base-4.14.0.0
|
|
| 183 | -deriving instance Generic (Kleisli m a b)
|
|
| 184 | - |
|
| 185 | --- | @since base-4.14.0.0
|
|
| 186 | -deriving instance Generic1 (Kleisli m a)
|
|
| 187 | - |
|
| 188 | 182 | -- | @since base-4.14.0.0
|
| 189 | 183 | deriving instance Functor m => Functor (Kleisli m a)
|
| 190 | 184 | |
| ... | ... | @@ -416,3 +410,8 @@ leftApp :: ArrowApply a => a b c -> a (Either b d) (Either c d) |
| 416 | 410 | leftApp f = arr ((\b -> (arr (\() -> b) >>> f >>> arr Left, ())) |||
|
| 417 | 411 | (\d -> (arr (\() -> d) >>> arr Right, ()))) >>> app
|
| 418 | 412 | |
| 413 | +-- | @since base-4.14.0.0
|
|
| 414 | +deriving instance Generic (Kleisli m a b)
|
|
| 415 | + |
|
| 416 | +-- | @since base-4.14.0.0
|
|
| 417 | +deriving instance Generic1 (Kleisli m a) |
| ... | ... | @@ -39,7 +39,6 @@ import GHC.Internal.Data.NonEmpty ( NonEmpty(..) ) |
| 39 | 39 | import GHC.Internal.Data.Ord ( Down(..) )
|
| 40 | 40 | import GHC.Internal.Data.Tuple ( Solo(..), fst, snd )
|
| 41 | 41 | import GHC.Internal.Base ( IO, Monad, errorWithoutStackTrace, (.), return, liftM )
|
| 42 | -import GHC.Internal.Generics
|
|
| 43 | 42 | import GHC.Internal.List ( head, drop )
|
| 44 | 43 | import GHC.Internal.Control.Monad.ST.Imp
|
| 45 | 44 | import qualified GHC.Internal.Control.Monad.ST.Lazy.Imp as Lazy
|
| ... | ... | @@ -240,26 +239,6 @@ instance MonadFix f => MonadFix (Alt f) where |
| 240 | 239 | instance MonadFix f => MonadFix (Ap f) where
|
| 241 | 240 | mfix f = Ap (mfix (getAp . f))
|
| 242 | 241 | |
| 243 | --- Instances for GHC.Generics
|
|
| 244 | --- | @since base-4.9.0.0
|
|
| 245 | -instance MonadFix Par1 where
|
|
| 246 | - mfix f = Par1 (fix (unPar1 . f))
|
|
| 247 | - |
|
| 248 | --- | @since base-4.9.0.0
|
|
| 249 | -instance MonadFix f => MonadFix (Rec1 f) where
|
|
| 250 | - mfix f = Rec1 (mfix (unRec1 . f))
|
|
| 251 | - |
|
| 252 | --- | @since base-4.9.0.0
|
|
| 253 | -instance MonadFix f => MonadFix (M1 i c f) where
|
|
| 254 | - mfix f = M1 (mfix (unM1. f))
|
|
| 255 | - |
|
| 256 | --- | @since base-4.9.0.0
|
|
| 257 | -instance (MonadFix f, MonadFix g) => MonadFix (f :*: g) where
|
|
| 258 | - mfix f = (mfix (fstP . f)) :*: (mfix (sndP . f))
|
|
| 259 | - where
|
|
| 260 | - fstP (a :*: _) = a
|
|
| 261 | - sndP (_ :*: b) = b
|
|
| 262 | - |
|
| 263 | 242 | -- Instances for Data.Ord
|
| 264 | 243 | |
| 265 | 244 | -- | @since base-4.12.0.0
|
| ... | ... | @@ -65,7 +65,6 @@ import GHC.Internal.Arr ( Array(..), elems, numElements, |
| 65 | 65 | foldlElems', foldrElems',
|
| 66 | 66 | foldl1Elems, foldr1Elems)
|
| 67 | 67 | import GHC.Internal.Base hiding ( foldr )
|
| 68 | -import GHC.Internal.Generics
|
|
| 69 | 68 | import GHC.Internal.Tuple (Solo (..))
|
| 70 | 69 | import GHC.Internal.Num ( Num(..) )
|
| 71 | 70 | |
| ... | ... | @@ -860,67 +859,6 @@ instance (Foldable f) => Foldable (Alt f) where |
| 860 | 859 | instance (Foldable f) => Foldable (Ap f) where
|
| 861 | 860 | foldMap f = foldMap f . getAp
|
| 862 | 861 | |
| 863 | --- Instances for GHC.Generics
|
|
| 864 | --- | @since base-4.9.0.0
|
|
| 865 | -instance Foldable U1 where
|
|
| 866 | - foldMap _ _ = mempty
|
|
| 867 | - {-# INLINE foldMap #-}
|
|
| 868 | - fold _ = mempty
|
|
| 869 | - {-# INLINE fold #-}
|
|
| 870 | - foldr _ z _ = z
|
|
| 871 | - {-# INLINE foldr #-}
|
|
| 872 | - foldl _ z _ = z
|
|
| 873 | - {-# INLINE foldl #-}
|
|
| 874 | - foldl1 _ _ = errorWithoutStackTrace "foldl1: U1"
|
|
| 875 | - foldr1 _ _ = errorWithoutStackTrace "foldr1: U1"
|
|
| 876 | - length _ = 0
|
|
| 877 | - null _ = True
|
|
| 878 | - elem _ _ = False
|
|
| 879 | - sum _ = 0
|
|
| 880 | - product _ = 1
|
|
| 881 | - |
|
| 882 | --- | @since base-4.9.0.0
|
|
| 883 | -deriving instance Foldable V1
|
|
| 884 | - |
|
| 885 | --- | @since base-4.9.0.0
|
|
| 886 | -deriving instance Foldable Par1
|
|
| 887 | - |
|
| 888 | --- | @since base-4.9.0.0
|
|
| 889 | -deriving instance Foldable f => Foldable (Rec1 f)
|
|
| 890 | - |
|
| 891 | --- | @since base-4.9.0.0
|
|
| 892 | -deriving instance Foldable (K1 i c)
|
|
| 893 | - |
|
| 894 | --- | @since base-4.9.0.0
|
|
| 895 | -deriving instance Foldable f => Foldable (M1 i c f)
|
|
| 896 | - |
|
| 897 | --- | @since base-4.9.0.0
|
|
| 898 | -deriving instance (Foldable f, Foldable g) => Foldable (f :+: g)
|
|
| 899 | - |
|
| 900 | --- | @since base-4.9.0.0
|
|
| 901 | -deriving instance (Foldable f, Foldable g) => Foldable (f :*: g)
|
|
| 902 | - |
|
| 903 | --- | @since base-4.9.0.0
|
|
| 904 | -deriving instance (Foldable f, Foldable g) => Foldable (f :.: g)
|
|
| 905 | - |
|
| 906 | --- | @since base-4.9.0.0
|
|
| 907 | -deriving instance Foldable UAddr
|
|
| 908 | - |
|
| 909 | --- | @since base-4.9.0.0
|
|
| 910 | -deriving instance Foldable UChar
|
|
| 911 | - |
|
| 912 | --- | @since base-4.9.0.0
|
|
| 913 | -deriving instance Foldable UDouble
|
|
| 914 | - |
|
| 915 | --- | @since base-4.9.0.0
|
|
| 916 | -deriving instance Foldable UFloat
|
|
| 917 | - |
|
| 918 | --- | @since base-4.9.0.0
|
|
| 919 | -deriving instance Foldable UInt
|
|
| 920 | - |
|
| 921 | --- | @since base-4.9.0.0
|
|
| 922 | -deriving instance Foldable UWord
|
|
| 923 | - |
|
| 924 | 862 | -- Instances for Data.Ord
|
| 925 | 863 | -- | @since base-4.12.0.0
|
| 926 | 864 | deriving instance Foldable Down
|
| ... | ... | @@ -29,7 +29,6 @@ import GHC.Internal.Ix (Ix) |
| 29 | 29 | import GHC.Internal.Base
|
| 30 | 30 | import GHC.Internal.Enum (Bounded, Enum)
|
| 31 | 31 | import GHC.Internal.Float (Floating, RealFloat)
|
| 32 | -import GHC.Internal.Generics (Generic, Generic1)
|
|
| 33 | 32 | import GHC.Internal.Num (Num)
|
| 34 | 33 | import GHC.Internal.Real (Fractional, Integral, Real, RealFrac)
|
| 35 | 34 | import GHC.Internal.Read (Read(readsPrec), readParen, lex)
|
| ... | ... | @@ -57,8 +56,6 @@ newtype Const a b = Const { getConst :: a } |
| 57 | 56 | , FiniteBits -- ^ @since base-4.9.0.0
|
| 58 | 57 | , Floating -- ^ @since base-4.9.0.0
|
| 59 | 58 | , Fractional -- ^ @since base-4.9.0.0
|
| 60 | - , Generic -- ^ @since base-4.9.0.0
|
|
| 61 | - , Generic1 -- ^ @since base-4.9.0.0
|
|
| 62 | 59 | , Integral -- ^ @since base-4.9.0.0
|
| 63 | 60 | , Ix -- ^ @since base-4.9.0.0
|
| 64 | 61 | , Semigroup -- ^ @since base-4.9.0.0
|
| ... | ... | @@ -43,7 +43,6 @@ import GHC.Internal.Base ( Applicative(..), Eq(..), Functor(..), Monad(..) |
| 43 | 43 | , Semigroup, Monoid, Ord(..), ($), (.) )
|
| 44 | 44 | import GHC.Internal.Enum (Bounded, Enum)
|
| 45 | 45 | import GHC.Internal.Float (Floating, RealFloat)
|
| 46 | -import GHC.Internal.Generics (Generic, Generic1)
|
|
| 47 | 46 | import GHC.Internal.Num (Num)
|
| 48 | 47 | import GHC.Internal.Read (Read(..), lex, readParen)
|
| 49 | 48 | import GHC.Internal.Real (Fractional, Integral, Real, RealFrac)
|
| ... | ... | @@ -77,8 +76,6 @@ newtype Identity a = Identity { runIdentity :: a } |
| 77 | 76 | , FiniteBits -- ^ @since base-4.9.0.0
|
| 78 | 77 | , Floating -- ^ @since base-4.9.0.0
|
| 79 | 78 | , Fractional -- ^ @since base-4.9.0.0
|
| 80 | - , Generic -- ^ @since base-4.8.0.0
|
|
| 81 | - , Generic1 -- ^ @since base-4.8.0.0
|
|
| 82 | 79 | , Integral -- ^ @since base-4.9.0.0
|
| 83 | 80 | , Ix -- ^ @since base-4.9.0.0
|
| 84 | 81 | , Semigroup -- ^ @since base-4.9.0.0
|
| 1 | -{-# LANGUAGE DeriveGeneric #-}
|
|
| 2 | 1 | {-# LANGUAGE GeneralizedNewtypeDeriving #-}
|
| 3 | 2 | {-# LANGUAGE NoImplicitPrelude #-}
|
| 4 | 3 | {-# LANGUAGE PolyKinds #-}
|
| ... | ... | @@ -85,7 +84,6 @@ module GHC.Internal.Data.Monoid ( |
| 85 | 84 | -- Push down the module in the dependency hierarchy.
|
| 86 | 85 | import GHC.Internal.Base hiding (Any)
|
| 87 | 86 | import GHC.Internal.Enum
|
| 88 | -import GHC.Internal.Generics
|
|
| 89 | 87 | import GHC.Internal.Num
|
| 90 | 88 | import GHC.Internal.Read
|
| 91 | 89 | import GHC.Internal.Show
|
| ... | ... | @@ -148,8 +146,6 @@ newtype First a = First { getFirst :: Maybe a } |
| 148 | 146 | , Ord -- ^ @since base-2.01
|
| 149 | 147 | , Read -- ^ @since base-2.01
|
| 150 | 148 | , Show -- ^ @since base-2.01
|
| 151 | - , Generic -- ^ @since base-4.7.0.0
|
|
| 152 | - , Generic1 -- ^ @since base-4.7.0.0
|
|
| 153 | 149 | , Functor -- ^ @since base-4.8.0.0
|
| 154 | 150 | , Applicative -- ^ @since base-4.8.0.0
|
| 155 | 151 | , Monad -- ^ @since base-4.8.0.0
|
| ... | ... | @@ -190,8 +186,6 @@ newtype Last a = Last { getLast :: Maybe a } |
| 190 | 186 | , Ord -- ^ @since base-2.01
|
| 191 | 187 | , Read -- ^ @since base-2.01
|
| 192 | 188 | , Show -- ^ @since base-2.01
|
| 193 | - , Generic -- ^ @since base-4.7.0.0
|
|
| 194 | - , Generic1 -- ^ @since base-4.7.0.0
|
|
| 195 | 189 | , Functor -- ^ @since base-4.8.0.0
|
| 196 | 190 | , Applicative -- ^ @since base-4.8.0.0
|
| 197 | 191 | , Monad -- ^ @since base-4.8.0.0
|
| ... | ... | @@ -225,8 +219,6 @@ newtype Ap f a = Ap { getAp :: f a } |
| 225 | 219 | , Enum -- ^ @since base-4.12.0.0
|
| 226 | 220 | , Eq -- ^ @since base-4.12.0.0
|
| 227 | 221 | , Functor -- ^ @since base-4.12.0.0
|
| 228 | - , Generic -- ^ @since base-4.12.0.0
|
|
| 229 | - , Generic1 -- ^ @since base-4.12.0.0
|
|
| 230 | 222 | , Monad -- ^ @since base-4.12.0.0
|
| 231 | 223 | , MonadFail -- ^ @since base-4.12.0.0
|
| 232 | 224 | , MonadPlus -- ^ @since base-4.12.0.0
|
| 1 | 1 | {-# LANGUAGE NoImplicitPrelude #-}
|
| 2 | 2 | {-# LANGUAGE BangPatterns #-}
|
| 3 | -{-# LANGUAGE DeriveGeneric #-}
|
|
| 4 | 3 | {-# LANGUAGE GeneralizedNewtypeDeriving #-}
|
| 5 | 4 | {-# LANGUAGE PolyKinds #-}
|
| 6 | 5 | {-# LANGUAGE ScopedTypeVariables #-}
|
| ... | ... | @@ -26,7 +25,6 @@ import qualified GHC.Internal.List as List |
| 26 | 25 | import GHC.Internal.Num
|
| 27 | 26 | import GHC.Internal.Read
|
| 28 | 27 | import GHC.Internal.Show
|
| 29 | -import GHC.Internal.Generics
|
|
| 30 | 28 | import GHC.Internal.Real
|
| 31 | 29 | |
| 32 | 30 | -- | This is a valid definition of 'stimes' for an idempotent 'Semigroup'.
|
| ... | ... | @@ -90,8 +88,6 @@ newtype Dual a = Dual { getDual :: a } |
| 90 | 88 | , Read -- ^ @since base-2.01
|
| 91 | 89 | , Show -- ^ @since base-2.01
|
| 92 | 90 | , Bounded -- ^ @since base-2.01
|
| 93 | - , Generic -- ^ @since base-4.7.0.0
|
|
| 94 | - , Generic1 -- ^ @since base-4.7.0.0
|
|
| 95 | 91 | )
|
| 96 | 92 | |
| 97 | 93 | -- | @since base-4.9.0.0
|
| ... | ... | @@ -130,8 +126,6 @@ instance Monad Dual where |
| 130 | 126 | -- >>> appEndo computation 1
|
| 131 | 127 | -- 6
|
| 132 | 128 | newtype Endo a = Endo { appEndo :: a -> a }
|
| 133 | - deriving ( Generic -- ^ @since base-4.7.0.0
|
|
| 134 | - )
|
|
| 135 | 129 | |
| 136 | 130 | -- | @since base-4.9.0.0
|
| 137 | 131 | instance Semigroup (Endo a) where
|
| ... | ... | @@ -200,7 +194,6 @@ newtype All = All { getAll :: Bool } |
| 200 | 194 | , Read -- ^ @since base-2.01
|
| 201 | 195 | , Show -- ^ @since base-2.01
|
| 202 | 196 | , Bounded -- ^ @since base-2.01
|
| 203 | - , Generic -- ^ @since base-4.7.0.0
|
|
| 204 | 197 | )
|
| 205 | 198 | |
| 206 | 199 | -- | @since base-4.9.0.0
|
| ... | ... | @@ -232,7 +225,6 @@ newtype Any = Any { getAny :: Bool } |
| 232 | 225 | , Read -- ^ @since base-2.01
|
| 233 | 226 | , Show -- ^ @since base-2.01
|
| 234 | 227 | , Bounded -- ^ @since base-2.01
|
| 235 | - , Generic -- ^ @since base-4.7.0.0
|
|
| 236 | 228 | )
|
| 237 | 229 | |
| 238 | 230 | -- | @since base-4.9.0.0
|
| ... | ... | @@ -261,8 +253,6 @@ newtype Sum a = Sum { getSum :: a } |
| 261 | 253 | , Read -- ^ @since base-2.01
|
| 262 | 254 | , Show -- ^ @since base-2.01
|
| 263 | 255 | , Bounded -- ^ @since base-2.01
|
| 264 | - , Generic -- ^ @since base-4.7.0.0
|
|
| 265 | - , Generic1 -- ^ @since base-4.7.0.0
|
|
| 266 | 256 | , Num -- ^ @since base-4.7.0.0
|
| 267 | 257 | )
|
| 268 | 258 | |
| ... | ... | @@ -309,8 +299,6 @@ newtype Product a = Product { getProduct :: a } |
| 309 | 299 | , Read -- ^ @since base-2.01
|
| 310 | 300 | , Show -- ^ @since base-2.01
|
| 311 | 301 | , Bounded -- ^ @since base-2.01
|
| 312 | - , Generic -- ^ @since base-4.7.0.0
|
|
| 313 | - , Generic1 -- ^ @since base-4.7.0.0
|
|
| 314 | 302 | , Num -- ^ @since base-4.7.0.0
|
| 315 | 303 | )
|
| 316 | 304 | |
| ... | ... | @@ -355,9 +343,7 @@ instance Monad Product where |
| 355 | 343 | --
|
| 356 | 344 | -- @since base-4.8.0.0
|
| 357 | 345 | newtype Alt f a = Alt {getAlt :: f a}
|
| 358 | - deriving ( Generic -- ^ @since base-4.8.0.0
|
|
| 359 | - , Generic1 -- ^ @since base-4.8.0.0
|
|
| 360 | - , Read -- ^ @since base-4.8.0.0
|
|
| 346 | + deriving ( Read -- ^ @since base-4.8.0.0
|
|
| 361 | 347 | , Show -- ^ @since base-4.8.0.0
|
| 362 | 348 | , Eq -- ^ @since base-4.8.0.0
|
| 363 | 349 | , Ord -- ^ @since base-4.8.0.0
|
| ... | ... | @@ -51,8 +51,7 @@ import GHC.Internal.Data.Proxy ( Proxy(..) ) |
| 51 | 51 | |
| 52 | 52 | import GHC.Internal.Arr
|
| 53 | 53 | import GHC.Internal.Base ( Applicative(..), Monad(..), Monoid, Maybe(..), NonEmpty(..),
|
| 54 | - ($), (.), id, flip )
|
|
| 55 | -import GHC.Internal.Generics
|
|
| 54 | + (.), id, flip, ($) )
|
|
| 56 | 55 | import qualified GHC.Internal.List as List ( foldr )
|
| 57 | 56 | import GHC.Internal.Tuple (Solo (..))
|
| 58 | 57 | |
| ... | ... | @@ -310,60 +309,6 @@ instance (Traversable f) => Traversable (Ap f) where |
| 310 | 309 | deriving instance Traversable Identity
|
| 311 | 310 | |
| 312 | 311 | |
| 313 | --- Instances for GHC.Generics
|
|
| 314 | --- | @since base-4.9.0.0
|
|
| 315 | -instance Traversable U1 where
|
|
| 316 | - traverse _ _ = pure U1
|
|
| 317 | - {-# INLINE traverse #-}
|
|
| 318 | - sequenceA _ = pure U1
|
|
| 319 | - {-# INLINE sequenceA #-}
|
|
| 320 | - mapM _ _ = pure U1
|
|
| 321 | - {-# INLINE mapM #-}
|
|
| 322 | - sequence _ = pure U1
|
|
| 323 | - {-# INLINE sequence #-}
|
|
| 324 | - |
|
| 325 | --- | @since base-4.9.0.0
|
|
| 326 | -deriving instance Traversable V1
|
|
| 327 | - |
|
| 328 | --- | @since base-4.9.0.0
|
|
| 329 | -deriving instance Traversable Par1
|
|
| 330 | - |
|
| 331 | --- | @since base-4.9.0.0
|
|
| 332 | -deriving instance Traversable f => Traversable (Rec1 f)
|
|
| 333 | - |
|
| 334 | --- | @since base-4.9.0.0
|
|
| 335 | -deriving instance Traversable (K1 i c)
|
|
| 336 | - |
|
| 337 | --- | @since base-4.9.0.0
|
|
| 338 | -deriving instance Traversable f => Traversable (M1 i c f)
|
|
| 339 | - |
|
| 340 | --- | @since base-4.9.0.0
|
|
| 341 | -deriving instance (Traversable f, Traversable g) => Traversable (f :+: g)
|
|
| 342 | - |
|
| 343 | --- | @since base-4.9.0.0
|
|
| 344 | -deriving instance (Traversable f, Traversable g) => Traversable (f :*: g)
|
|
| 345 | - |
|
| 346 | --- | @since base-4.9.0.0
|
|
| 347 | -deriving instance (Traversable f, Traversable g) => Traversable (f :.: g)
|
|
| 348 | - |
|
| 349 | --- | @since base-4.9.0.0
|
|
| 350 | -deriving instance Traversable UAddr
|
|
| 351 | - |
|
| 352 | --- | @since base-4.9.0.0
|
|
| 353 | -deriving instance Traversable UChar
|
|
| 354 | - |
|
| 355 | --- | @since base-4.9.0.0
|
|
| 356 | -deriving instance Traversable UDouble
|
|
| 357 | - |
|
| 358 | --- | @since base-4.9.0.0
|
|
| 359 | -deriving instance Traversable UFloat
|
|
| 360 | - |
|
| 361 | --- | @since base-4.9.0.0
|
|
| 362 | -deriving instance Traversable UInt
|
|
| 363 | - |
|
| 364 | --- | @since base-4.9.0.0
|
|
| 365 | -deriving instance Traversable UWord
|
|
| 366 | - |
|
| 367 | 312 | -- Instance for Data.Ord
|
| 368 | 313 | -- | @since base-4.12.0.0
|
| 369 | 314 | deriving instance Traversable Down
|
| 1 | 1 | {-# LANGUAGE NoImplicitPrelude #-}
|
| 2 | 2 | {-# LANGUAGE StandaloneDeriving #-}
|
| 3 | 3 | {-# LANGUAGE DeriveFunctor #-}
|
| 4 | -{-# LANGUAGE DeriveGeneric #-}
|
|
| 5 | 4 | {-# LANGUAGE DeriveFoldable #-}
|
| 6 | 5 | |
| 7 | 6 | module GHC.Internal.Functor.ZipList (ZipList(..)) where
|
| 8 | 7 | |
| 9 | 8 | import GHC.Internal.Base
|
| 10 | -import GHC.Internal.Generics
|
|
| 11 | 9 | import GHC.Internal.List (repeat, zipWith)
|
| 12 | 10 | import GHC.Internal.Read (Read)
|
| 13 | 11 | import GHC.Internal.Show (Show)
|
| ... | ... | @@ -41,8 +39,6 @@ newtype ZipList a = ZipList { getZipList :: [a] } |
| 41 | 39 | , Read -- ^ @since base-4.7.0.0
|
| 42 | 40 | , Functor -- ^ @since base-2.01
|
| 43 | 41 | , Foldable -- ^ @since base-4.9.0.0
|
| 44 | - , Generic -- ^ @since base-4.7.0.0
|
|
| 45 | - , Generic1 -- ^ @since base-4.7.0.0
|
|
| 46 | 42 | )
|
| 47 | 43 | |
| 48 | 44 |
| ... | ... | @@ -3,7 +3,9 @@ |
| 3 | 3 | {-# LANGUAGE CPP #-}
|
| 4 | 4 | {-# LANGUAGE DataKinds #-}
|
| 5 | 5 | {-# LANGUAGE DeriveFunctor #-}
|
| 6 | +{-# LANGUAGE DeriveFoldable #-}
|
|
| 6 | 7 | {-# LANGUAGE DeriveGeneric #-}
|
| 8 | +{-# LANGUAGE DeriveTraversable #-}
|
|
| 7 | 9 | {-# LANGUAGE EmptyDataDeriving #-}
|
| 8 | 10 | {-# LANGUAGE FlexibleContexts #-}
|
| 9 | 11 | {-# LANGUAGE FlexibleInstances #-}
|
| ... | ... | @@ -736,13 +738,13 @@ import GHC.Internal.Data.Ord ( Down(..) ) |
| 736 | 738 | import GHC.Internal.Bignum.Integer ( Integer, integerToInt )
|
| 737 | 739 | import GHC.Internal.Prim ( Addr#, Char#, Double#, Float#, Int#, Word# )
|
| 738 | 740 | import GHC.Internal.Ptr ( Ptr(..) )
|
| 739 | -import GHC.Internal.Types
|
|
| 741 | +import GHC.Internal.Types hiding (Any) -- clashes with the Semigroup
|
|
| 740 | 742 | |
| 741 | 743 | -- Needed for instances
|
| 742 | 744 | import GHC.Internal.Ix ( Ix )
|
| 743 | 745 | import GHC.Internal.Base ( Alternative(..), Applicative(..), Functor(..)
|
| 744 | 746 | , Monad(..), MonadPlus(..), NonEmpty(..), String, coerce
|
| 745 | - , Semigroup(..), Monoid(..), Void )
|
|
| 747 | + , Semigroup(..), Void, errorWithoutStackTrace, liftM2 )
|
|
| 746 | 748 | import GHC.Internal.Classes ( Eq(..), Ord(..) )
|
| 747 | 749 | import GHC.Internal.Enum ( Bounded, Enum )
|
| 748 | 750 | import GHC.Internal.Read ( Read(..) )
|
| ... | ... | @@ -751,6 +753,15 @@ import GHC.Internal.Stack.Types ( SrcLoc(..) ) |
| 751 | 753 | import GHC.Internal.Tuple (Solo (..))
|
| 752 | 754 | import GHC.Internal.Unicode ( GeneralCategory(..) )
|
| 753 | 755 | import GHC.Internal.Fingerprint.Type ( Fingerprint(..) )
|
| 756 | +import GHC.Internal.Data.Semigroup.Internal
|
|
| 757 | +import GHC.Internal.Data.Monoid
|
|
| 758 | +import GHC.Internal.Data.Foldable
|
|
| 759 | +import GHC.Internal.Data.Traversable
|
|
| 760 | +import GHC.Internal.Data.Functor.Const
|
|
| 761 | +import GHC.Internal.Data.Functor.Identity
|
|
| 762 | +import GHC.Internal.Functor.ZipList
|
|
| 763 | +import GHC.Internal.IO.Exception ( ExitCode(..) )
|
|
| 764 | +import GHC.Internal.ByteOrder ( ByteOrder(..) )
|
|
| 754 | 765 | |
| 755 | 766 | -- Needed for metadata
|
| 756 | 767 | import GHC.Internal.Data.Proxy ( Proxy(..) )
|
| ... | ... | @@ -1879,3 +1890,191 @@ instance SingKind DecidedStrictness where |
| 1879 | 1890 | fromSing SDecidedLazy = DecidedLazy
|
| 1880 | 1891 | fromSing SDecidedStrict = DecidedStrict
|
| 1881 | 1892 | fromSing SDecidedUnpack = DecidedUnpack
|
| 1893 | + |
|
| 1894 | +-- | @since base-4.7.0.0
|
|
| 1895 | +deriving instance Generic (Dual a)
|
|
| 1896 | + |
|
| 1897 | +-- | @since base-4.7.0.0
|
|
| 1898 | +deriving instance Generic1 Dual
|
|
| 1899 | + |
|
| 1900 | +-- | @since base-4.7.0.0
|
|
| 1901 | +deriving instance Generic (Endo a)
|
|
| 1902 | + |
|
| 1903 | +-- | @since base-4.7.0.0
|
|
| 1904 | +deriving instance Generic All
|
|
| 1905 | + |
|
| 1906 | +-- | @since base-4.7.0.0
|
|
| 1907 | +deriving instance Generic Any
|
|
| 1908 | + |
|
| 1909 | +-- | @since base-4.7.0.0
|
|
| 1910 | +deriving instance Generic (Sum a)
|
|
| 1911 | + |
|
| 1912 | +-- | @since base-4.7.0.0
|
|
| 1913 | +deriving instance Generic1 Sum
|
|
| 1914 | + |
|
| 1915 | +-- | @since base-4.7.0.0
|
|
| 1916 | +deriving instance Generic (Product a)
|
|
| 1917 | + |
|
| 1918 | +-- | @since base-4.7.0.0
|
|
| 1919 | +deriving instance Generic1 Product
|
|
| 1920 | + |
|
| 1921 | +-- | @since base-4.8.0.0
|
|
| 1922 | +deriving instance Generic (Alt f a)
|
|
| 1923 | + |
|
| 1924 | +-- | @since base-4.8.0.0
|
|
| 1925 | +deriving instance Generic1 (Alt f)
|
|
| 1926 | + |
|
| 1927 | +-- | @since base-4.7.0.0
|
|
| 1928 | +deriving instance Generic (First a)
|
|
| 1929 | + |
|
| 1930 | +-- | @since base-4.7.0.0
|
|
| 1931 | +deriving instance Generic1 First
|
|
| 1932 | + |
|
| 1933 | +-- | @since base-4.7.0.0
|
|
| 1934 | +deriving instance Generic (Last a)
|
|
| 1935 | + |
|
| 1936 | +-- | @since base-4.7.0.0
|
|
| 1937 | +deriving instance Generic1 Last
|
|
| 1938 | + |
|
| 1939 | +-- | @since base-4.12.0.0
|
|
| 1940 | +deriving instance Generic (Ap f a)
|
|
| 1941 | + |
|
| 1942 | +-- | @since base-4.12.0.0
|
|
| 1943 | +deriving instance Generic1 (Ap f)
|
|
| 1944 | + |
|
| 1945 | +-- | @since base-4.9.0.0
|
|
| 1946 | +instance Foldable U1 where
|
|
| 1947 | + foldMap _ _ = mempty
|
|
| 1948 | + {-# INLINE foldMap #-}
|
|
| 1949 | + fold _ = mempty
|
|
| 1950 | + {-# INLINE fold #-}
|
|
| 1951 | + foldr _ z _ = z
|
|
| 1952 | + {-# INLINE foldr #-}
|
|
| 1953 | + foldl _ z _ = z
|
|
| 1954 | + {-# INLINE foldl #-}
|
|
| 1955 | + foldl1 _ _ = errorWithoutStackTrace "foldl1: U1"
|
|
| 1956 | + foldr1 _ _ = errorWithoutStackTrace "foldr1: U1"
|
|
| 1957 | + length _ = 0
|
|
| 1958 | + null _ = True
|
|
| 1959 | + elem _ _ = False
|
|
| 1960 | + sum _ = 0
|
|
| 1961 | + product _ = 1
|
|
| 1962 | + |
|
| 1963 | +-- | @since base-4.9.0.0
|
|
| 1964 | +deriving instance Foldable V1
|
|
| 1965 | + |
|
| 1966 | +-- | @since base-4.9.0.0
|
|
| 1967 | +deriving instance Foldable Par1
|
|
| 1968 | + |
|
| 1969 | +-- | @since base-4.9.0.0
|
|
| 1970 | +deriving instance Foldable f => Foldable (Rec1 f)
|
|
| 1971 | + |
|
| 1972 | +-- | @since base-4.9.0.0
|
|
| 1973 | +deriving instance Foldable (K1 i c)
|
|
| 1974 | + |
|
| 1975 | +-- | @since base-4.9.0.0
|
|
| 1976 | +deriving instance Foldable f => Foldable (M1 i c f)
|
|
| 1977 | + |
|
| 1978 | +-- | @since base-4.9.0.0
|
|
| 1979 | +deriving instance (Foldable f, Foldable g) => Foldable (f :+: g)
|
|
| 1980 | + |
|
| 1981 | +-- | @since base-4.9.0.0
|
|
| 1982 | +deriving instance (Foldable f, Foldable g) => Foldable (f :*: g)
|
|
| 1983 | + |
|
| 1984 | +-- | @since base-4.9.0.0
|
|
| 1985 | +deriving instance (Foldable f, Foldable g) => Foldable (f :.: g)
|
|
| 1986 | + |
|
| 1987 | +-- | @since base-4.9.0.0
|
|
| 1988 | +deriving instance Foldable UAddr
|
|
| 1989 | + |
|
| 1990 | +-- | @since base-4.9.0.0
|
|
| 1991 | +deriving instance Foldable UChar
|
|
| 1992 | + |
|
| 1993 | +-- | @since base-4.9.0.0
|
|
| 1994 | +deriving instance Foldable UDouble
|
|
| 1995 | + |
|
| 1996 | +-- | @since base-4.9.0.0
|
|
| 1997 | +deriving instance Foldable UFloat
|
|
| 1998 | + |
|
| 1999 | +-- | @since base-4.9.0.0
|
|
| 2000 | +deriving instance Foldable UInt
|
|
| 2001 | + |
|
| 2002 | +-- | @since base-4.9.0.0
|
|
| 2003 | +deriving instance Foldable UWord
|
|
| 2004 | + |
|
| 2005 | +-- | @since base-4.9.0.0
|
|
| 2006 | +instance Traversable U1 where
|
|
| 2007 | + traverse _ _ = pure U1
|
|
| 2008 | + {-# INLINE traverse #-}
|
|
| 2009 | + sequenceA _ = pure U1
|
|
| 2010 | + {-# INLINE sequenceA #-}
|
|
| 2011 | + mapM _ _ = pure U1
|
|
| 2012 | + {-# INLINE mapM #-}
|
|
| 2013 | + sequence _ = pure U1
|
|
| 2014 | + {-# INLINE sequence #-}
|
|
| 2015 | + |
|
| 2016 | +-- | @since base-4.9.0.0
|
|
| 2017 | +deriving instance Traversable V1
|
|
| 2018 | + |
|
| 2019 | +-- | @since base-4.9.0.0
|
|
| 2020 | +deriving instance Traversable Par1
|
|
| 2021 | + |
|
| 2022 | +-- | @since base-4.9.0.0
|
|
| 2023 | +deriving instance Traversable f => Traversable (Rec1 f)
|
|
| 2024 | + |
|
| 2025 | +-- | @since base-4.9.0.0
|
|
| 2026 | +deriving instance Traversable (K1 i c)
|
|
| 2027 | + |
|
| 2028 | +-- | @since base-4.9.0.0
|
|
| 2029 | +deriving instance Traversable f => Traversable (M1 i c f)
|
|
| 2030 | + |
|
| 2031 | +-- | @since base-4.9.0.0
|
|
| 2032 | +deriving instance (Traversable f, Traversable g) => Traversable (f :+: g)
|
|
| 2033 | + |
|
| 2034 | +-- | @since base-4.9.0.0
|
|
| 2035 | +deriving instance (Traversable f, Traversable g) => Traversable (f :*: g)
|
|
| 2036 | + |
|
| 2037 | +-- | @since base-4.9.0.0
|
|
| 2038 | +deriving instance (Traversable f, Traversable g) => Traversable (f :.: g)
|
|
| 2039 | + |
|
| 2040 | +-- | @since base-4.9.0.0
|
|
| 2041 | +deriving instance Traversable UAddr
|
|
| 2042 | + |
|
| 2043 | +-- | @since base-4.9.0.0
|
|
| 2044 | +deriving instance Traversable UChar
|
|
| 2045 | + |
|
| 2046 | +-- | @since base-4.9.0.0
|
|
| 2047 | +deriving instance Traversable UDouble
|
|
| 2048 | + |
|
| 2049 | +-- | @since base-4.9.0.0
|
|
| 2050 | +deriving instance Traversable UFloat
|
|
| 2051 | + |
|
| 2052 | +-- | @since base-4.9.0.0
|
|
| 2053 | +deriving instance Traversable UInt
|
|
| 2054 | + |
|
| 2055 | +-- | @since base-4.9.0.0
|
|
| 2056 | +deriving instance Traversable UWord
|
|
| 2057 | + |
|
| 2058 | +-- | @since base-4.9.0.0
|
|
| 2059 | +deriving instance Generic (Const a b)
|
|
| 2060 | + |
|
| 2061 | +-- | @since base-4.9.0.0
|
|
| 2062 | +deriving instance Generic1 (Const a)
|
|
| 2063 | + |
|
| 2064 | +-- | @since base-4.8.0.0
|
|
| 2065 | +deriving instance Generic (Identity a)
|
|
| 2066 | + |
|
| 2067 | +-- | @since base-4.8.0.0
|
|
| 2068 | +deriving instance Generic1 Identity
|
|
| 2069 | + |
|
| 2070 | +-- | @since base-4.7.0.0
|
|
| 2071 | +deriving instance Generic (ZipList a)
|
|
| 2072 | + |
|
| 2073 | +-- | @since base-4.7.0.0
|
|
| 2074 | +deriving instance Generic1 ZipList
|
|
| 2075 | + |
|
| 2076 | +-- TODO: since when??
|
|
| 2077 | +deriving instance Generic ExitCode
|
|
| 2078 | + |
|
| 2079 | +-- | @since base-4.15.0.0
|
|
| 2080 | +deriving instance Generic ByteOrder |
| 1 | 1 | {-# LANGUAGE Trustworthy #-}
|
| 2 | -{-# LANGUAGE DeriveGeneric, NoImplicitPrelude, MagicHash,
|
|
| 2 | +{-# LANGUAGE NoImplicitPrelude, MagicHash,
|
|
| 3 | 3 | ExistentialQuantification, ImplicitParams #-}
|
| 4 | 4 | {-# OPTIONS_GHC -funbox-strict-fields #-}
|
| 5 | 5 | {-# OPTIONS_HADDOCK not-home #-}
|
| ... | ... | @@ -52,7 +52,6 @@ module GHC.Internal.IO.Exception ( |
| 52 | 52 | ) where
|
| 53 | 53 | |
| 54 | 54 | import GHC.Internal.Base
|
| 55 | -import GHC.Internal.Generics
|
|
| 56 | 55 | import GHC.Internal.List
|
| 57 | 56 | import GHC.Internal.IO
|
| 58 | 57 | import GHC.Internal.Show
|
| ... | ... | @@ -306,7 +305,7 @@ data ExitCode |
| 306 | 305 | -- The exact interpretation of the code is
|
| 307 | 306 | -- operating-system dependent. In particular, some values
|
| 308 | 307 | -- may be prohibited (e.g. 0 on a POSIX-compliant system).
|
| 309 | - deriving (Eq, Ord, Read, Show, Generic)
|
|
| 308 | + deriving (Eq, Ord, Read, Show)
|
|
| 310 | 309 | |
| 311 | 310 | -- | @since base-4.1.0.0
|
| 312 | 311 | instance Exception ExitCode
|
| ... | ... | @@ -74,6 +74,7 @@ import GHC.Internal.Arr |
| 74 | 74 | import GHC.Internal.Word
|
| 75 | 75 | import GHC.Internal.List (filter)
|
| 76 | 76 | import GHC.Internal.Tuple (Solo (..))
|
| 77 | +import GHC.Internal.ByteOrder
|
|
| 77 | 78 | |
| 78 | 79 | |
| 79 | 80 | -- | @'readParen' 'True' p@ parses what @p@ parses, but surrounded with
|
| ... | ... | @@ -833,3 +834,6 @@ instance (Read a, Read b, Read c, Read d, Read e, Read f, Read g, Read h, |
| 833 | 834 | ; return (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o) })
|
| 834 | 835 | readListPrec = readListPrecDefault
|
| 835 | 836 | readList = readListDefault
|
| 837 | + |
|
| 838 | +-- | @since base-4.11.0.0
|
|
| 839 | +deriving instance Read ByteOrder |
| ... | ... | @@ -31,7 +31,7 @@ module GHC.Internal.Unicode.Bits |
| 31 | 31 | where
|
| 32 | 32 | |
| 33 | 33 | import GHC.Internal.Bits (finiteBitSize, popCount)
|
| 34 | -import {-# SOURCE #-} GHC.Internal.ByteOrder
|
|
| 34 | +import GHC.Internal.ByteOrder
|
|
| 35 | 35 | import GHC.Internal.Prim
|
| 36 | 36 | import GHC.Internal.ST
|
| 37 | 37 | import GHC.Internal.Base
|