X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Futils%2FLazyUniqFM.lhs;h=97451b0eea6afdc265408acde125e6adb12bf17f;hb=c74c72f60dcc4cbea519826e98ec90ad8016b49d;hp=b7ac15d2a18a736080dcb40a7805c55a6495678e;hpb=727fae32ea0b6ca6ebdf1b3137649813e4d7ac3d;p=ghc-hetmet.git diff --git a/compiler/utils/LazyUniqFM.lhs b/compiler/utils/LazyUniqFM.lhs index b7ac15d..97451b0 100644 --- a/compiler/utils/LazyUniqFM.lhs +++ b/compiler/utils/LazyUniqFM.lhs @@ -11,12 +11,11 @@ Basically, the things need to be in class @Uniquable@, and we use the @getUnique@ method to grab their @Uniques@. \begin{code} -{-# OPTIONS -Wall -fno-warn-name-shadowing -Werror -fallow-undecidable-instances #-} module LazyUniqFM ( - UniqFM(..), -- abstract type - -- XXX Not actually abstract because of nativeGen/MachRegs; sigh - Lazy(Lazy), -- XXX Also for nativeGen/MachRegs; sigh + -- * Lazy unique-keyed mappings + UniqFM, -- abstract type + -- ** Manipulating those mappings emptyUFM, unitUFM, unitDirectlyUFM, @@ -179,9 +178,10 @@ ufmToList :: UniqFM elt -> [(Unique, elt)] \begin{code} data Lazy a = Lazy { fromLazy :: a } +-- | @UniqFM a@ is a mapping from Unique to @a@ where the element @a@ is evaluated lazily. newtype UniqFM ele = MkUniqFM (S.UniqFM (Lazy ele)) -instance Outputable (S.UniqFM (Lazy a)) => Outputable (UniqFM a) where +instance Outputable a => Outputable (UniqFM a) where ppr (MkUniqFM fm) = ppr fm instance Outputable a => Outputable (Lazy a) where