summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
9c26739)
More small changes to 2.04
33 files changed:
import Type ( SYN_IE(Type) )
import Outputable
import Type ( SYN_IE(Type) )
import Outputable
-import UniqFM ( Uniquable(..) )
+import Unique ( Uniquable(..) )
import UniqSet -- practically all of it
import Unique ( getBuiltinUniques, pprUnique, showUnique,
incrUnique,
import UniqSet -- practically all of it
import Unique ( getBuiltinUniques, pprUnique, showUnique,
incrUnique,
- Unique{-instance Ord3-}
+ Unique{-instance Ord3-},
+ Uniquable(..)
)
import Outputable ( ifPprDebug, Outputable(..), PprStyle(..) )
import Util {- ( mapAccumL, nOfThem, zipEqual, assoc,
)
import Outputable ( ifPprDebug, Outputable(..), PprStyle(..) )
import Util {- ( mapAccumL, nOfThem, zipEqual, assoc,
import Lex ( isLexSym, isLexConId )
import SrcLoc ( noSrcLoc, SrcLoc )
import Usage ( SYN_IE(UVar), SYN_IE(Usage) )
import Lex ( isLexSym, isLexConId )
import SrcLoc ( noSrcLoc, SrcLoc )
import Usage ( SYN_IE(UVar), SYN_IE(Usage) )
-import Unique ( pprUnique, showUnique, Unique )
+import Unique ( pprUnique, showUnique, Unique, Uniquable(..) )
import UniqSet ( UniqSet(..), emptyUniqSet, unitUniqSet, unionUniqSets, uniqSetToList, isEmptyUniqSet,
unionManyUniqSets, minusUniqSet, mkUniqSet, elementOfUniqSet, addListToUniqSet, addOneToUniqSet )
import UniqSet ( UniqSet(..), emptyUniqSet, unitUniqSet, unionUniqSets, uniqSetToList, isEmptyUniqSet,
unionManyUniqSets, minusUniqSet, mkUniqSet, elementOfUniqSet, addListToUniqSet, addOneToUniqSet )
-import UniqFM ( UniqFM, Uniquable(..) )
+import UniqFM ( UniqFM )
import Util --( cmpPString, panic, assertPanic {-, pprTrace ToDo:rm-} )
\end{code}
import Util --( cmpPString, panic, assertPanic {-, pprTrace ToDo:rm-} )
\end{code}
_interface_ Unique 1
_exports_
_interface_ Unique 1
_exports_
-Unique Unique mkUniqueGrimily;
+Unique Unique Uniquable(uniqueOf) mkUniqueGrimily;
_declarations_
1 data Unique;
1 mkUniqueGrimily _:_ GHC.Int# -> Unique.Unique ;;
_declarations_
1 data Unique;
1 mkUniqueGrimily _:_ GHC.Int# -> Unique.Unique ;;
+1 class Uniquable a where {uniqueOf :: a -> Unique};
--<mkdependHS:friends> UniqSupply
module Unique (
--<mkdependHS:friends> UniqSupply
module Unique (
u2i, -- hack: used in UniqFM
pprUnique, pprUnique10, showUnique,
u2i, -- hack: used in UniqFM
pprUnique, pprUnique10, showUnique,
-#if __GLASGOW_HASKELL__ >= 202
-import {-# SOURCE #-} UniqFM ( Uniquable(..) )
-#endif
-
import Outputable
import Pretty
import Util
import Outputable
import Pretty
import Util
Fast comparison is everything on @Uniques@:
\begin{code}
Fast comparison is everything on @Uniques@:
\begin{code}
-u2i :: Unique -> FAST_INT
-
data Unique = MkUnique Int#
data Unique = MkUnique Int#
+
+class Uniquable a where
+ uniqueOf :: a -> Unique
+\end{code}
+
+\begin{code}
+u2i :: Unique -> FAST_INT
u2i (MkUnique i) = i
\end{code}
u2i (MkUnique i) = i
\end{code}
import Pretty ( Doc )
import PrimRep ( PrimRep )
import StgSyn ( SYN_IE(StgArg), SYN_IE(StgLiveVars), GenStgArg(..) )
import Pretty ( Doc )
import PrimRep ( PrimRep )
import StgSyn ( SYN_IE(StgArg), SYN_IE(StgLiveVars), GenStgArg(..) )
-import Unique ( Unique )
-import UniqFM ( Uniquable(..) )
+import Unique ( Unique, Uniquable(..) )
import Util ( zipWithEqual, panic )
\end{code}
import Util ( zipWithEqual, panic )
\end{code}
maybeAppSpecDataTyConExpandingDicts,
SYN_IE(Type)
)
maybeAppSpecDataTyConExpandingDicts,
SYN_IE(Type)
)
-import Unique ( Unique )
-import UniqFM ( Uniquable(..) )
+import Unique ( Unique, Uniquable(..) )
import Util ( sortLt, isIn, isn'tIn, zipEqual,
pprError, panic, assertPanic
)
import Util ( sortLt, isIn, isn'tIn, zipEqual,
pprError, panic, assertPanic
)
import Outputable ( PprStyle(..) )
import SrcLoc ( SrcLoc{-instance-} )
import Type ( SYN_IE(Type) )
import Outputable ( PprStyle(..) )
import SrcLoc ( SrcLoc{-instance-} )
import Type ( SYN_IE(Type) )
-import Unique ( Unique, otherwiseIdKey )
-import UniqFM ( Uniquable(..) )
+import Unique ( Unique, otherwiseIdKey, Uniquable(..) )
import Util ( panic )
\end{code}
import Util ( panic )
\end{code}
= ($$) (ppr_monobind sty binds1) (ppr_monobind sty binds2)
ppr_monobind sty (PatMonoBind pat grhss_n_binds locn)
= ($$) (ppr_monobind sty binds1) (ppr_monobind sty binds2)
ppr_monobind sty (PatMonoBind pat grhss_n_binds locn)
- = hang (ppr sty pat) 4 (pprGRHSsAndBinds sty False grhss_n_binds)
+ = sep [ppr sty pat, nest 4 (pprGRHSsAndBinds sty False grhss_n_binds)]
ppr_monobind sty (FunMonoBind fun inf matches locn)
= pprMatches sty (False, ppr sty fun) matches
-- ToDo: print infix if appropriate
ppr_monobind sty (VarMonoBind name expr)
ppr_monobind sty (FunMonoBind fun inf matches locn)
= pprMatches sty (False, ppr sty fun) matches
-- ToDo: print infix if appropriate
ppr_monobind sty (VarMonoBind name expr)
- = hang (hsep [ppr sty name, equals]) 4 (pprExpr sty expr)
+ = sep [ppr sty name <+> equals, nest 4 (pprExpr sty expr)]
ppr_monobind sty (CoreMonoBind name expr)
ppr_monobind sty (CoreMonoBind name expr)
- = hang (hsep [ppr sty name, equals]) 4 (ppr sty expr)
+ = sep [ppr sty name <+> equals, nest 4 (ppr sty expr)]
ppr_monobind sty (AbsBinds tyvars dictvars exports val_binds)
= ($$) (sep [ptext SLIT("AbsBinds"),
ppr_monobind sty (AbsBinds tyvars dictvars exports val_binds)
= ($$) (sep [ptext SLIT("AbsBinds"),
pprContext :: (Outputable name) => PprStyle -> (Context name) -> Doc
pprContext sty [] = empty
pprContext sty context
pprContext :: (Outputable name) => PprStyle -> (Context name) -> Doc
pprContext sty [] = empty
pprContext sty context
- = hsep [braces (hsep (punctuate comma (map ppr_assert context)))]
+ = pprQuote sty $ \ sty -> parens (hsep (punctuate comma (map ppr_assert context)))
where
ppr_assert (clas, ty) = hsep [ppr sty clas, ppr sty ty]
\end{code}
where
ppr_assert (clas, ty) = hsep [ppr sty clas, ppr sty ty]
\end{code}
CodeSegment
)
import Unique ( mkPseudoUnique1, mkPseudoUnique2, mkPseudoUnique3,
CodeSegment
)
import Unique ( mkPseudoUnique1, mkPseudoUnique2, mkPseudoUnique3,
- Unique{-instance Ord3-}
+ Unique{-instance Ord3-}, Uniquable(..)
)
import UniqSupply ( getUnique, returnUs, thenUs, SYN_IE(UniqSM) )
)
import UniqSupply ( getUnique, returnUs, thenUs, SYN_IE(UniqSM) )
-import UniqFM ( Uniquable(..) )
import Util ( panic, Ord3(..) )
\end{code}
import Util ( panic, Ord3(..) )
\end{code}
import Type
import Bag
import Unique -- *Key stuff
import Type
import Bag
import Unique -- *Key stuff
-import UniqFM ( UniqFM, listToUFM, Uniquable(..) )
+import UniqFM ( UniqFM, listToUFM )
import Util ( isIn )
\end{code}
import Util ( isIn )
\end{code}
import TysWiredIn ( tupleTyCon, listTyCon, charTyCon, intTyCon )
import FiniteMap
import Outputable
import TysWiredIn ( tupleTyCon, listTyCon, charTyCon, intTyCon )
import FiniteMap
import Outputable
-import Unique ( Unique, unboundKey )
-import UniqFM ( Uniquable(..), listToUFM, plusUFM_C )
+import Unique ( Unique, Uniquable(..), unboundKey )
+import UniqFM ( listToUFM, plusUFM_C )
import Maybes ( maybeToBool )
import UniqSupply
import SrcLoc ( SrcLoc, noSrcLoc )
import Maybes ( maybeToBool )
import UniqSupply
import SrcLoc ( SrcLoc, noSrcLoc )
************************************************************************
\begin{code}
************************************************************************
\begin{code}
-rnMatch :: RdrNameMatch -> RnMS s (RenamedMatch, FreeVars)
+rnMatch, rnMatch1 :: RdrNameMatch -> RnMS s (RenamedMatch, FreeVars)
-rnMatch (PatMatch pat match)
- = bindLocalsRn "pattern" binders $ \ new_binders ->
- rnPat pat `thenRn` \ pat' ->
- rnMatch match `thenRn` \ (match', fvMatch) ->
- returnRn (PatMatch pat' match', fvMatch `minusNameSet` mkNameSet new_binders)
+-- The only tricky bit here is that we want to do a single
+-- bindLocalsRn for all the matches together, so that we spot
+-- the repeated variable in
+-- f x x = 1
+
+rnMatch match
+ = bindLocalsRn "pattern" (get_binders match) $ \ new_binders ->
+ rnMatch1 match `thenRn` \ (match', fvs) ->
+ returnRn (match', fvs `minusNameSet` mkNameSet new_binders)
- binders = collectPatBinders pat
+ get_binders (GRHSMatch _) = []
+ get_binders (PatMatch pat match) = collectPatBinders pat ++ get_binders match
+
+rnMatch1 (PatMatch pat match)
+ = rnPat pat `thenRn` \ pat' ->
+ rnMatch1 match `thenRn` \ (match', fvs) ->
+ returnRn (PatMatch pat' match', fvs)
-rnMatch (GRHSMatch grhss_and_binds)
+rnMatch1 (GRHSMatch grhss_and_binds)
= rnGRHSsAndBinds grhss_and_binds `thenRn` \ (grhss_and_binds', fvs) ->
returnRn (GRHSMatch grhss_and_binds', fvs)
\end{code}
= rnGRHSsAndBinds grhss_and_binds `thenRn` \ (grhss_and_binds', fvs) ->
returnRn (GRHSMatch grhss_and_binds', fvs)
\end{code}
import ListSetOps ( unionLists, minusList )
import Maybes ( maybeToBool, catMaybes )
import Bag ( emptyBag, unitBag, consBag, unionManyBags, unionBags, listToBag, bagToList )
import ListSetOps ( unionLists, minusList )
import Maybes ( maybeToBool, catMaybes )
import Bag ( emptyBag, unitBag, consBag, unionManyBags, unionBags, listToBag, bagToList )
-import Outputable ( PprStyle(..), Outputable(..){-instances-} )
+import Outputable ( PprStyle(..), Outputable(..){-instances-}, pprQuote )
import Pretty
import SrcLoc ( SrcLoc )
import Unique ( Unique )
import Pretty
import SrcLoc ( SrcLoc )
import Unique ( Unique )
ptext SLIT("does not appear in method signature")])
4 (ppr sty sig)
ptext SLIT("does not appear in method signature")])
4 (ppr sty sig)
-dupClassAssertWarn ctxt dups sty
- = hang (hcat [ptext SLIT("Duplicate class assertion `"),
- ppr sty dups,
- ptext SLIT("' in context:")])
- 4 (ppr sty ctxt)
+dupClassAssertWarn ctxt ((clas,ty) : dups) sty
+ = hang (hcat [ptext SLIT("Duplicated class assertion"),
+ pprQuote sty $ \ sty -> ppr sty clas <+> ppr sty ty,
+ ptext SLIT("in context:")])
+ 4 (pprContext sty ctxt)
- = hsep [ptext SLIT("Illegal data constructor name:"), ppr sty name]
+ = hsep [ptext SLIT("Illegal data constructor name"), ppr sty name]
- = hsep [ptext SLIT("`All' applied to a non-type variable:"), ppr sty ty]
+ = hsep [ptext SLIT("`All' applied to a non-type variable"), ppr sty ty]
ctxtErr1 doc tyvars sty
= hsep [ptext SLIT("Context constrains in-scope type variable(s)"),
ctxtErr1 doc tyvars sty
= hsep [ptext SLIT("Context constrains in-scope type variable(s)"),
import SpecUtils ( pprSpecErrs )
import StrictAnal ( saWwTopBinds )
import TyVar ( nullTyVarEnv, GenTyVar{-instance Eq-} )
import SpecUtils ( pprSpecErrs )
import StrictAnal ( saWwTopBinds )
import TyVar ( nullTyVarEnv, GenTyVar{-instance Eq-} )
-import Unique ( integerTyConKey, ratioTyConKey, Unique{-instance Eq-} )
-import UniqFM ( Uniquable(..) )
+import Unique ( integerTyConKey, ratioTyConKey, Unique{-instance Eq-}, Uniquable(..) )
import UniqSupply ( splitUniqSupply, getUnique, UniqSupply )
import Util ( mapAccumL, assertPanic, panic{-ToDo:rm-}, pprTrace, pprPanic )
import SrcLoc ( noSrcLoc )
import UniqSupply ( splitUniqSupply, getUnique, UniqSupply )
import Util ( mapAccumL, assertPanic, panic{-ToDo:rm-}, pprTrace, pprPanic )
import SrcLoc ( noSrcLoc )
SYN_IE(TyVarEnv), GenTyVar{-instance Eq-} ,
SYN_IE(TyVar)
)
SYN_IE(TyVarEnv), GenTyVar{-instance Eq-} ,
SYN_IE(TyVar)
)
-import Unique ( Unique{-instance Outputable-} )
-import UniqFM ( addToUFM_C, ufmToList, Uniquable(..)
- )
+import Unique ( Unique{-instance Outputable-}, Uniquable(..) )
+import UniqFM ( addToUFM_C, ufmToList )
import Usage ( SYN_IE(UVar), GenUsage{-instances-} )
import Util ( SYN_IE(Eager), appEager, returnEager, runEager,
zipEqual, thenCmp, cmpList, panic, panic#, assertPanic, Ord3(..) )
import Usage ( SYN_IE(UVar), GenUsage{-instances-} )
import Util ( SYN_IE(Eager), appEager, returnEager, runEager,
zipEqual, thenCmp, cmpList, panic, panic#, assertPanic, Ord3(..) )
)
import TysWiredIn ( stringTy )
import TyVar ( unitTyVarSet, GenTyVar, SYN_IE(TyVar) )
)
import TysWiredIn ( stringTy )
import TyVar ( unitTyVarSet, GenTyVar, SYN_IE(TyVar) )
-import Unique ( Unique )
-import UniqFM ( Uniquable(..) )
+import Unique ( Unique, Uniquable(..) )
NamedThing(..)
)
import Pretty
NamedThing(..)
)
import Pretty
-import Unique ( pprUnique10{-, pprUnique ToDo:rm-}, Unique )
+import Unique ( pprUnique10{-, pprUnique ToDo:rm-}, Unique, Uniquable(..) )
import UniqFM
import Util ( zipEqual, zipWithEqual, zipWith3Equal, zipLazy,
panic, pprPanic, pprTrace
import UniqFM
import Util ( zipEqual, zipWithEqual, zipWith3Equal, zipLazy,
panic, pprPanic, pprTrace
import TyCon ( isSynTyCon, isDataTyCon, derivedClasses )
import Type ( GenType(..), SYN_IE(ThetaType), mkTyVarTys, isPrimType,
splitSigmaTy, splitAppTys, isTyVarTy, matchTy, mkSigmaTy,
import TyCon ( isSynTyCon, isDataTyCon, derivedClasses )
import Type ( GenType(..), SYN_IE(ThetaType), mkTyVarTys, isPrimType,
splitSigmaTy, splitAppTys, isTyVarTy, matchTy, mkSigmaTy,
- getTyCon_maybe, maybeAppTyCon, SYN_IE(Type),
+ getTyCon_maybe, maybeAppTyCon, SYN_IE(Type), getTyVar,
maybeBoxedPrimType, maybeAppDataTyCon, splitRhoTy, eqTy
)
import TyVar ( GenTyVar, SYN_IE(GenTyVarSet), tyVarSetToList,
mkTyVarSet, unionTyVarSets, SYN_IE(TyVar) )
import TysPrim ( byteArrayPrimTyCon, mutableByteArrayPrimTyCon )
import TysWiredIn ( stringTy )
maybeBoxedPrimType, maybeAppDataTyCon, splitRhoTy, eqTy
)
import TyVar ( GenTyVar, SYN_IE(GenTyVarSet), tyVarSetToList,
mkTyVarSet, unionTyVarSets, SYN_IE(TyVar) )
import TysPrim ( byteArrayPrimTyCon, mutableByteArrayPrimTyCon )
import TysWiredIn ( stringTy )
-import Unique ( Unique, cCallableClassKey, cReturnableClassKey )
-import UniqFM ( Uniquable(..) )
-import Util ( zipEqual, panic, pprPanic, pprTrace
+import Unique ( Unique, cCallableClassKey, cReturnableClassKey, Uniquable(..) )
+import Util ( zipEqual, panic, pprPanic, pprTrace, removeDups, Ord3(..),
#if __GLASGOW_HASKELL__ < 202
, trace
#endif
#if __GLASGOW_HASKELL__ < 202
, trace
#endif
= returnTc (inst_tycon,arg_tys)
-- TYVARS CHECK
= returnTc (inst_tycon,arg_tys)
-- TYVARS CHECK
- | not (all isTyVarTy arg_tys ||
- opt_GlasgowExts)
+ | not (opt_GlasgowExts ||
+ (all isTyVarTy arg_tys && null tyvar_dups)
+ )
= failTc (instTypeErr inst_tau)
-- DERIVING CHECK
= failTc (instTypeErr inst_tau)
-- DERIVING CHECK
(possible_tycon, arg_tys) = splitAppTys inst_tau
inst_tycon_maybe = getTyCon_maybe possible_tycon
inst_tycon = expectJust "tcInstDecls1:inst_tycon" inst_tycon_maybe
(possible_tycon, arg_tys) = splitAppTys inst_tau
inst_tycon_maybe = getTyCon_maybe possible_tycon
inst_tycon = expectJust "tcInstDecls1:inst_tycon" inst_tycon_maybe
+ (_, tyvar_dups) = removeDups cmp (map (getTyVar "tcInstDecls1:getTyVarTy") arg_tys)
-- These conditions come directly from what the DsCCall is capable of.
-- Totally grotesque. Green card should solve this.
-- These conditions come directly from what the DsCCall is capable of.
-- Totally grotesque. Green card should solve this.
instTypeErr ty sty
= case ty of
instTypeErr ty sty
= case ty of
- SynTy tc _ _ -> hcat [ptext SLIT("The type synonym `"), ppr sty tc, rest_of_msg]
- TyVarTy tv -> hcat [ptext SLIT("The type variable `"), ppr sty tv, rest_of_msg]
- other -> hcat [ptext SLIT("The type `"), ppr sty ty, rest_of_msg]
+ SynTy tc _ _ -> hsep [ptext SLIT("The type synonym"), ppr sty tc, rest_of_msg]
+ TyVarTy tv -> hsep [ptext SLIT("The type variable"), ppr sty tv, rest_of_msg]
+ other -> hsep [ptext SLIT("The type"), ppr sty ty, rest_of_msg]
- rest_of_msg = ptext SLIT("' cannot be used as an instance type.")
+ rest_of_msg = ptext SLIT("cannot be used as an instance type")
instBndrErr bndr clas sty
= hsep [ptext SLIT("Class"), ppr sty clas, ptext SLIT("does not have a method"), ppr sty bndr]
instBndrErr bndr clas sty
= hsep [ptext SLIT("Class"), ppr sty clas, ptext SLIT("does not have a method"), ppr sty bndr]
import TyCon ( TyCon )
import Name ( Name, OccName, isTvOcc, getOccName )
import TysWiredIn ( mkListTy, mkTupleTy )
import TyCon ( TyCon )
import Name ( Name, OccName, isTvOcc, getOccName )
import TysWiredIn ( mkListTy, mkTupleTy )
-import Unique ( Unique )
+import Unique ( Unique, Uniquable(..) )
-import UniqFM ( Uniquable(..) )
import Util ( zipWithEqual, zipLazy, panic{-, pprPanic ToDo:rm-} )
import Util ( zipWithEqual, zipLazy, panic{-, pprPanic ToDo:rm-} )
\begin{code}
tcPat (VarPatIn name)
\begin{code}
tcPat (VarPatIn name)
- = tcLookupLocalValueOK ("tcPat1:"{-++show (ppr PprDebug name)-}) name `thenNF_Tc` \ id ->
+ = tcLookupLocalValueOK "tcPat1:" name `thenNF_Tc` \ id ->
returnTc (VarPat (TcId id), emptyLIE, idType id)
tcPat (LazyPatIn pat)
returnTc (VarPat (TcId id), emptyLIE, idType id)
tcPat (LazyPatIn pat)
unionManyUniqSets, uniqSetToList )
import SrcLoc ( SrcLoc )
import TyCon ( TyCon, SYN_IE(Arity) )
unionManyUniqSets, uniqSetToList )
import SrcLoc ( SrcLoc )
import TyCon ( TyCon, SYN_IE(Arity) )
-import Unique ( Unique )
-import UniqFM ( Uniquable(..) )
+import Unique ( Unique, Uniquable(..) )
import Util ( panic{-, pprTrace-} )
\end{code}
import Util ( panic{-, pprTrace-} )
\end{code}
import Name ( changeUnique, Name, OccName, occNameString )
import Outputable
import Unique -- Keys for built-in classes
import Name ( changeUnique, Name, OccName, occNameString )
import Outputable
import Unique -- Keys for built-in classes
-import UniqFM ( Uniquable(..) )
import Pretty ( Doc, hsep, ptext )
import SrcLoc ( SrcLoc )
import Util
import Pretty ( Doc, hsep, ptext )
import SrcLoc ( SrcLoc )
import Util
ifPprShowAll, interpp'SP, Outputable(..) )
import PprEnv
import Pretty
ifPprShowAll, interpp'SP, Outputable(..) )
import PprEnv
import Pretty
-import UniqFM ( addToUFM_Directly, lookupUFM_Directly{-, ufmToList ToDo:rm-},
- Uniquable(..) )
-import Unique --TEMP: ( pprUnique10, pprUnique, incrUnique, listTyConKey )
+import UniqFM ( addToUFM_Directly, lookupUFM_Directly )
+import Unique ( Uniquable(..), pprUnique10, pprUnique, incrUnique, listTyConKey )
--LATER: specMaybeTysSuffix
)
#else
--LATER: specMaybeTysSuffix
)
#else
-import {-# SOURCE #-} Type ( Type )
+import {-# SOURCE #-} Type ( Type, splitSigmaTy, splitFunTy )
import {-# SOURCE #-} Class ( Class )
import {-# SOURCE #-} Id ( Id, isNullaryDataCon, idType )
import {-# SOURCE #-} Class ( Class )
import {-# SOURCE #-} Id ( Id, isNullaryDataCon, idType )
-import {-# SOURCE #-} Type ( splitSigmaTy, splitFunTy )
import {-# SOURCE #-} TysWiredIn ( tupleCon )
#endif
import {-# SOURCE #-} TysWiredIn ( tupleCon )
#endif
import Maybes
import Name ( Name, nameUnique, mkWiredInTyConName, NamedThing(getName) )
import Maybes
import Name ( Name, nameUnique, mkWiredInTyConName, NamedThing(getName) )
-import Unique ( Unique, funTyConKey )
-import UniqFM ( Uniquable(..) )
+import Unique ( Unique, funTyConKey, Uniquable(..) )
import Pretty ( Doc )
import PrimRep ( PrimRep(..) )
import PrelMods ( gHC__, pREL_TUP, pREL_BASE )
import Pretty ( Doc )
import PrimRep ( PrimRep(..) )
import PrelMods ( gHC__, pREL_TUP, pREL_BASE )
import Pretty ( Doc, (<>), ptext )
import Outputable ( PprStyle(..), Outputable(..) )
import SrcLoc ( noSrcLoc, SrcLoc )
import Pretty ( Doc, (<>), ptext )
import Outputable ( PprStyle(..), Outputable(..) )
import SrcLoc ( noSrcLoc, SrcLoc )
-import Unique ( showUnique, mkAlphaTyVarUnique, Unique )
-import UniqFM ( Uniquable(..) )
+import Unique ( showUnique, mkAlphaTyVarUnique, Unique, Uniquable(..) )
import Util ( panic, Ord3(..) )
\end{code}
import Util ( panic, Ord3(..) )
\end{code}
import Maybes ( maybeToBool, assocMaybe )
import PrimRep ( PrimRep(..) )
import Unique -- quite a few *Keys
import Maybes ( maybeToBool, assocMaybe )
import PrimRep ( PrimRep(..) )
import Unique -- quite a few *Keys
-import UniqFM ( Uniquable(..) )
import Util ( thenCmp, zipEqual, assoc,
panic, panic#, assertPanic, pprPanic,
Ord3(..){-instances-}
import Util ( thenCmp, zipEqual, assoc,
panic, panic#, assertPanic, pprPanic,
Ord3(..){-instances-}
import IOHandle
import ST
import STBase
import IOHandle
import ST
import STBase
-import {-# SOURCE #-} Unique ( mkUniqueGrimily, Unique )
-import {-# SOURCE #-} UniqFM ( Uniquable(..) )
+import {-# SOURCE #-} Unique ( mkUniqueGrimily, Unique, Uniquable(..) )
#if __GLASGOW_HASKELL__ == 202
import PrelBase ( Char (..) )
#endif
#if __GLASGOW_HASKELL__ == 202
import PrelBase ( Char (..) )
#endif
hsep = foldr (<+>) empty
vcat = foldr ($$) empty
hsep = foldr (<+>) empty
vcat = foldr ($$) empty
-hang d1 n d2 = d1 $$ (nest n d2)
+hang d1 n d2 = sep [d1, nest n d2]
punctuate p [] = []
punctuate p (d:ds) = go d ds
punctuate p [] = []
punctuate p (d:ds) = go d ds
\begin{code}
interface Ubiq where
\begin{code}
interface Ubiq where
---import PreludePS(_PackedString)
import FastString(FastString)
import BasicTypes ( Module(..), Arity(..) )
import FastString(FastString)
import BasicTypes ( Module(..), Arity(..) )
module UniqFM (
UniqFM, -- abstract type
module UniqFM (
UniqFM, -- abstract type
- Uniquable(..), -- class to go with it
-import Unique ( Unique, u2i, mkUniqueGrimily )
+import Unique ( Uniquable(..), Unique, u2i, mkUniqueGrimily )
import Util
import Pretty ( Doc )
import Outputable ( PprStyle, Outputable(..) )
import Util
import Pretty ( Doc )
import Outputable ( PprStyle, Outputable(..) )
(UniqFM ele)
(UniqFM ele)
(UniqFM ele)
(UniqFM ele)
-class Uniquable a where
- uniqueOf :: a -> Unique
-
-- for debugging only :-)
{-
instance Text (UniqFM a) where
-- for debugging only :-)
{-
instance Text (UniqFM a) where
import Maybes ( maybeToBool )
import UniqFM
import Maybes ( maybeToBool )
import UniqFM
-import Unique ( Unique )
+import Unique ( Unique, Uniquable(..) )
import SrcLoc ( SrcLoc )
import Outputable ( PprStyle, Outputable(..) )
import Pretty ( Doc )
import SrcLoc ( SrcLoc )
import Outputable ( PprStyle, Outputable(..) )
import Pretty ( Doc )