[Git][ghc/ghc][wip/27532] UniqueDFM: alter should preserve insertion order
Zubin pushed to branch wip/27532 at Glasgow Haskell Compiler / GHC Commits: aa074c95 by Zubin Duggal at 2026-07-25T10:38:55+05:30 UniqueDFM: alter should preserve insertion order Before it always inserting new elements at the end. This is problematic because instances get inserted into the map with `alterF`, which can change ordering of how instances are printed with `:info` depending on the order in which we consult interfaces I expect `alter id k = id` and `alter (fmap f) k = adjust f k`. Moving keys to the end breaks that (`adjust` already preserves position). Fixes #27532 - - - - - 28 changed files: - + changelog.d/27532 - compiler/GHC/Types/Unique/DFM.hs - testsuite/tests/ghci/T16793/T16793.stdout - testsuite/tests/ghci/T18060/T18060.stdout - + testsuite/tests/ghci/T27532/Makefile - + testsuite/tests/ghci/T27532/T27532.stdout - + testsuite/tests/ghci/T27532/T27532j4.stdout - + testsuite/tests/ghci/T27532/a.script - + testsuite/tests/ghci/T27532/all.T - + testsuite/tests/ghci/T27532/b.script - + testsuite/tests/ghci/T27532/genT27532Modules - testsuite/tests/ghci/scripts/ListTuplePunsPpr.stdout - testsuite/tests/ghci/scripts/T4175.stdout - testsuite/tests/ghci/scripts/T8469.stdout - testsuite/tests/ghci/scripts/T8535.stdout - testsuite/tests/ghci/scripts/T9881.stdout - testsuite/tests/ghci/scripts/ghci020.stdout - testsuite/tests/ghci/scripts/ghci064.stdout - testsuite/tests/ghci/should_run/T10145.stdout - testsuite/tests/ghci/should_run/T18594.stdout - testsuite/tests/partial-sigs/should_compile/ExtraConstraints3.stderr - testsuite/tests/roles/should_compile/Roles14.stderr - testsuite/tests/roles/should_compile/Roles3.stderr - testsuite/tests/roles/should_compile/Roles4.stderr - testsuite/tests/roles/should_compile/T8958.stderr - testsuite/tests/typecheck/should_compile/T18406b.stderr - testsuite/tests/typecheck/should_compile/T18529.stderr - testsuite/tests/typecheck/should_fail/T5300.stderr Changes: ===================================== changelog.d/27532 ===================================== @@ -0,0 +1,9 @@ +section: compiler +synopsis: Make instance ordering in :info output stable +description: + Updating an existing key in a UniqDFM no longer moves it to the end of the + iteration order. Previously the order of instances printed by :info depended + on the order in which interfaces were loaded, so it could change after + unrelated imports and differ between compiler builds. +mrs: !16385 +issues: #27532 ===================================== compiler/GHC/Types/Unique/DFM.hs ===================================== @@ -91,6 +91,11 @@ import qualified GHC.Data.Word64Set as W -- If the client of the map performs operations on the map in deterministic -- order then `udfmToList` returns them in deterministic order. -- +-- The order does not depend on how existing entries were +-- updated. Updating an existing entry keeps it original position in the order +-- This means `alterUDFM` consistent with `addToUDFM` and `adjustUDFM`, +-- so that for example `alterUDFM id k = id` and `alterUDFM (fmap f) k = adjustUDFM f k` +-- -- There is an implementation cost: each element is given a serial number -- as it is added, and `udfmToList` sorts its result by this serial -- number. So you should only use `UniqDFM` if you need the deterministic @@ -110,6 +115,14 @@ import qualified GHC.Data.Word64Set as W -- every value with the insertion time that can later be used to sort the -- values when asked to convert to a list. -- +-- Updating an existing key keeps the old tag. This keeps the order stable for +-- maps whose entries are updated many times. The instance environments are +-- the main example: inserting an instance updates the entry of its class in a +-- DNameEnv, and when updates moved keys to the end the order of instances shown +-- by :info depended on the order in which interfaces happened to be loaded +-- (#27532). Now a class keeps its place once its first instance is added, so +-- loading further interfaces cannot change the order. +-- -- An alternative would be to have -- -- data UniqDFM ele = UDFM (M.IntMap ele) [ele] @@ -169,11 +182,13 @@ emptyUDFM = UDFM M.empty 0 unitUDFM :: Uniquable key => key -> elt -> UniqDFM key elt unitUDFM k v = UDFM (M.singleton (getKey $ getUnique k) (TaggedVal v 0)) 1 --- The new binding always goes to the right of existing ones +-- A new key goes to the right of existing ones +-- Overwriting an existing key keeps its position in the iteration order addToUDFM :: Uniquable key => UniqDFM key elt -> key -> elt -> UniqDFM key elt addToUDFM m k v = addToUDFM_Directly m (getUnique k) v --- The new binding always goes to the right of existing ones +-- A new key goes to the right of existing ones +-- Overwriting an existing key keeps its position in the iteration order addToUDFM_Directly :: UniqDFM key elt -> Unique -> elt -> UniqDFM key elt addToUDFM_Directly (UDFM m i) u v = UDFM (MS.insertWith tf (getKey u) (TaggedVal v i) m) (i + 1) @@ -435,7 +450,8 @@ adjustUDFM_Directly f (UDFM m i) k = UDFM (M.adjust (fmap f) (getKey k) m) i -- | The expression (@'alterUDFM' f map k@) alters value x at k, or absence -- thereof. 'alterUDFM' can be used to insert, delete, or update a value in -- UniqDFM. Use addToUDFM, delFromUDFM or adjustUDFM when possible, they are --- more efficient. +-- more efficient. Updating an existing key keeps its position in the +-- deterministic iteration order. -- -- 'alterUDFM' is non-strict in @k@. alterUDFM @@ -447,16 +463,16 @@ alterUDFM alterUDFM f (UDFM m i) k = UDFM (M.alter alterf (getKey $ getUnique k) m) (i + 1) where - alterf Nothing = inject $ f Nothing - alterf (Just (TaggedVal v _)) = inject $ f (Just v) - inject Nothing = Nothing - inject (Just v) = Just $ TaggedVal v i + alterf Nothing = inject i $ f Nothing + alterf (Just (TaggedVal v old_i)) = inject old_i $ f (Just v) + inject _ Nothing = Nothing + inject tag (Just v) = Just $ TaggedVal v tag -- | The expression (@'upsertUDFM' f map k@) updates the value at @k@ or inserts -- a new value if @k@ is absent. -- --- Like 'alterUDFM', updating an existing entry assigns it the current tag, so it --- becomes the newest element in deterministic iteration order. +-- Updating an existing entry keeps its original tag, so its position in +-- deterministic iteration order is unchanged and does not depend on update order. upsertUDFM :: Uniquable key => (Maybe elt -> elt) -- ^ How to adjust the element @@ -467,13 +483,14 @@ upsertUDFM f (UDFM m i) k = UDFM (MS.upsert upsertf (getKey $ getUnique k) m) (i + 1) where upsertf Nothing = TaggedVal (f Nothing) i - upsertf (Just (TaggedVal v _)) = TaggedVal (f (Just v)) i + upsertf (Just (TaggedVal v old_i)) = TaggedVal (f (Just v)) old_i -- | The expression (@'alterUDFM_L' f map k@) alters value @x@ at @k@, or absence -- thereof and returns the new element at @k@ if there is any. -- 'alterUDFM_L' can be used to insert, delete, or update a value in -- UniqDFM. Use addToUDFM, delFromUDFM or adjustUDFM when possible, they are --- more efficient. +-- more efficient. Updating an existing key keeps its position in the +-- deterministic iteration order. -- -- Note, 'alterUDFM_L' is strict in @k@. alterUDFM_L @@ -489,10 +506,10 @@ alterUDFM_L f (UDFM m i) k = (fmap taggedFst mElt, UDFM udfm (i + 1)) where alterf :: Maybe (TaggedVal elt) -> (Maybe (TaggedVal elt)) - alterf Nothing = inject $ f Nothing - alterf (Just (TaggedVal v _)) = inject $ f (Just v) - inject Nothing = Nothing - inject (Just v) = Just $ TaggedVal v i + alterf Nothing = inject i $ f Nothing + alterf (Just (TaggedVal v old_i)) = inject old_i $ f (Just v) + inject _ Nothing = Nothing + inject tag (Just v) = Just $ TaggedVal v tag -- | Map a function over every value in a UniqDFM mapUDFM :: (elt1 -> elt2) -> UniqDFM key elt1 -> UniqDFM key elt2 ===================================== testsuite/tests/ghci/T16793/T16793.stdout ===================================== @@ -1,9 +1,9 @@ -instance Bounded Int -- Defined in ‘GHC.Internal.Enum’ +instance Eq Int -- Defined in ‘GHC.Internal.Classes’ +instance Ord Int -- Defined in ‘GHC.Internal.Classes’ instance Read Int -- Defined in ‘GHC.Internal.Read’ +instance Bounded Int -- Defined in ‘GHC.Internal.Enum’ instance Enum Int -- Defined in ‘GHC.Internal.Enum’ -instance Eq Int -- Defined in ‘GHC.Internal.Classes’ -instance Integral Int -- Defined in ‘GHC.Internal.Real’ instance Num Int -- Defined in ‘GHC.Internal.Num’ -instance Ord Int -- Defined in ‘GHC.Internal.Classes’ instance Real Int -- Defined in ‘GHC.Internal.Real’ instance Show Int -- Defined in ‘GHC.Internal.Show’ +instance Integral Int -- Defined in ‘GHC.Internal.Real’ ===================================== testsuite/tests/ghci/T18060/T18060.stdout ===================================== @@ -2,13 +2,13 @@ type (->) :: * -> * -> * type (->) = FUN Many -- Defined in ‘GHC.Internal.Types’ infixr -1 -> +instance Applicative ((->) r) -- Defined in ‘GHC.Internal.Base’ +instance Functor ((->) r) -- Defined in ‘GHC.Internal.Base’ +instance Monad ((->) r) -- Defined in ‘GHC.Internal.Base’ instance Monoid b => Monoid (a -> b) -- Defined in ‘GHC.Internal.Base’ instance Semigroup b => Semigroup (a -> b) -- Defined in ‘GHC.Internal.Base’ -instance Applicative ((->) r) -- Defined in ‘GHC.Internal.Base’ -instance Functor ((->) r) -- Defined in ‘GHC.Internal.Base’ -instance Monad ((->) r) -- Defined in ‘GHC.Internal.Base’ type (~) :: forall k. k -> k -> Constraint class (a ~ b) => (~) a b -- Defined in ‘GHC.Internal.Types’ ===================================== testsuite/tests/ghci/T27532/Makefile ===================================== @@ -0,0 +1,23 @@ +TOP=../../.. +include $(TOP)/mk/boilerplate.mk +include $(TOP)/mk/test.mk + +.PHONY: T27532 +T27532: + '$(TEST_HC)' $(TEST_HC_OPTS_INTERACTIVE) -ignore-dot-ghci -v0 < a.script 2>/dev/null | grep '^instance' > direct.txt + '$(TEST_HC)' $(TEST_HC_OPTS_INTERACTIVE) -ignore-dot-ghci -v0 < b.script 2>/dev/null | grep '^instance' > afterimport.txt + diff direct.txt afterimport.txt || true + +.PHONY: T27532j4 +T27532j4: + printf ':info ()\n' | '$(TEST_HC)' $(TEST_HC_OPTS_INTERACTIVE) -ignore-dot-ghci -v0 -j4 -w M*.hs 2>/dev/null | grep '^instance' > j4_1.txt + printf ':info ()\n' | '$(TEST_HC)' $(TEST_HC_OPTS_INTERACTIVE) -ignore-dot-ghci -v0 -j4 -w M*.hs 2>/dev/null | grep '^instance' > j4_2.txt + printf ':info ()\n' | '$(TEST_HC)' $(TEST_HC_OPTS_INTERACTIVE) -ignore-dot-ghci -v0 -j4 -w M*.hs 2>/dev/null | grep '^instance' > j4_3.txt + printf ':info ()\n' | '$(TEST_HC)' $(TEST_HC_OPTS_INTERACTIVE) -ignore-dot-ghci -v0 -j4 -w M*.hs 2>/dev/null | grep '^instance' > j4_4.txt + printf ':info ()\n' | '$(TEST_HC)' $(TEST_HC_OPTS_INTERACTIVE) -ignore-dot-ghci -v0 -j4 -w M*.hs 2>/dev/null | grep '^instance' > j4_5.txt + printf ':info ()\n' | '$(TEST_HC)' $(TEST_HC_OPTS_INTERACTIVE) -ignore-dot-ghci -v0 -j4 -w M*.hs 2>/dev/null | grep '^instance' > j4_6.txt + diff j4_1.txt j4_2.txt || true + diff j4_1.txt j4_3.txt || true + diff j4_1.txt j4_4.txt || true + diff j4_1.txt j4_5.txt || true + diff j4_1.txt j4_6.txt || true ===================================== testsuite/tests/ghci/T27532/T27532.stdout ===================================== ===================================== testsuite/tests/ghci/T27532/T27532j4.stdout ===================================== ===================================== testsuite/tests/ghci/T27532/a.script ===================================== @@ -0,0 +1 @@ +:info () ===================================== testsuite/tests/ghci/T27532/all.T ===================================== @@ -0,0 +1,11 @@ +test('T27532', + [extra_files(['a.script', 'b.script']), + req_interp], + makefile_test, ['T27532']) + +test('T27532j4', + [pre_cmd('./genT27532Modules'), + extra_files(['genT27532Modules']), + req_interp, + req_ghc_smp], + makefile_test, ['T27532j4']) ===================================== testsuite/tests/ghci/T27532/b.script ===================================== @@ -0,0 +1,3 @@ +import Data.Ratio +_ <- return $! compare (1 % 2 :: Rational) (2 % 3) +:info () ===================================== testsuite/tests/ghci/T27532/genT27532Modules ===================================== @@ -0,0 +1,33 @@ +#!/usr/bin/env bash +# Generate modules that each import and use a distinct instance-heavy module, +# so a parallel :load races many interface loads against each other. +gen() { f=$1; shift; printf '%s\n' "module ${f%.hs} where" "$@" > "$f"; } +gen M01.hs "import Data.Ratio" "v :: Rational" "v = 1 % 2" "s = show v" +gen M02.hs "import Data.Complex" "v :: Complex Double" "v = 1" "s = show v" +gen M03.hs "import Data.Fixed" "v :: Fixed E2" "v = 1" "s = show v" +gen M04.hs "import Foreign.C.Types" "v :: CInt" "v = 1" "s = show v" "b :: CInt" "b = maxBound" +gen M05.hs "import System.Posix.Types" "v :: CPid" "v = 1" "s = show v" +gen M06.hs "import Data.Version" "s = showVersion (makeVersion [1,2])" +gen M07.hs "import Control.Exception" "s = show DivideByZero" "t = show StackOverflow" +gen M08.hs "import Data.Dynamic" "s = show (toDyn ())" +gen M09.hs "import Type.Reflection" "s = show (typeRep :: TypeRep Bool)" +gen M10.hs "import Data.List.NonEmpty (NonEmpty(..))" "s = show (1 :| ([2,3] :: [Int]))" +gen M11.hs "import Data.Ord" "s = show (Down (3 :: Int))" "c = compare (Down 1) (Down (2 :: Int))" +gen M12.hs "import Data.Functor.Identity" "s = show (Identity (1 :: Int))" +gen M13.hs "import Data.Functor.Const" "s = show (Const (1 :: Int) :: Const Int Bool)" +gen M14.hs "import Data.Functor.Compose" "s = show (Compose (Just (Just (1 :: Int))))" +gen M15.hs "import Data.Functor.Product" "s = show (Pair (Just (1 :: Int)) (Just (2 :: Int)))" +gen M16.hs "import Data.Functor.Sum" "s = show (InL (Just (1 :: Int)) :: Sum Maybe Maybe Int)" +gen M17.hs "import Data.Monoid" "s = show (Sum (1 :: Int) <> Sum 2)" "a = show (All True)" +gen M18.hs "import Data.Semigroup" "s = show (Min (1 :: Int) <> Min 2)" +gen M19.hs "import Text.Printf" "s = printf \"%d\" (1 :: Int) :: String" +gen M20.hs "import Numeric.Natural" "s = show (5 :: Natural)" "v :: Natural" "v = 2 + 3" +gen M21.hs "import Foreign.Ptr" "s = show nullPtr" +gen M22.hs "import System.IO" "s = show stdout" "e = show stderr" +gen M23.hs "import Data.IORef" "v :: IO (IORef Int)" "v = newIORef 1" +gen M24.hs "import Data.Bits" "v = xor (1 :: Int) 2" "s = show v" +for f in M??.hs; do + n=${f#M}; n=${n%.hs} + m=$(printf 'M%02d' $((10#$n + 24))) + sed "s/module M$n/module $m/" "$f" > "$m.hs" +done ===================================== testsuite/tests/ghci/scripts/ListTuplePunsPpr.stdout ===================================== @@ -1,13 +1,13 @@ type Unit :: * data Unit = () -- Defined in ‘GHC.Internal.Tuple’ +instance Eq Unit -- Defined in ‘GHC.Internal.Classes’ instance Monoid Unit -- Defined in ‘GHC.Internal.Base’ +instance Ord Unit -- Defined in ‘GHC.Internal.Classes’ instance Semigroup Unit -- Defined in ‘GHC.Internal.Base’ -instance Bounded Unit -- Defined in ‘GHC.Internal.Enum’ instance Read Unit -- Defined in ‘GHC.Internal.Read’ +instance Bounded Unit -- Defined in ‘GHC.Internal.Enum’ instance Enum Unit -- Defined in ‘GHC.Internal.Enum’ -instance Eq Unit -- Defined in ‘GHC.Internal.Classes’ -instance Ord Unit -- Defined in ‘GHC.Internal.Classes’ instance Show Unit -- Defined in ‘GHC.Internal.Show’ type Unit# :: GHC.Internal.Types.ZeroBitType data Unit# = (##) @@ -15,23 +15,23 @@ data Unit# = (##) type Solo :: * -> * data Solo a = MkSolo a -- Defined in ‘GHC.Internal.Tuple’ -instance Traversable Solo - -- Defined in ‘GHC.Internal.Data.Traversable’ instance Applicative Solo -- Defined in ‘GHC.Internal.Base’ -instance Foldable Solo -- Defined in ‘GHC.Internal.Data.Foldable’ +instance Eq a => Eq (Solo a) -- Defined in ‘GHC.Internal.Classes’ instance Functor Solo -- Defined in ‘GHC.Internal.Base’ instance Monad Solo -- Defined in ‘GHC.Internal.Base’ +instance Monoid a => Monoid (Solo a) + -- Defined in ‘GHC.Internal.Base’ +instance Ord a => Ord (Solo a) -- Defined in ‘GHC.Internal.Classes’ +instance Semigroup a => Semigroup (Solo a) + -- Defined in ‘GHC.Internal.Base’ instance Read a => Read (Solo a) -- Defined in ‘GHC.Internal.Read’ instance Bounded a => Bounded (Solo a) -- Defined in ‘GHC.Internal.Enum’ instance Enum a => Enum (Solo a) -- Defined in ‘GHC.Internal.Enum’ -instance Ord a => Ord (Solo a) -- Defined in ‘GHC.Internal.Classes’ instance Show a => Show (Solo a) -- Defined in ‘GHC.Internal.Show’ -instance Eq a => Eq (Solo a) -- Defined in ‘GHC.Internal.Classes’ -instance Monoid a => Monoid (Solo a) - -- Defined in ‘GHC.Internal.Base’ -instance Semigroup a => Semigroup (Solo a) - -- Defined in ‘GHC.Internal.Base’ +instance Foldable Solo -- Defined in ‘GHC.Internal.Data.Foldable’ +instance Traversable Solo + -- Defined in ‘GHC.Internal.Data.Traversable’ () :: Unit (##) :: Unit# ( ) :: Unit @@ -39,29 +39,29 @@ instance Semigroup a => Semigroup (Solo a) type Tuple2 :: * -> * -> * data Tuple2 a b = (,) a b -- Defined in ‘GHC.Internal.Tuple’ -instance Traversable (Tuple2 a) - -- Defined in ‘GHC.Internal.Data.Traversable’ instance Monoid a => Applicative (Tuple2 a) -- Defined in ‘GHC.Internal.Base’ -instance Foldable (Tuple2 a) - -- Defined in ‘GHC.Internal.Data.Foldable’ +instance (Eq a, Eq b) => Eq (Tuple2 a b) + -- Defined in ‘GHC.Internal.Classes’ instance Functor (Tuple2 a) -- Defined in ‘GHC.Internal.Base’ instance Monoid a => Monad (Tuple2 a) -- Defined in ‘GHC.Internal.Base’ instance (Monoid a, Monoid b) => Monoid (Tuple2 a b) -- Defined in ‘GHC.Internal.Base’ -instance (Semigroup a, Semigroup b) => Semigroup (Tuple2 a b) - -- Defined in ‘GHC.Internal.Base’ -instance (Bounded a, Bounded b) => Bounded (Tuple2 a b) - -- Defined in ‘GHC.Internal.Enum’ instance (Ord a, Ord b) => Ord (Tuple2 a b) -- Defined in ‘GHC.Internal.Classes’ +instance (Semigroup a, Semigroup b) => Semigroup (Tuple2 a b) + -- Defined in ‘GHC.Internal.Base’ instance (Read a, Read b) => Read (Tuple2 a b) -- Defined in ‘GHC.Internal.Read’ +instance (Bounded a, Bounded b) => Bounded (Tuple2 a b) + -- Defined in ‘GHC.Internal.Enum’ instance (Show a, Show b) => Show (Tuple2 a b) -- Defined in ‘GHC.Internal.Show’ -instance (Eq a, Eq b) => Eq (Tuple2 a b) - -- Defined in ‘GHC.Internal.Classes’ +instance Foldable (Tuple2 a) + -- Defined in ‘GHC.Internal.Data.Foldable’ +instance Traversable (Tuple2 a) + -- Defined in ‘GHC.Internal.Data.Traversable’ type Tuple2# :: * -> * -> TYPE ===================================== testsuite/tests/ghci/scripts/T4175.stdout ===================================== @@ -26,52 +26,52 @@ type Unit :: * data Unit = () -- Defined in ‘GHC.Internal.Tuple’ instance [safe] C () -- Defined at T4175.hs:22:10 +instance Eq () -- Defined in ‘GHC.Internal.Classes’ instance Monoid () -- Defined in ‘GHC.Internal.Base’ +instance Ord () -- Defined in ‘GHC.Internal.Classes’ instance Semigroup () -- Defined in ‘GHC.Internal.Base’ +instance Read () -- Defined in ‘GHC.Internal.Read’ instance Bounded () -- Defined in ‘GHC.Internal.Enum’ instance Enum () -- Defined in ‘GHC.Internal.Enum’ -instance Ord () -- Defined in ‘GHC.Internal.Classes’ -instance Read () -- Defined in ‘GHC.Internal.Read’ instance Show () -- Defined in ‘GHC.Internal.Show’ -instance Eq () -- Defined in ‘GHC.Internal.Classes’ data instance B () = MkB -- Defined at T4175.hs:14:15 type instance D Int () = String -- Defined at T4175.hs:20:10 type instance D () () = Bool -- Defined at T4175.hs:23:10 type Maybe :: * -> * data Maybe a = Nothing | Just a -- Defined in ‘GHC.Internal.Maybe’ -instance Traversable Maybe - -- Defined in ‘GHC.Internal.Data.Traversable’ -instance MonadFail Maybe - -- Defined in ‘GHC.Internal.Control.Monad.Fail’ instance Applicative Maybe -- Defined in ‘GHC.Internal.Base’ -instance Foldable Maybe -- Defined in ‘GHC.Internal.Data.Foldable’ +instance [safe] Eq a => Eq (Maybe a) + -- Defined in ‘GHC.Internal.Maybe’ instance Functor Maybe -- Defined in ‘GHC.Internal.Base’ instance Monad Maybe -- Defined in ‘GHC.Internal.Base’ instance Semigroup a => Monoid (Maybe a) -- Defined in ‘GHC.Internal.Base’ -instance Semigroup a => Semigroup (Maybe a) - -- Defined in ‘GHC.Internal.Base’ instance [safe] Ord a => Ord (Maybe a) -- Defined in ‘GHC.Internal.Maybe’ +instance Semigroup a => Semigroup (Maybe a) + -- Defined in ‘GHC.Internal.Base’ instance Read a => Read (Maybe a) -- Defined in ‘GHC.Internal.Read’ instance Show a => Show (Maybe a) -- Defined in ‘GHC.Internal.Show’ -instance [safe] Eq a => Eq (Maybe a) - -- Defined in ‘GHC.Internal.Maybe’ +instance MonadFail Maybe + -- Defined in ‘GHC.Internal.Control.Monad.Fail’ +instance Foldable Maybe -- Defined in ‘GHC.Internal.Data.Foldable’ +instance Traversable Maybe + -- Defined in ‘GHC.Internal.Data.Traversable’ type instance A (Maybe a) a = a -- Defined at T4175.hs:10:15 type Int :: * data Int = GHC.Internal.Types.I# GHC.Internal.Prim.Int# -- Defined in ‘GHC.Internal.Types’ instance [safe] C Int -- Defined at T4175.hs:19:10 +instance Eq Int -- Defined in ‘GHC.Internal.Classes’ +instance Ord Int -- Defined in ‘GHC.Internal.Classes’ +instance Read Int -- Defined in ‘GHC.Internal.Read’ instance Bounded Int -- Defined in ‘GHC.Internal.Enum’ instance Enum Int -- Defined in ‘GHC.Internal.Enum’ -instance Integral Int -- Defined in ‘GHC.Internal.Real’ instance Num Int -- Defined in ‘GHC.Internal.Num’ -instance Ord Int -- Defined in ‘GHC.Internal.Classes’ -instance Read Int -- Defined in ‘GHC.Internal.Read’ instance Real Int -- Defined in ‘GHC.Internal.Real’ instance Show Int -- Defined in ‘GHC.Internal.Show’ -instance Eq Int -- Defined in ‘GHC.Internal.Classes’ +instance Integral Int -- Defined in ‘GHC.Internal.Real’ type instance A Int Int = () -- Defined at T4175.hs:9:15 type instance D Int () = String -- Defined at T4175.hs:20:10 type Z :: * -> Constraint ===================================== testsuite/tests/ghci/scripts/T8469.stdout ===================================== @@ -1,12 +1,12 @@ type Int :: * data Int = GHC.Internal.Types.I# GHC.Internal.Prim.Int# -- Defined in ‘GHC.Internal.Types’ -instance Bounded Int -- Defined in ‘GHC.Internal.Enum’ +instance Eq Int -- Defined in ‘GHC.Internal.Classes’ +instance Ord Int -- Defined in ‘GHC.Internal.Classes’ instance Read Int -- Defined in ‘GHC.Internal.Read’ +instance Bounded Int -- Defined in ‘GHC.Internal.Enum’ instance Enum Int -- Defined in ‘GHC.Internal.Enum’ -instance Eq Int -- Defined in ‘GHC.Internal.Classes’ -instance Integral Int -- Defined in ‘GHC.Internal.Real’ instance Num Int -- Defined in ‘GHC.Internal.Num’ -instance Ord Int -- Defined in ‘GHC.Internal.Classes’ instance Real Int -- Defined in ‘GHC.Internal.Real’ instance Show Int -- Defined in ‘GHC.Internal.Show’ +instance Integral Int -- Defined in ‘GHC.Internal.Real’ ===================================== testsuite/tests/ghci/scripts/T8535.stdout ===================================== @@ -2,10 +2,10 @@ type (->) :: * -> * -> * type (->) = FUN Many -- Defined in ‘GHC.Internal.Types’ infixr -1 -> +instance Applicative ((->) r) -- Defined in ‘GHC.Internal.Base’ +instance Functor ((->) r) -- Defined in ‘GHC.Internal.Base’ +instance Monad ((->) r) -- Defined in ‘GHC.Internal.Base’ instance Monoid b => Monoid (a -> b) -- Defined in ‘GHC.Internal.Base’ instance Semigroup b => Semigroup (a -> b) -- Defined in ‘GHC.Internal.Base’ -instance Applicative ((->) r) -- Defined in ‘GHC.Internal.Base’ -instance Functor ((->) r) -- Defined in ‘GHC.Internal.Base’ -instance Monad ((->) r) -- Defined in ‘GHC.Internal.Base’ ===================================== testsuite/tests/ghci/scripts/T9881.stdout ===================================== @@ -4,16 +4,16 @@ data Data.ByteString.Lazy.ByteString | Data.ByteString.Lazy.Internal.Chunk {-# UNPACK #-} !StrictByteString Data.ByteString.Lazy.ByteString -- Defined in ‘Data.ByteString.Lazy.Internal’ +instance Eq Data.ByteString.Lazy.ByteString + -- Defined in ‘Data.ByteString.Lazy.Internal’ instance Monoid Data.ByteString.Lazy.ByteString -- Defined in ‘Data.ByteString.Lazy.Internal’ +instance Ord Data.ByteString.Lazy.ByteString + -- Defined in ‘Data.ByteString.Lazy.Internal’ instance Semigroup Data.ByteString.Lazy.ByteString -- Defined in ‘Data.ByteString.Lazy.Internal’ instance Read Data.ByteString.Lazy.ByteString -- Defined in ‘Data.ByteString.Lazy.Internal’ -instance Eq Data.ByteString.Lazy.ByteString - -- Defined in ‘Data.ByteString.Lazy.Internal’ -instance Ord Data.ByteString.Lazy.ByteString - -- Defined in ‘Data.ByteString.Lazy.Internal’ instance Show Data.ByteString.Lazy.ByteString -- Defined in ‘Data.ByteString.Lazy.Internal’ @@ -23,15 +23,15 @@ data Data.ByteString.ByteString GHC.Internal.Word.Word8) {-# UNPACK #-} !Int -- Defined in ‘bytestring-0.12.2.0:Data.ByteString.Internal.Type’ +instance Eq Data.ByteString.ByteString + -- Defined in ‘bytestring-0.12.2.0:Data.ByteString.Internal.Type’ instance Monoid Data.ByteString.ByteString -- Defined in ‘bytestring-0.12.2.0:Data.ByteString.Internal.Type’ +instance Ord Data.ByteString.ByteString + -- Defined in ‘bytestring-0.12.2.0:Data.ByteString.Internal.Type’ instance Semigroup Data.ByteString.ByteString -- Defined in ‘bytestring-0.12.2.0:Data.ByteString.Internal.Type’ instance Read Data.ByteString.ByteString -- Defined in ‘bytestring-0.12.2.0:Data.ByteString.Internal.Type’ -instance Eq Data.ByteString.ByteString - -- Defined in ‘bytestring-0.12.2.0:Data.ByteString.Internal.Type’ -instance Ord Data.ByteString.ByteString - -- Defined in ‘bytestring-0.12.2.0:Data.ByteString.Internal.Type’ instance Show Data.ByteString.ByteString -- Defined in ‘bytestring-0.12.2.0:Data.ByteString.Internal.Type’ ===================================== testsuite/tests/ghci/scripts/ghci020.stdout ===================================== @@ -2,10 +2,10 @@ type (->) :: * -> * -> * type (->) = FUN Many -- Defined in ‘GHC.Internal.Types’ infixr -1 -> +instance Applicative ((->) r) -- Defined in ‘GHC.Internal.Base’ +instance Functor ((->) r) -- Defined in ‘GHC.Internal.Base’ +instance Monad ((->) r) -- Defined in ‘GHC.Internal.Base’ instance Monoid b => Monoid (a -> b) -- Defined in ‘GHC.Internal.Base’ instance Semigroup b => Semigroup (a -> b) -- Defined in ‘GHC.Internal.Base’ -instance Applicative ((->) r) -- Defined in ‘GHC.Internal.Base’ -instance Functor ((->) r) -- Defined in ‘GHC.Internal.Base’ -instance Monad ((->) r) -- Defined in ‘GHC.Internal.Base’ ===================================== testsuite/tests/ghci/scripts/ghci064.stdout ===================================== @@ -1,52 +1,52 @@ -instance Foldable Maybe -- Defined in ‘GHC.Internal.Data.Foldable’ -instance Traversable Maybe - -- Defined in ‘GHC.Internal.Data.Traversable’ instance GHC.Internal.Base.Alternative Maybe -- Defined in ‘GHC.Internal.Base’ instance Applicative Maybe -- Defined in ‘GHC.Internal.Base’ instance Functor Maybe -- Defined in ‘GHC.Internal.Base’ -instance MonadFail Maybe - -- Defined in ‘GHC.Internal.Control.Monad.Fail’ +instance Monad Maybe -- Defined in ‘GHC.Internal.Base’ instance GHC.Internal.Base.MonadPlus Maybe -- Defined in ‘GHC.Internal.Base’ -instance Monad Maybe -- Defined in ‘GHC.Internal.Base’ +instance MonadFail Maybe + -- Defined in ‘GHC.Internal.Control.Monad.Fail’ +instance Foldable Maybe -- Defined in ‘GHC.Internal.Data.Foldable’ +instance Traversable Maybe + -- Defined in ‘GHC.Internal.Data.Traversable’ +instance [safe] Eq w => Eq (Maybe w) + -- Defined in ‘GHC.Internal.Maybe’ instance Semigroup w => Monoid (Maybe w) -- Defined in ‘GHC.Internal.Base’ -instance Read w => Read (Maybe w) -- Defined in ‘GHC.Internal.Read’ -instance Semigroup w => Semigroup (Maybe w) - -- Defined in ‘GHC.Internal.Base’ instance [safe] Ord w => Ord (Maybe w) -- Defined in ‘GHC.Internal.Maybe’ +instance Semigroup w => Semigroup (Maybe w) + -- Defined in ‘GHC.Internal.Base’ +instance Read w => Read (Maybe w) -- Defined in ‘GHC.Internal.Read’ instance Show w => Show (Maybe w) -- Defined in ‘GHC.Internal.Show’ -instance [safe] Eq w => Eq (Maybe w) - -- Defined in ‘GHC.Internal.Maybe’ -instance Read w => Read [w] -- Defined in ‘GHC.Internal.Read’ -instance Ord w => Ord [w] -- Defined in ‘GHC.Internal.Classes’ -instance Show w => Show [w] -- Defined in ‘GHC.Internal.Show’ instance Eq w => Eq [w] -- Defined in ‘GHC.Internal.Classes’ instance Monoid [w] -- Defined in ‘GHC.Internal.Base’ +instance Ord w => Ord [w] -- Defined in ‘GHC.Internal.Classes’ instance Semigroup [w] -- Defined in ‘GHC.Internal.Base’ +instance Read w => Read [w] -- Defined in ‘GHC.Internal.Read’ +instance Show w => Show [w] -- Defined in ‘GHC.Internal.Show’ instance [safe] MyShow w => MyShow [w] -- Defined at ghci064.hs:8:10 instance Monoid [T] -- Defined in ‘GHC.Internal.Base’ instance Semigroup [T] -- Defined in ‘GHC.Internal.Base’ instance [safe] MyShow [T] -- Defined at ghci064.hs:16:10 instance [safe] MyShow [T] -- Defined at ghci064.hs:8:10 -instance GHC.Internal.Foreign.Storable.Storable Bool - -- Defined in ‘GHC.Internal.Foreign.Storable’ -instance GHC.Internal.Bits.Bits Bool - -- Defined in ‘GHC.Internal.Bits’ +instance Eq Bool -- Defined in ‘GHC.Internal.Classes’ +instance Ord Bool -- Defined in ‘GHC.Internal.Classes’ +instance Read Bool -- Defined in ‘GHC.Internal.Read’ instance Bounded Bool -- Defined in ‘GHC.Internal.Enum’ instance Enum Bool -- Defined in ‘GHC.Internal.Enum’ +instance Show Bool -- Defined in ‘GHC.Internal.Show’ +instance GHC.Internal.Ix.Ix Bool -- Defined in ‘GHC.Internal.Ix’ +instance GHC.Internal.Bits.Bits Bool + -- Defined in ‘GHC.Internal.Bits’ instance GHC.Internal.Bits.FiniteBits Bool -- Defined in ‘GHC.Internal.Bits’ -instance GHC.Internal.Ix.Ix Bool -- Defined in ‘GHC.Internal.Ix’ -instance Ord Bool -- Defined in ‘GHC.Internal.Classes’ -instance Read Bool -- Defined in ‘GHC.Internal.Read’ -instance Show Bool -- Defined in ‘GHC.Internal.Show’ -instance Eq Bool -- Defined in ‘GHC.Internal.Classes’ -instance Traversable ((,) Int) - -- Defined in ‘GHC.Internal.Data.Traversable’ +instance GHC.Internal.Foreign.Storable.Storable Bool + -- Defined in ‘GHC.Internal.Foreign.Storable’ +instance Functor ((,) Int) -- Defined in ‘GHC.Internal.Base’ instance Foldable ((,) Int) -- Defined in ‘GHC.Internal.Data.Foldable’ -instance Functor ((,) Int) -- Defined in ‘GHC.Internal.Base’ +instance Traversable ((,) Int) + -- Defined in ‘GHC.Internal.Data.Traversable’ ===================================== testsuite/tests/ghci/should_run/T10145.stdout ===================================== @@ -2,10 +2,10 @@ type (->) :: * -> * -> * type (->) = FUN Many -- Defined in ‘GHC.Internal.Types’ infixr -1 -> +instance Applicative ((->) r) -- Defined in ‘GHC.Internal.Base’ +instance Functor ((->) r) -- Defined in ‘GHC.Internal.Base’ +instance Monad ((->) r) -- Defined in ‘GHC.Internal.Base’ instance Monoid b => Monoid (a -> b) -- Defined in ‘GHC.Internal.Base’ instance Semigroup b => Semigroup (a -> b) -- Defined in ‘GHC.Internal.Base’ -instance Applicative ((->) r) -- Defined in ‘GHC.Internal.Base’ -instance Functor ((->) r) -- Defined in ‘GHC.Internal.Base’ -instance Monad ((->) r) -- Defined in ‘GHC.Internal.Base’ ===================================== testsuite/tests/ghci/should_run/T18594.stdout ===================================== @@ -2,13 +2,13 @@ type (->) :: * -> * -> * type (->) = FUN Many -- Defined in ‘GHC.Internal.Types’ infixr -1 -> +instance Applicative ((->) r) -- Defined in ‘GHC.Internal.Base’ +instance Functor ((->) r) -- Defined in ‘GHC.Internal.Base’ +instance Monad ((->) r) -- Defined in ‘GHC.Internal.Base’ instance Monoid b => Monoid (a -> b) -- Defined in ‘GHC.Internal.Base’ instance Semigroup b => Semigroup (a -> b) -- Defined in ‘GHC.Internal.Base’ -instance Applicative ((->) r) -- Defined in ‘GHC.Internal.Base’ -instance Functor ((->) r) -- Defined in ‘GHC.Internal.Base’ -instance Monad ((->) r) -- Defined in ‘GHC.Internal.Base’ type Constraint :: * type Constraint = CONSTRAINT LiftedRep -- Defined in ‘GHC.Internal.Types’ ===================================== testsuite/tests/partial-sigs/should_compile/ExtraConstraints3.stderr ===================================== @@ -21,7 +21,7 @@ TYPE SIGNATURES (>>) :: forall {m :: * -> *} {a} {b}. Monad m => m a -> m b -> m b (>>=) :: forall {m :: * -> *} {a} {b}. Monad m => m a -> (a -> m b) -> m b - (^) :: forall {b} {a}. (Integral b, Num a) => a -> b -> a + (^) :: forall {a} {b}. (Num a, Integral b) => a -> b -> a (^^) :: forall {a} {b}. (Fractional a, Integral b) => a -> b -> a abs :: forall {a}. Num a => a -> a acos :: forall {a}. Floating a => a -> a @@ -236,4 +236,4 @@ TYPE SIGNATURES (a -> b -> c -> d) -> [a] -> [b] -> [c] -> [d] (||) :: Bool -> Bool -> Bool Dependent modules: [] -Dependent packages: [(normal, base-4.21.0.0)] +Dependent packages: [(normal, base-4.23.0.0)] ===================================== testsuite/tests/roles/should_compile/Roles14.stderr ===================================== @@ -4,7 +4,7 @@ TYPE CONSTRUCTORS class C2{1} :: * -> Constraint roles representational Dependent modules: [] -Dependent packages: [(normal, base-4.22.0.0)] +Dependent packages: [(normal, base-4.23.0.0)] ==================== Typechecker ==================== Roles12.$tcC2 [InlPrag=[~]] @@ -15,14 +15,14 @@ Roles12.$tc'C:C2 [InlPrag=[~]] = GHC.Internal.Types.TyCon 7087988437584478859#Word64 11477953550142401435#Word64 Roles12.$trModule (GHC.Internal.Types.TrNameS "'C:C2"#) 1# $krep -$krep [InlPrag=[~]] - = GHC.Internal.Types.KindRepTyConApp Roles12.$tcC2 ((:) $krep []) $krep [InlPrag=[~]] = GHC.Internal.Types.KindRepVar 0 $krep [InlPrag=[~]] = GHC.Internal.Types.KindRepFun $krep $krep $krep [InlPrag=[~]] = GHC.Internal.Types.KindRepFun $krep $krep $krep [InlPrag=[~]] = GHC.Internal.Types.KindRepFun GHC.Internal.Types.krep$* GHC.Internal.Types.krep$Constraint +$krep [InlPrag=[~]] + = GHC.Internal.Types.KindRepTyConApp Roles12.$tcC2 ((:) $krep []) Roles12.$trModule [InlPrag=[~]] = GHC.Internal.Types.Module (GHC.Internal.Types.TrNameS "main"#) ===================================== testsuite/tests/roles/should_compile/Roles3.stderr ===================================== @@ -16,7 +16,7 @@ TYPE CONSTRUCTORS roles nominal type synonym Syn2{1} :: * -> * Dependent modules: [] -Dependent packages: [(normal, base-4.22.0.0)] +Dependent packages: [(normal, base-4.23.0.0)] ==================== Typechecker ==================== Roles3.$tcC4 [InlPrag=[~]] @@ -43,15 +43,6 @@ Roles3.$tc'C:C1 [InlPrag=[~]] = GHC.Internal.Types.TyCon 4508088879886988796#Word64 13962145553903222779#Word64 Roles3.$trModule (GHC.Internal.Types.TrNameS "'C:C1"#) 1# $krep -$krep [InlPrag=[~]] - = GHC.Internal.Types.KindRepTyConApp - GHC.Internal.Types.$tc~ - ((:) GHC.Internal.Types.krep$* ((:) $krep ((:) $krep []))) -$krep [InlPrag=[~]] - = GHC.Internal.Types.KindRepTyConApp - Roles3.$tcC2 ((:) $krep ((:) $krep [])) -$krep [InlPrag=[~]] - = GHC.Internal.Types.KindRepTyConApp Roles3.$tcC1 ((:) $krep []) $krep [InlPrag=[~]] = GHC.Internal.Types.KindRepVar 0 $krep [InlPrag=[~]] = GHC.Internal.Types.KindRepVar 1 $krep [InlPrag=[~]] = GHC.Internal.Types.KindRepFun $krep $krep @@ -64,6 +55,15 @@ $krep [InlPrag=[~]] = GHC.Internal.Types.KindRepFun GHC.Internal.Types.krep$* GHC.Internal.Types.krep$Constraint $krep [InlPrag=[~]] = GHC.Internal.Types.KindRepFun $krep $krep +$krep [InlPrag=[~]] + = GHC.Internal.Types.KindRepTyConApp + GHC.Internal.Types.$tc~ + ((:) GHC.Internal.Types.krep$* ((:) $krep ((:) $krep []))) +$krep [InlPrag=[~]] + = GHC.Internal.Types.KindRepTyConApp + Roles3.$tcC2 ((:) $krep ((:) $krep [])) +$krep [InlPrag=[~]] + = GHC.Internal.Types.KindRepTyConApp Roles3.$tcC1 ((:) $krep []) Roles3.$trModule [InlPrag=[~]] = GHC.Internal.Types.Module (GHC.Internal.Types.TrNameS "main"#) ===================================== testsuite/tests/roles/should_compile/Roles4.stderr ===================================== @@ -6,7 +6,7 @@ TYPE CONSTRUCTORS class C3{1} :: * -> Constraint type synonym Syn1{1} :: * -> * Dependent modules: [] -Dependent packages: [(normal, base-4.22.0.0)] +Dependent packages: [(normal, base-4.23.0.0)] ==================== Typechecker ==================== Roles4.$tcC3 [InlPrag=[~]] @@ -25,10 +25,6 @@ Roles4.$tc'C:C1 [InlPrag=[~]] = GHC.Internal.Types.TyCon 3870707671502302648#Word64 10631907186261837450#Word64 Roles4.$trModule (GHC.Internal.Types.TrNameS "'C:C1"#) 1# $krep -$krep [InlPrag=[~]] - = GHC.Internal.Types.KindRepTyConApp Roles4.$tcC3 ((:) $krep []) -$krep [InlPrag=[~]] - = GHC.Internal.Types.KindRepTyConApp Roles4.$tcC1 ((:) $krep []) $krep [InlPrag=[~]] = GHC.Internal.Types.KindRepVar 0 $krep [InlPrag=[~]] = GHC.Internal.Types.KindRepFun $krep $krep $krep [InlPrag=[~]] = GHC.Internal.Types.KindRepFun $krep $krep @@ -40,6 +36,10 @@ $krep [InlPrag=[~]] $krep [InlPrag=[~]] = GHC.Internal.Types.KindRepTyConApp GHC.Internal.Types.$tcList ((:) $krep []) +$krep [InlPrag=[~]] + = GHC.Internal.Types.KindRepTyConApp Roles4.$tcC3 ((:) $krep []) +$krep [InlPrag=[~]] + = GHC.Internal.Types.KindRepTyConApp Roles4.$tcC1 ((:) $krep []) Roles4.$trModule [InlPrag=[~]] = GHC.Internal.Types.Module (GHC.Internal.Types.TrNameS "main"#) ===================================== testsuite/tests/roles/should_compile/T8958.stderr ===================================== @@ -18,7 +18,7 @@ CLASS INSTANCES instance [incoherent] Representational a -- Defined at T8958.hs:11:10 Dependent modules: [] -Dependent packages: [(normal, base-4.22.0.0)] +Dependent packages: [(normal, base-4.23.0.0)] ==================== Typechecker ==================== T8958.$tcMap [InlPrag=[~]] @@ -50,10 +50,10 @@ T8958.$tc'C:Nominal [InlPrag=[~]] T8958.$trModule (GHC.Internal.Types.TrNameS "'C:Nominal"#) 1# $krep $krep [InlPrag=[~]] = GHC.Internal.Types.KindRepVar 0 $krep [InlPrag=[~]] = GHC.Internal.Types.KindRepVar 1 -$krep [InlPrag=[~]] = GHC.Internal.Types.KindRepFun $krep $krep $krep [InlPrag=[~]] = GHC.Internal.Types.KindRepFun GHC.Internal.Types.krep$* GHC.Internal.Types.krep$Constraint +$krep [InlPrag=[~]] = GHC.Internal.Types.KindRepFun $krep $krep $krep [InlPrag=[~]] = GHC.Internal.Types.KindRepTyConApp GHC.Internal.Tuple.$tcTuple2 ===================================== testsuite/tests/typecheck/should_compile/T18406b.stderr ===================================== @@ -4,7 +4,7 @@ TYPE SIGNATURES TYPE CONSTRUCTORS class C{2} :: * -> * -> Constraint Dependent modules: [] -Dependent packages: [(normal, base-4.22.0.0)] +Dependent packages: [(normal, base-4.23.0.0)] ==================== Typechecker ==================== Bug.$tcC [InlPrag=[~]] @@ -15,13 +15,6 @@ Bug.$tc'C:C [InlPrag=[~]] = GHC.Internal.Types.TyCon 302756782745842909#Word64 14248103394115774781#Word64 Bug.$trModule (GHC.Internal.Types.TrNameS "'C:C"#) 2# $krep -$krep [InlPrag=[~]] - = GHC.Internal.Types.KindRepTyConApp - Bug.$tcC - ((:) @GHC.Internal.Types.KindRep - $krep - ((:) @GHC.Internal.Types.KindRep - $krep [] @GHC.Internal.Types.KindRep)) $krep [InlPrag=[~]] = GHC.Internal.Types.KindRepVar 0 $krep [InlPrag=[~]] = GHC.Internal.Types.KindRepVar 1 $krep [InlPrag=[~]] = GHC.Internal.Types.KindRepFun $krep $krep @@ -31,6 +24,13 @@ $krep [InlPrag=[~]] $krep [InlPrag=[~]] = GHC.Internal.Types.KindRepFun GHC.Internal.Types.krep$* GHC.Internal.Types.krep$Constraint +$krep [InlPrag=[~]] + = GHC.Internal.Types.KindRepTyConApp + Bug.$tcC + ((:) @GHC.Internal.Types.KindRep + $krep + ((:) @GHC.Internal.Types.KindRep + $krep [] @GHC.Internal.Types.KindRep)) Bug.$trModule [InlPrag=[~]] = GHC.Internal.Types.Module (GHC.Internal.Types.TrNameS "main"#) ===================================== testsuite/tests/typecheck/should_compile/T18529.stderr ===================================== @@ -4,7 +4,7 @@ TYPE SIGNATURES TYPE CONSTRUCTORS class C{2} :: * -> * -> Constraint Dependent modules: [] -Dependent packages: [(normal, base-4.22.0.0)] +Dependent packages: [(normal, base-4.23.0.0)] ==================== Typechecker ==================== Bug.$tcC [InlPrag=[~]] @@ -15,13 +15,6 @@ Bug.$tc'C:C [InlPrag=[~]] = GHC.Internal.Types.TyCon 302756782745842909#Word64 14248103394115774781#Word64 Bug.$trModule (GHC.Internal.Types.TrNameS "'C:C"#) 2# $krep -$krep [InlPrag=[~]] - = GHC.Internal.Types.KindRepTyConApp - Bug.$tcC - ((:) @GHC.Internal.Types.KindRep - $krep - ((:) @GHC.Internal.Types.KindRep - $krep [] @GHC.Internal.Types.KindRep)) $krep [InlPrag=[~]] = GHC.Internal.Types.KindRepVar 0 $krep [InlPrag=[~]] = GHC.Internal.Types.KindRepVar 1 $krep [InlPrag=[~]] = GHC.Internal.Types.KindRepFun $krep $krep @@ -35,6 +28,13 @@ $krep [InlPrag=[~]] $krep [InlPrag=[~]] = GHC.Internal.Types.KindRepTyConApp GHC.Internal.Tuple.$tcUnit [] @GHC.Internal.Types.KindRep +$krep [InlPrag=[~]] + = GHC.Internal.Types.KindRepTyConApp + Bug.$tcC + ((:) @GHC.Internal.Types.KindRep + $krep + ((:) @GHC.Internal.Types.KindRep + $krep [] @GHC.Internal.Types.KindRep)) Bug.$trModule [InlPrag=[~]] = GHC.Internal.Types.Module (GHC.Internal.Types.TrNameS "main"#) ===================================== testsuite/tests/typecheck/should_fail/T5300.stderr ===================================== @@ -1,4 +1,3 @@ - T5300.hs:12:7: error: [GHC-39999] • Could not deduce ‘C1 a b c0’ from the context: (Monad m, C1 a b c) @@ -14,16 +13,17 @@ T5300.hs:12:7: error: [GHC-39999] f1 :: (Monad m, C1 a b c) => a -> StateT (T b) m a T5300.hs:15:7: error: [GHC-39999] - • Could not deduce ‘C1 a1 b1 c10’ + • Could not deduce ‘C2 a2 b2 c20’ from the context: (Monad m, C1 a1 b1 c1, C2 a2 b2 c2) bound by the type signature for: f2 :: forall (m :: * -> *) a1 b1 c1 a2 b2 c2. (Monad m, C1 a1 b1 c1, C2 a2 b2 c2) => a1 -> StateT (T b2) m a2 at T5300.hs:15:7-69 - The type variable ‘c10’ is ambiguous + The type variable ‘c20’ is ambiguous • In the ambiguity check for ‘f2’ To defer the ambiguity check to use sites, enable AllowAmbiguousTypes In the type signature: f2 :: (Monad m, C1 a1 b1 c1, C2 a2 b2 c2) => a1 -> StateT (T b2) m a2 + View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/aa074c95c8a48ae5d29a299be5354457... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/aa074c95c8a48ae5d29a299be5354457... You're receiving this email because of your account on gitlab.haskell.org. Manage all notifications: https://gitlab.haskell.org/-/profile/notifications | Help: https://gitlab.haskell.org/help
participants (1)
-
Zubin (@wz1000)