Commit 18a346a4 authored by Sylvain Henry's avatar Sylvain Henry Committed by Marge Bot

Modules: Core (#13009)

Update submodule: haddock
parent 818b3c38
Pipeline #16791 passed with stages
in 393 minutes and 45 seconds
...@@ -311,27 +311,28 @@ import GHC.Driver.Monad ...@@ -311,27 +311,28 @@ import GHC.Driver.Monad
import TcRnMonad ( finalSafeMode, fixSafeInstances, initIfaceTcRn ) import TcRnMonad ( finalSafeMode, fixSafeInstances, initIfaceTcRn )
import GHC.Iface.Load ( loadSysInterface ) import GHC.Iface.Load ( loadSysInterface )
import TcRnTypes import TcRnTypes
import Predicate import GHC.Core.Predicate
import GHC.Driver.Packages import GHC.Driver.Packages
import NameSet import NameSet
import RdrName import RdrName
import GHC.Hs import GHC.Hs
import Type hiding( typeKind ) import GHC.Core.Type hiding( typeKind )
import TcType import TcType
import Id import Id
import TysPrim ( alphaTyVars ) import TysPrim ( alphaTyVars )
import TyCon import GHC.Core.TyCon
import TyCoPpr ( pprForAll ) import GHC.Core.TyCo.Ppr ( pprForAll )
import Class import GHC.Core.Class
import DataCon import GHC.Core.DataCon
import GHC.Core.FVs ( orphNamesOfFamInst )
import GHC.Core.FamInstEnv ( FamInst, famInstEnvElts )
import GHC.Core.InstEnv
import Name hiding ( varName ) import Name hiding ( varName )
import Avail import Avail
import InstEnv
import FamInstEnv ( FamInst )
import SrcLoc import SrcLoc
import GHC.Core import GHC.Core
import GHC.Iface.Tidy import GHC.Iface.Tidy
import GHC.Driver.Phases ( Phase(..), isHaskellSrcFilename ) import GHC.Driver.Phases ( Phase(..), isHaskellSrcFilename )
import GHC.Driver.Finder import GHC.Driver.Finder
import GHC.Driver.Types import GHC.Driver.Types
import GHC.Driver.CmdLine import GHC.Driver.CmdLine
...@@ -356,8 +357,6 @@ import Lexer ...@@ -356,8 +357,6 @@ import Lexer
import ApiAnnotation import ApiAnnotation
import qualified GHC.LanguageExtensions as LangExt import qualified GHC.LanguageExtensions as LangExt
import NameEnv import NameEnv
import GHC.Core.FVs ( orphNamesOfFamInst )
import FamInstEnv ( famInstEnvElts )
import TcRnDriver import TcRnDriver
import Inst import Inst
import FamInst import FamInst
......
...@@ -27,7 +27,7 @@ import GHC.Driver.Types ...@@ -27,7 +27,7 @@ import GHC.Driver.Types
import Name import Name
import NameSet import NameSet
import Literal import Literal
import TyCon import GHC.Core.TyCon
import FastString import FastString
import GHC.StgToCmm.Layout ( ArgRep(..) ) import GHC.StgToCmm.Layout ( ArgRep(..) )
import GHC.Runtime.Heap.Layout import GHC.Runtime.Heap.Layout
......
...@@ -17,8 +17,8 @@ import GHC.Driver.Session ...@@ -17,8 +17,8 @@ import GHC.Driver.Session
import GHC.Driver.Types import GHC.Driver.Types
import Name ( Name, getName ) import Name ( Name, getName )
import NameEnv import NameEnv
import DataCon ( DataCon, dataConRepArgTys, dataConIdentity ) import GHC.Core.DataCon ( DataCon, dataConRepArgTys, dataConIdentity )
import TyCon ( TyCon, tyConFamilySize, isDataTyCon, tyConDataCons ) import GHC.Core.TyCon ( TyCon, tyConFamilySize, isDataTyCon, tyConDataCons )
import GHC.Types.RepType import GHC.Types.RepType
import GHC.StgToCmm.Layout ( mkVirtConstrSizes ) import GHC.StgToCmm.Layout ( mkVirtConstrSizes )
import GHC.StgToCmm.Closure ( tagForCon, NonVoid (..) ) import GHC.StgToCmm.Closure ( tagForCon, NonVoid (..) )
......
...@@ -25,7 +25,7 @@ import Unique ...@@ -25,7 +25,7 @@ import Unique
import Id import Id
import GHC.Core import GHC.Core
import Literal import Literal
import DataCon import GHC.Core.DataCon
import VarSet import VarSet
import PrimOp import PrimOp
import GHC.Runtime.Heap.Layout import GHC.Runtime.Heap.Layout
......
...@@ -22,7 +22,7 @@ import NameEnv ...@@ -22,7 +22,7 @@ import NameEnv
import Outputable import Outputable
import PrimOp import PrimOp
import SizedSeq import SizedSeq
import Type import GHC.Core.Type
import SrcLoc import SrcLoc
import GHCi.BreakArray import GHCi.BreakArray
import GHCi.RemoteTypes import GHCi.RemoteTypes
......
...@@ -72,7 +72,7 @@ module GHC.Cmm.Utils( ...@@ -72,7 +72,7 @@ module GHC.Cmm.Utils(
import GhcPrelude import GhcPrelude
import TyCon ( PrimRep(..), PrimElemRep(..) ) import GHC.Core.TyCon ( PrimRep(..), PrimElemRep(..) )
import GHC.Types.RepType ( UnaryType, SlotTy (..), typePrimRep1 ) import GHC.Types.RepType ( UnaryType, SlotTy (..), typePrimRep1 )
import GHC.Runtime.Heap.Layout import GHC.Runtime.Heap.Layout
......
...@@ -104,13 +104,13 @@ import GhcPrelude ...@@ -104,13 +104,13 @@ import GhcPrelude
import CostCentre import CostCentre
import VarEnv( InScopeSet ) import VarEnv( InScopeSet )
import Var import Var
import Type import GHC.Core.Type
import Coercion import GHC.Core.Coercion
import Name import Name
import NameSet import NameSet
import NameEnv( NameEnv, emptyNameEnv ) import NameEnv( NameEnv, emptyNameEnv )
import Literal import Literal
import DataCon import GHC.Core.DataCon
import Module import Module
import BasicTypes import BasicTypes
import GHC.Driver.Session import GHC.Driver.Session
......
...@@ -31,10 +31,10 @@ import Demand ...@@ -31,10 +31,10 @@ import Demand
import Var import Var
import VarEnv import VarEnv
import Id import Id
import Type import GHC.Core.Type as Type
import TyCon ( initRecTc, checkRecTc ) import GHC.Core.TyCon ( initRecTc, checkRecTc )
import Predicate ( isDictTy ) import GHC.Core.Predicate ( isDictTy )
import Coercion import GHC.Core.Coercion as Coercion
import BasicTypes import BasicTypes
import Unique import Unique
import GHC.Driver.Session ( DynFlags, GeneralFlag(..), gopt ) import GHC.Driver.Session ( DynFlags, GeneralFlag(..), gopt )
...@@ -130,7 +130,7 @@ typeArity ty ...@@ -130,7 +130,7 @@ typeArity ty
| Just (tc,tys) <- splitTyConApp_maybe ty | Just (tc,tys) <- splitTyConApp_maybe ty
, Just (ty', _) <- instNewTyCon_maybe tc tys , Just (ty', _) <- instNewTyCon_maybe tc tys
, Just rec_nts' <- checkRecTc rec_nts tc -- See Note [Expanding newtypes] , Just rec_nts' <- checkRecTc rec_nts tc -- See Note [Expanding newtypes]
-- in TyCon -- in GHC.Core.TyCon
-- , not (isClassTyCon tc) -- Do not eta-expand through newtype classes -- , not (isClassTyCon tc) -- Do not eta-expand through newtype classes
-- -- See Note [Newtype classes and eta expansion] -- -- See Note [Newtype classes and eta expansion]
-- (no longer required) -- (no longer required)
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
{-# LANGUAGE CPP #-} {-# LANGUAGE CPP #-}
module Class ( module GHC.Core.Class (
Class, Class,
ClassOpItem, ClassOpItem,
ClassATItem(..), ClassATItem(..),
...@@ -25,9 +25,9 @@ module Class ( ...@@ -25,9 +25,9 @@ module Class (
import GhcPrelude import GhcPrelude
import {-# SOURCE #-} TyCon ( TyCon ) import {-# SOURCE #-} GHC.Core.TyCon ( TyCon )
import {-# SOURCE #-} TyCoRep ( Type, PredType ) import {-# SOURCE #-} GHC.Core.TyCo.Rep ( Type, PredType )
import {-# SOURCE #-} TyCoPpr ( pprType ) import {-# SOURCE #-} GHC.Core.TyCo.Ppr ( pprType )
import Var import Var
import Name import Name
import BasicTypes import BasicTypes
...@@ -53,7 +53,7 @@ data Class ...@@ -53,7 +53,7 @@ data Class
= Class { = Class {
classTyCon :: TyCon, -- The data type constructor for classTyCon :: TyCon, -- The data type constructor for
-- dictionaries of this class -- dictionaries of this class
-- See Note [ATyCon for classes] in TyCoRep -- See Note [ATyCon for classes] in GHC.Core.TyCo.Rep
className :: Name, -- Just the cached name of the TyCon className :: Name, -- Just the cached name of the TyCon
classKey :: Unique, -- Cached unique of TyCon classKey :: Unique, -- Cached unique of TyCon
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
-- as used in System FC. See 'GHC.Core.Expr' for -- as used in System FC. See 'GHC.Core.Expr' for
-- more on System FC and how coercions fit into it. -- more on System FC and how coercions fit into it.
-- --
module Coercion ( module GHC.Core.Coercion (
-- * Main data type -- * Main data type
Coercion, CoercionN, CoercionR, CoercionP, MCoercion(..), MCoercionR, Coercion, CoercionN, CoercionR, CoercionP, MCoercion(..), MCoercionR,
UnivCoProvenance, CoercionHole(..), coHoleCoVar, setCoHoleCoVar, UnivCoProvenance, CoercionHole(..), coHoleCoVar, setCoHoleCoVar,
...@@ -121,14 +121,14 @@ import {-# SOURCE #-} GHC.CoreToIface (toIfaceTyCon, tidyToIfaceTcArgs) ...@@ -121,14 +121,14 @@ import {-# SOURCE #-} GHC.CoreToIface (toIfaceTyCon, tidyToIfaceTcArgs)
import GhcPrelude import GhcPrelude
import GHC.Iface.Type import GHC.Iface.Type
import TyCoRep import GHC.Core.TyCo.Rep
import TyCoFVs import GHC.Core.TyCo.FVs
import TyCoPpr import GHC.Core.TyCo.Ppr
import TyCoSubst import GHC.Core.TyCo.Subst
import TyCoTidy import GHC.Core.TyCo.Tidy
import Type import GHC.Core.Type
import TyCon import GHC.Core.TyCon
import CoAxiom import GHC.Core.Coercion.Axiom
import Var import Var
import VarEnv import VarEnv
import VarSet import VarSet
...@@ -155,7 +155,7 @@ import Data.Char( isDigit ) ...@@ -155,7 +155,7 @@ import Data.Char( isDigit )
-- The coercion arguments always *precisely* saturate -- The coercion arguments always *precisely* saturate
-- arity of (that branch of) the CoAxiom. If there are -- arity of (that branch of) the CoAxiom. If there are
-- any left over, we use AppCo. See -- any left over, we use AppCo. See
-- See [Coercion axioms applied to coercions] in TyCoRep -- See [Coercion axioms applied to coercions] in GHC.Core.TyCo.Rep
\subsection{Coercion variables} \subsection{Coercion variables}
%* * %* *
...@@ -185,7 +185,7 @@ Defined here to avoid module loops. CoAxiom is loaded very early on. ...@@ -185,7 +185,7 @@ Defined here to avoid module loops. CoAxiom is loaded very early on.
etaExpandCoAxBranch :: CoAxBranch -> ([TyVar], [Type], Type) etaExpandCoAxBranch :: CoAxBranch -> ([TyVar], [Type], Type)
-- Return the (tvs,lhs,rhs) after eta-expanding, -- Return the (tvs,lhs,rhs) after eta-expanding,
-- to the way in which the axiom was originally written -- to the way in which the axiom was originally written
-- See Note [Eta reduction for data families] in CoAxiom -- See Note [Eta reduction for data families] in GHC.Core.Coercion.Axiom
etaExpandCoAxBranch (CoAxBranch { cab_tvs = tvs etaExpandCoAxBranch (CoAxBranch { cab_tvs = tvs
, cab_eta_tvs = eta_tvs , cab_eta_tvs = eta_tvs
, cab_lhs = lhs , cab_lhs = lhs
...@@ -241,7 +241,7 @@ ppr_co_ax_branch ppr_rhs fam_tc branch ...@@ -241,7 +241,7 @@ ppr_co_ax_branch ppr_rhs fam_tc branch
-- Eta-expand LHS and RHS types, because sometimes data family -- Eta-expand LHS and RHS types, because sometimes data family
-- instances are eta-reduced. -- instances are eta-reduced.
-- See Note [Eta reduction for data families] in FamInstEnv. -- See Note [Eta reduction for data families] in GHC.Core.FamInstEnv.
(ee_tvs, ee_lhs, ee_rhs) = etaExpandCoAxBranch branch (ee_tvs, ee_lhs, ee_rhs) = etaExpandCoAxBranch branch
pp_lhs = pprIfaceTypeApp topPrec (toIfaceTyCon fam_tc) pp_lhs = pprIfaceTypeApp topPrec (toIfaceTyCon fam_tc)
...@@ -330,7 +330,7 @@ Suppose we have this: ...@@ -330,7 +330,7 @@ Suppose we have this:
(f |> co) t1 .. tn (f |> co) t1 .. tn
Then we want to push the coercion into the arguments, so as to make Then we want to push the coercion into the arguments, so as to make
progress. For example of why you might want to do so, see Note progress. For example of why you might want to do so, see Note
[Respecting definitional equality] in TyCoRep. [Respecting definitional equality] in GHC.Core.TyCo.Rep.
This is done by decomposePiCos. Specifically, if This is done by decomposePiCos. Specifically, if
decomposePiCos co [t1,..,tn] = ([co1,...,cok], cor) decomposePiCos co [t1,..,tn] = ([co1,...,cok], cor)
...@@ -732,7 +732,7 @@ mkAppCo (TyConAppCo r tc args) arg ...@@ -732,7 +732,7 @@ mkAppCo (TyConAppCo r tc args) arg
mkAppCo co arg = AppCo co arg mkAppCo co arg = AppCo co arg
-- Note, mkAppCo is careful to maintain invariants regarding -- Note, mkAppCo is careful to maintain invariants regarding
-- where Refl constructors appear; see the comments in the definition -- where Refl constructors appear; see the comments in the definition
-- of Coercion and the Note [Refl invariant] in TyCoRep. -- of Coercion and the Note [Refl invariant] in GHC.Core.TyCo.Rep.
-- | Applies multiple 'Coercion's to another 'Coercion', from left to right. -- | Applies multiple 'Coercion's to another 'Coercion', from left to right.
-- See also 'mkAppCo'. -- See also 'mkAppCo'.
...@@ -743,8 +743,8 @@ mkAppCos co1 cos = foldl' mkAppCo co1 cos ...@@ -743,8 +743,8 @@ mkAppCos co1 cos = foldl' mkAppCo co1 cos
{- Note [Unused coercion variable in ForAllCo] {- Note [Unused coercion variable in ForAllCo]
See Note [Unused coercion variable in ForAllTy] in TyCoRep for the motivation for See Note [Unused coercion variable in ForAllTy] in GHC.Core.TyCo.Rep for the
checking coercion variable in types. motivation for checking coercion variable in types.
To lift the design choice to (ForAllCo cv kind_co body_co), we have two options: To lift the design choice to (ForAllCo cv kind_co body_co), we have two options:
(1) In mkForAllCo, we check whether cv is a coercion variable (1) In mkForAllCo, we check whether cv is a coercion variable
...@@ -1367,7 +1367,7 @@ promoteCoercion co = case co of ...@@ -1367,7 +1367,7 @@ promoteCoercion co = case co of
ForAllCo _ _ _ ForAllCo _ _ _
-> ASSERT( False ) -> ASSERT( False )
mkNomReflCo liftedTypeKind mkNomReflCo liftedTypeKind
-- See Note [Weird typing rule for ForAllTy] in Type -- See Note [Weird typing rule for ForAllTy] in GHC.Core.Type
FunCo _ _ _ FunCo _ _ _
-> ASSERT( False ) -> ASSERT( False )
...@@ -1416,7 +1416,7 @@ promoteCoercion co = case co of ...@@ -1416,7 +1416,7 @@ promoteCoercion co = case co of
| otherwise | otherwise
-> ASSERT( False) -> ASSERT( False)
mkNomReflCo liftedTypeKind mkNomReflCo liftedTypeKind
-- See Note [Weird typing rule for ForAllTy] in Type -- See Note [Weird typing rule for ForAllTy] in GHC.Core.Type
KindCo _ KindCo _
-> ASSERT( False ) -> ASSERT( False )
...@@ -1486,7 +1486,7 @@ castCoercionKindI g h1 h2 ...@@ -1486,7 +1486,7 @@ castCoercionKindI g h1 h2
= mkCoherenceRightCo r t2 h2 (mkCoherenceLeftCo r t1 h1 g) = mkCoherenceRightCo r t2 h2 (mkCoherenceLeftCo r t1 h1 g)
where (Pair t1 t2, r) = coercionKindRole g where (Pair t1 t2, r) = coercionKindRole g
-- See note [Newtype coercions] in TyCon -- See note [Newtype coercions] in GHC.Core.TyCon
mkPiCos :: Role -> [Var] -> Coercion -> Coercion mkPiCos :: Role -> [Var] -> Coercion -> Coercion
mkPiCos r vs co = foldr (mkPiCo r) co vs mkPiCos r vs co = foldr (mkPiCo r) co vs
...@@ -1743,8 +1743,8 @@ This follows the lifting context extension definition in the ...@@ -1743,8 +1743,8 @@ This follows the lifting context extension definition in the
data LiftingContext = LC TCvSubst LiftCoEnv data LiftingContext = LC TCvSubst LiftCoEnv
-- in optCoercion, we need to lift when optimizing InstCo. -- in optCoercion, we need to lift when optimizing InstCo.
-- See Note [Optimising InstCo] in OptCoercion -- See Note [Optimising InstCo] in GHC.Core.Coercion.Opt
-- We thus propagate the substitution from OptCoercion here. -- We thus propagate the substitution from GHC.Core.Coercion.Opt here.
instance Outputable LiftingContext where instance Outputable LiftingContext where
ppr (LC _ env) = hang (text "LiftingContext:") 2 (ppr env) ppr (LC _ env) = hang (text "LiftingContext:") 2 (ppr env)
...@@ -1912,7 +1912,7 @@ Note [liftCoSubstTyVar] ...@@ -1912,7 +1912,7 @@ Note [liftCoSubstTyVar]
This function can fail if a coercion in the environment is of too low a role. This function can fail if a coercion in the environment is of too low a role.
liftCoSubstTyVar is called from two places: in liftCoSubst (naturally), and liftCoSubstTyVar is called from two places: in liftCoSubst (naturally), and
also in matchAxiom in OptCoercion. From liftCoSubst, the so-called lifting also in matchAxiom in GHC.Core.Coercion.Opt. From liftCoSubst, the so-called lifting
lemma guarantees that the roles work out. If we fail in this lemma guarantees that the roles work out. If we fail in this
case, we really should panic -- something is deeply wrong. But, in matchAxiom, case, we really should panic -- something is deeply wrong. But, in matchAxiom,
failing is fine. matchAxiom is trying to find a set of coercions failing is fine. matchAxiom is trying to find a set of coercions
...@@ -2423,7 +2423,8 @@ mkReprPrimEqPred ty1 ty2 ...@@ -2423,7 +2423,8 @@ mkReprPrimEqPred ty1 ty2
-- | Assuming that two types are the same, ignoring coercions, find -- | Assuming that two types are the same, ignoring coercions, find
-- a nominal coercion between the types. This is useful when optimizing -- a nominal coercion between the types. This is useful when optimizing
-- transitivity over coercion applications, where splitting two -- transitivity over coercion applications, where splitting two
-- AppCos might yield different kinds. See Note [EtaAppCo] in OptCoercion. -- AppCos might yield different kinds. See Note [EtaAppCo] in
-- GHC.Core.Coercion.Opt.
buildCoercion :: Type -> Type -> CoercionN buildCoercion :: Type -> Type -> CoercionN
buildCoercion orig_ty1 orig_ty2 = go orig_ty1 orig_ty2 buildCoercion orig_ty1 orig_ty2 = go orig_ty1 orig_ty2
where where
...@@ -2792,7 +2793,7 @@ is `k -> Any @a`, and thus the third argument of `x :: k` is well-kinded. ...@@ -2792,7 +2793,7 @@ is `k -> Any @a`, and thus the third argument of `x :: k` is well-kinded.
-} -}
-- This is shared between the flattener and the normaliser in FamInstEnv. -- This is shared between the flattener and the normaliser in GHC.Core.FamInstEnv.
-- See Note [simplifyArgsWorker] -- See Note [simplifyArgsWorker]
{-# INLINE simplifyArgsWorker #-} {-# INLINE simplifyArgsWorker #-}
simplifyArgsWorker :: [TyCoBinder] -> Kind simplifyArgsWorker :: [TyCoBinder] -> Kind
......
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleContexts #-}
module Coercion where module GHC.Core.Coercion where
import GhcPrelude import GhcPrelude
import {-# SOURCE #-} TyCoRep import {-# SOURCE #-} GHC.Core.TyCo.Rep
import {-# SOURCE #-} TyCon import {-# SOURCE #-} GHC.Core.TyCon
import BasicTypes ( LeftOrRight ) import BasicTypes ( LeftOrRight )
import CoAxiom import GHC.Core.Coercion.Axiom
import Var import Var
import Pair import Pair
import Util import Util
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- | Module for coercion axioms, used to represent type family instances -- | Module for coercion axioms, used to represent type family instances
-- and newtypes -- and newtypes
module CoAxiom ( module GHC.Core.Coercion.Axiom (
BranchFlag, Branched, Unbranched, BranchIndex, Branches(..), BranchFlag, Branched, Unbranched, BranchIndex, Branches(..),
manyBranches, unbranched, manyBranches, unbranched,
fromBranches, numBranches, fromBranches, numBranches,
...@@ -31,9 +31,9 @@ module CoAxiom ( ...@@ -31,9 +31,9 @@ module CoAxiom (
import GhcPrelude import GhcPrelude
import {-# SOURCE #-} TyCoRep ( Type ) import {-# SOURCE #-} GHC.Core.TyCo.Rep ( Type )
import {-# SOURCE #-} TyCoPpr ( pprType ) import {-# SOURCE #-} GHC.Core.TyCo.Ppr ( pprType )
import {-# SOURCE #-} TyCon ( TyCon ) import {-# SOURCE #-} GHC.Core.TyCon ( TyCon )
import Outputable import Outputable
import FastString import FastString
import Name import Name
...@@ -87,7 +87,7 @@ can unify with the supplied arguments. After all, it is possible that some ...@@ -87,7 +87,7 @@ can unify with the supplied arguments. After all, it is possible that some
of the type arguments are lambda-bound type variables whose instantiation may of the type arguments are lambda-bound type variables whose instantiation may
cause an earlier match among the branches. We wish to prohibit this behavior, cause an earlier match among the branches. We wish to prohibit this behavior,
so the type checker rules out the choice of a branch where a previous branch so the type checker rules out the choice of a branch where a previous branch
can unify. See also [Apartness] in FamInstEnv.hs. can unify. See also [Apartness] in GHC.Core.FamInstEnv.
For example, the following is malformed, where 'a' is a lambda-bound type For example, the following is malformed, where 'a' is a lambda-bound type
variable: variable:
...@@ -306,7 +306,7 @@ isImplicitCoAxiom = co_ax_implicit ...@@ -306,7 +306,7 @@ isImplicitCoAxiom = co_ax_implicit
coAxBranchIncomps :: CoAxBranch -> [CoAxBranch] coAxBranchIncomps :: CoAxBranch -> [CoAxBranch]
coAxBranchIncomps = cab_incomps coAxBranchIncomps = cab_incomps
-- See Note [Compatibility checking] in FamInstEnv -- See Note [Compatibility checking] in GHC.Core.FamInstEnv
placeHolderIncomps :: [CoAxBranch] placeHolderIncomps :: [CoAxBranch]
placeHolderIncomps = panic "placeHolderIncomps" placeHolderIncomps = panic "placeHolderIncomps"
...@@ -431,7 +431,7 @@ looked like ...@@ -431,7 +431,7 @@ looked like
(See #9692, #14179, and #15845 for examples of what can go wrong if (See #9692, #14179, and #15845 for examples of what can go wrong if
we don't eta-expand when showing things to the user.) we don't eta-expand when showing things to the user.)
(See also Note [Newtype eta] in TyCon. This is notionally separate (See also Note [Newtype eta] in GHC.Core.TyCon. This is notionally separate
and deals with the axiom connecting a newtype with its representation and deals with the axiom connecting a newtype with its representation
type; but it too is eta-reduced.) type; but it too is eta-reduced.)
-} -}
...@@ -473,8 +473,8 @@ instance Outputable CoAxBranch where ...@@ -473,8 +473,8 @@ instance Outputable CoAxBranch where
Roles are defined here to avoid circular dependencies. Roles are defined here to avoid circular dependencies.
-} -}
-- See Note [Roles] in Coercion -- See Note [Roles] in GHC.Core.Coercion
-- defined here to avoid cyclic dependency with Coercion -- defined here to avoid cyclic dependency with GHC.Core.Coercion
-- --
-- Order of constructors matters: the Ord instance coincides with the *super*typing -- Order of constructors matters: the Ord instance coincides with the *super*typing
-- relation on roles. -- relation on roles.
......
...@@ -2,29 +2,29 @@ ...@@ -2,29 +2,29 @@
{-# LANGUAGE CPP #-} {-# LANGUAGE CPP #-}
module OptCoercion ( optCoercion, checkAxInstCo ) where module GHC.Core.Coercion.Opt ( optCoercion, checkAxInstCo ) where
#include "HsVersions.h" #include "HsVersions.h"
import GhcPrelude import GhcPrelude
import GHC.Driver.Session import GHC.Driver.Session
import TyCoRep import GHC.Core.TyCo.Rep
import TyCoSubst import GHC.Core.TyCo.Subst
import Coercion import GHC.Core.Coercion
import Type hiding( substTyVarBndr, substTy ) import GHC.Core.Type as Type hiding( substTyVarBndr, substTy )
import TcType ( exactTyCoVarsOfType ) import TcType ( exactTyCoVarsOfType )
import TyCon import GHC.Core.TyCon
import CoAxiom import GHC.Core.Coercion.Axiom
import VarSet import VarSet
import VarEnv import VarEnv
import Outputable import Outputable
import FamInstEnv ( flattenTys ) import GHC.Core.FamInstEnv ( flattenTys )
import Pair import Pair
import ListSetOps ( getNth ) import ListSetOps ( getNth )
import Util import Util
import Unify import GHC.Core.Unify
import InstEnv import GHC.Core.InstEnv
import Control.Monad ( zipWithM ) import Control.Monad ( zipWithM )
{- {-
...@@ -75,7 +75,7 @@ If we substitute the *type* tv for the *coercion* ...@@ -75,7 +75,7 @@ If we substitute the *type* tv for the *coercion*
(g2 ; t2 ~ t2 |> sym h) in g, we'll get this result exactly. (g2 ; t2 ~ t2 |> sym h) in g, we'll get this result exactly.
This is bizarre,