mkQualifiedHsForAllTy ::                           LHsContext RdrName -> LHsType RdrName -> HsType RdrName

-- | mkImplicitHsForAllTy is called when we encounter
--    f :: type
-- Wrap around a HsForallTy if one is not there already.
mkImplicitHsForAllTy (L _ (HsForAllTy exp extra tvs cxt ty))
  = HsForAllTy exp' extra tvs cxt ty
  where
    exp' = case exp of
             Qualified -> Implicit
                          -- Qualified is used only for a nested forall,
                          -- this is now top level
             _         -> exp
mkQualifiedHsForAllTy ::                           LHsContext RdrName -> LHsType RdrName -> HsType RdrName
mkImplicitHsForAllTy (L _ (HsForAllTy exp extra tvs cxt ty))
  = HsForAllTy exp' extra tvs cxt ty
  where
    exp' = case exp of
             Qualified -> Implicit
                          -- Qualified is used only for a nested forall,
                          -- this is now top level
             _         -> exp
mkImplicitHsForAllTy (L _ (HsForAllTy exp extra tvs cxt ty))
  = HsForAllTy exp' extra tvs cxt ty
  where
    exp' = case exp of
             Qualified -> Implicit
                          -- Qualified is used only for a nested forall,
                          -- this is now top level
             _         -> exp