[project @ 1996-12-19 08:16:24 by sof]
[ghc-hetmet.git] / ghc / compiler / rename / ParseUtils.lhs
index dea7549..4e28daf 100644 (file)
@@ -24,13 +24,13 @@ import FiniteMap    ( unitFM, listToFM, lookupFM, plusFM, FiniteMap )
 import Maybes          ( maybeToBool, MaybeErr(..) )
 import Name            ( isLexConId, isLexVarId, isLexConSym,
                          mkTupNameStr, preludeQual, isRdrLexCon,
-                         RdrName(..){-instance Outputable:ToDo:rm-}
+                         RdrName(..) {-instance Outputable:ToDo:rm-}
                        )
 import PprStyle                ( PprStyle(..) ) -- ToDo: rm debugging
 import PrelMods                ( pRELUDE )
 import Pretty          ( ppCat, ppPStr, ppInt, ppShow, ppStr )
 import SrcLoc          ( mkIfaceSrcLoc )
-import Util            ( startsWith, isIn, panic, assertPanic, pprTrace{-ToDo:rm-} )
+import Util            ( startsWith, isIn, panic, assertPanic{-, pprTrace ToDo:rm-} )
 \end{code}
 
 \begin{code}
@@ -209,7 +209,7 @@ mk_class ctxt (qclas@(Qual mod clas), tyvar) ops_and_sigs
   where
     opify (Sig f ty _ loc) = ClassOpSig f ty noClassOpPragmas loc
 
-mk_inst        :: Maybe [RdrName] -- ToDo: de-maybe
+mk_inst        :: [RdrName]
        -> RdrNameContext
        -> RdrName -- class
        -> RdrNameMonoType  -- fish the tycon out yourself...
@@ -217,9 +217,7 @@ mk_inst     :: Maybe [RdrName] -- ToDo: de-maybe
 
 mk_inst        tvs ctxt qclas@(Qual cmod cname) mono_ty
   = let
-       ty = case tvs of
-              Nothing -> HsPreForAllTy ctxt mono_ty -- ToDo: get rid of this
-              Just ts -> HsForAllTy ts ctxt mono_ty
+       ty = HsForAllTy tvs ctxt mono_ty
     in
     -- pprTrace "mk_inst:" (ppr PprDebug ty) $
     InstSig qclas (tycon_name mono_ty) mkIfaceSrcLoc $ \ mod ->
@@ -315,11 +313,11 @@ lexIface input
          Just (m,rest) -> lex_name (Just m) (in_the_club rest) rest
       where
        in_the_club []    = panic "lex_word:in_the_club"
-       in_the_club (x:_) | isAlpha    x = is_var_sym
+       in_the_club (x:y) | isAlpha    x = is_var_sym
                          | is_sym_sym x = is_sym_sym
                          | x == '['     = is_list_sym
                          | x == '('     = is_tuple_sym
-                         | otherwise    = panic ("lex_word:in_the_club="++[x])
+                         | otherwise    = panic ("lex_word:in_the_club="++(x:y))
 
     module_dot (c:cs)
       = if not (isUpper c) || c == '\'' then