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}
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...
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 ->
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