isVoidTy :: Type -> Bool
-- True if the type has zero width
isVoidTy ty = case repType ty of
                UnaryRep (TyConApp tc _) -> isVoidRep (tyConPrimRep tc)
                _                        -> False

{-
Note [AppTy rep]
~~~~~~~~~~~~~~~~
Types of the form 'f a' must be of kind *, not #, so we are guaranteed
that they are represented by pointers.  The reason is that f must have
kind (kk -> kk) and kk cannot be unlifted; see Note [The kind invariant]
in TypeRep.

---------------------------------------------------------------------
                                ForAllTy
                                ~~~~~~~~
-}
isVoidTy :: Type -> Bool
isVoidTy ty = case repType ty of
                UnaryRep (TyConApp tc _) -> isVoidRep (tyConPrimRep tc)
                _                        -> False

{-
Note [AppTy rep]
~~~~~~~~~~~~~~~~
Types of the form 'f a' must be of kind *, not #, so we are guaranteed
that they are represented by pointers.  The reason is that f must have
kind (kk -> kk) and kk cannot be unlifted; see Note [The kind invariant]
in TypeRep.

---------------------------------------------------------------------
                                ForAllTy
                                ~~~~~~~~
-}
isVoidTy ty = case repType ty of
                UnaryRep (TyConApp tc _) -> isVoidRep (tyConPrimRep tc)
                _                        -> False

{-
Note [AppTy rep]
~~~~~~~~~~~~~~~~
Types of the form 'f a' must be of kind *, not #, so we are guaranteed
that they are represented by pointers.  The reason is that f must have
kind (kk -> kk) and kk cannot be unlifted; see Note [The kind invariant]
in TypeRep.

---------------------------------------------------------------------
                                ForAllTy
                                ~~~~~~~~
-}