diff options
author | Ziyang Liu <unsafeFixIO@gmail.com> | 2021-09-22 13:08:07 -0700 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-09-29 09:43:19 -0400 |
commit | a2be9f3456dbf86dde842e4d59991815486bb048 (patch) | |
tree | ad3ede3c8d9b2403d23ee9e3c6fbcfa4f1baa76b | |
parent | 5cc4bd574720fd97d877d702cbafa453434f035e (diff) | |
download | haskell-a2be9f3456dbf86dde842e4d59991815486bb048.tar.gz |
Document that `eqType`/`coreView` do not look through type families
This isn't clear from the existing doc.
-rw-r--r-- | compiler/GHC/Core/Type.hs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/compiler/GHC/Core/Type.hs b/compiler/GHC/Core/Type.hs index 0d82c010c0..f162ab6fd4 100644 --- a/compiler/GHC/Core/Type.hs +++ b/compiler/GHC/Core/Type.hs @@ -408,6 +408,8 @@ coreView :: Type -> Maybe Type -- Returns 'Nothing' if there is nothing to look through. -- This function considers 'Constraint' to be a synonym of @Type@. -- +-- This function does not look through type family applications. +-- -- By being non-recursive and inlined, this case analysis gets efficiently -- joined onto the case analysis that the caller is already doing coreView ty@(TyConApp tc tys) @@ -2507,8 +2509,8 @@ GHC.Core.TyCo.Rep for details. -} eqType :: Type -> Type -> Bool --- ^ Type equality on source types. Does not look through @newtypes@ or --- 'PredType's, but it does look through type synonyms. +-- ^ Type equality on source types. Does not look through @newtypes@, +-- 'PredType's or type families, but it does look through type synonyms. -- This first checks that the kinds of the types are equal and then -- checks whether the types are equal, ignoring casts and coercions. -- (The kind check is a recursive call, but since all kinds have type |