X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2FbasicTypes%2FBasicTypes.lhs;h=8fcf5ca77725bb6f72154964c62eb8be229e6d4d;hp=9d5b481285084ba30108505a6bdfcf375e1ca650;hb=6084fb5517da34f65034370a3695e2af3b85ce2b;hpb=4f8f7ea99adce81a9545d080ad519392c4a0450d diff --git a/compiler/basicTypes/BasicTypes.lhs b/compiler/basicTypes/BasicTypes.lhs index 9d5b481..8fcf5ca 100644 --- a/compiler/basicTypes/BasicTypes.lhs +++ b/compiler/basicTypes/BasicTypes.lhs @@ -19,7 +19,7 @@ module BasicTypes( Arity, - DeprecTxt, + WarningTxt(..), Fixity(..), FixityDirection(..), defaultFixity, maxPrecedence, @@ -30,6 +30,8 @@ module BasicTypes( RecFlag(..), isRec, isNonRec, boolToRecFlag, + RuleName, + TopLevelFlag(..), isTopLevel, isNotTopLevel, OverlapFlag(..), @@ -95,7 +97,14 @@ initialVersion = 1 \begin{code} -type DeprecTxt = FastString -- reason/explanation for deprecation +-- reason/explanation from a WARNING or DEPRECATED pragma +data WarningTxt = WarningTxt FastString + | DeprecatedTxt FastString + deriving Eq + +instance Outputable WarningTxt where + ppr (WarningTxt w) = doubleQuotes (ftext w) + ppr (DeprecatedTxt d) = text "Deprecated:" <+> doubleQuotes (ftext d) \end{code} %************************************************************************ @@ -122,6 +131,15 @@ instance Outputable name => Outputable (IPName name) where ppr (IPName n) = char '?' <> ppr n -- Ordinary implicit parameters \end{code} +%************************************************************************ +%* * + Rules +%* * +%************************************************************************ + +\begin{code} +type RuleName = FastString +\end{code} %************************************************************************ %* * @@ -365,17 +383,20 @@ the base of the module hierarchy. So it seemed simpler to put the defn of OccInfo here, safely at the bottom \begin{code} +-- | Identifier occurrence information data OccInfo - = NoOccInfo -- Many occurrences, or unknown + = NoOccInfo -- ^ There are many occurrences, or unknown occurences - | IAmDead -- Marks unused variables. Sometimes useful for + | IAmDead -- ^ Marks unused variables. Sometimes useful for -- lambda and case-bound variables. - | OneOcc -- Occurs exactly once, not inside a rule + | OneOcc !InsideLam !OneBranch - !InterestingCxt + !InterestingCxt -- ^ Occurs exactly once, not inside a rule + -- | This identifier breaks a loop of mutually recursive functions. The field + -- marks whether it is only a loop breaker due to a reference in a rule | IAmALoopBreaker -- Note [LoopBreaker OccInfo] !RulesOnly -- True <=> This is a weak or rules-only loop breaker -- See OccurAnal Note [Weak loop breakers]