[commit: ghc] wip/ttypeable: Comments (f428bf0)

git at git.haskell.org git at git.haskell.org
Tue Feb 7 17:30:00 UTC 2017


Repository : ssh://git@git.haskell.org/ghc

On branch  : wip/ttypeable
Link       : http://ghc.haskell.org/trac/ghc/changeset/f428bf035b4c0f8e5ef7145abc46182d762f8f64/ghc

>---------------------------------------------------------------

commit f428bf035b4c0f8e5ef7145abc46182d762f8f64
Author: Ben Gamari <ben at smart-cactus.org>
Date:   Thu Feb 2 12:44:45 2017 -0500

    Comments


>---------------------------------------------------------------

f428bf035b4c0f8e5ef7145abc46182d762f8f64
 compiler/typecheck/TcTypeable.hs | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/compiler/typecheck/TcTypeable.hs b/compiler/typecheck/TcTypeable.hs
index 6ae5002..25c7830 100644
--- a/compiler/typecheck/TcTypeable.hs
+++ b/compiler/typecheck/TcTypeable.hs
@@ -358,6 +358,8 @@ mkTyConRepBinds stuff@(Stuff {..}) todo (tycon, tycon_kind)
            -- We should have already excluded non-representable tycons in
            -- mkTyConTodos.
 
+-- | Here is where we define the set of Typeable types. These exclude type
+-- families and polytypes.
 tyConIsTypeable :: TyCon -> Bool
 tyConIsTypeable tc =
        isJust (tyConRepName_maybe tc)
@@ -366,9 +368,12 @@ tyConIsTypeable tc =
       -- is representable (e.g. has no higher-rank polymorphism or type
       -- synonyms).
 
+-- | Is a particular 'Type' representable by @Typeable@? Here we look for
+-- polytypes and types containing casts (which may be, for instance, a type
+-- family).
 typeIsTypeable :: Type -> Bool
 -- We handle types of the form (TYPE rep) specifically to avoid
--- looping on RuntimeRep
+-- looping on (tyConIsTypeable RuntimeRep)
 typeIsTypeable ty
   | Just ty' <- coreView ty         = typeIsTypeable ty'
 typeIsTypeable ty



More information about the ghc-commits mailing list