[Git][ghc/ghc][wip/simply-bind-tyvars] Use "rewrite rule" instead of "transformation rule" consistently
Ryan Scott
gitlab at gitlab.haskell.org
Sun May 31 15:24:34 UTC 2020
Ryan Scott pushed to branch wip/simply-bind-tyvars at Glasgow Haskell Compiler / GHC
Commits:
0e30ccaf by Ryan Scott at 2020-05-31T11:22:31-04:00
Use "rewrite rule" instead of "transformation rule" consistently
- - - - -
15 changed files:
- compiler/GHC/Core.hs
- compiler/GHC/Core/Lint.hs
- compiler/GHC/Core/Opt/Simplify.hs
- compiler/GHC/Core/Rules.hs
- compiler/GHC/Driver/Types.hs
- compiler/GHC/Hs/Decls.hs
- compiler/GHC/HsToCore.hs
- compiler/GHC/Rename/Module.hs
- compiler/GHC/Rename/Utils.hs
- compiler/GHC/Tc/Gen/Rule.hs
- testsuite/tests/dependent/should_fail/T16326_Fail10.stderr
- testsuite/tests/rename/should_compile/ExplicitForAllRules1.stderr
- testsuite/tests/safeHaskell/ghci/p14.stderr
- testsuite/tests/typecheck/should_compile/T10072.stderr
- testsuite/tests/typecheck/should_fail/T5853.stderr
Changes:
=====================================
compiler/GHC/Core.hs
=====================================
@@ -1291,7 +1291,7 @@ Orphan-hood is computed
{-
************************************************************************
* *
-\subsection{Transformation rules}
+\subsection{Rewrite rules}
* *
************************************************************************
=====================================
compiler/GHC/Core/Lint.hs
=====================================
@@ -467,7 +467,7 @@ lintCoreBindings dflags pass local_in_scope binds
where
all_pairs = flattenBinds binds
-- Put all the top-level binders in scope at the start
- -- This is because transformation rules can bring something
+ -- This is because rewrite rules can bring something
-- into use 'unexpectedly'; see Note [Glomming] in OccurAnal
binders = map fst all_pairs
=====================================
compiler/GHC/Core/Opt/Simplify.hs
=====================================
@@ -170,7 +170,7 @@ simplTopBinds :: SimplEnv -> [InBind] -> SimplM (SimplFloats, SimplEnv)
-- See Note [The big picture]
simplTopBinds env0 binds0
= do { -- Put all the top-level binders into scope at the start
- -- so that if a transformation rule has unexpectedly brought
+ -- so that if a rewrite rule has unexpectedly brought
-- anything into scope, then we don't get a complaint about that.
-- It's rather as if the top-level binders were imported.
-- See note [Glomming] in OccurAnal.
=====================================
compiler/GHC/Core/Rules.hs
=====================================
@@ -1,7 +1,7 @@
{-
(c) The GRASP/AQUA Project, Glasgow University, 1992-1998
-\section[CoreRules]{Transformation rules}
+\section[CoreRules]{Rewrite rules}
-}
{-# LANGUAGE CPP #-}
=====================================
compiler/GHC/Driver/Types.hs
=====================================
@@ -2486,7 +2486,7 @@ lookupFixity env n = case lookupNameEnv env n of
-- * An instance declaration in a module other than the definition
-- module for one of the type constructors or classes in the instance head
--
--- * A transformation rule in a module other than the one defining
+-- * A rewrite rule in a module other than the one defining
-- the function in the head of the rule
--
type WhetherHasOrphans = Bool
=====================================
compiler/GHC/Hs/Decls.hs
=====================================
@@ -2184,7 +2184,7 @@ instance Outputable ForeignExport where
{-
************************************************************************
* *
-\subsection{Transformation rules}
+\subsection{Rewrite rules}
* *
************************************************************************
-}
=====================================
compiler/GHC/HsToCore.hs
=====================================
@@ -354,7 +354,7 @@ to the binders in the top-level bindings
Reason
- It makes the rules easier to look up
- - It means that transformation rules and specialisations for
+ - It means that rewrite rules and specialisations for
locally defined Ids are handled uniformly
- It keeps alive things that are referred to only from a rule
(the occurrence analyser knows about rules attached to Ids)
@@ -368,7 +368,7 @@ Reason
************************************************************************
* *
-* Desugaring transformation rules
+* Desugaring rewrite rules
* *
************************************************************************
-}
=====================================
compiler/GHC/Rename/Module.hs
=====================================
@@ -1068,7 +1068,7 @@ bindRuleTyVars _ _ thing_inside = thing_inside Nothing
{-
Note [Rule LHS validity checking]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-Check the shape of a transformation rule LHS. Currently we only allow
+Check the shape of a rewrite rule LHS. Currently we only allow
LHSs of the form @(f e1 .. en)@, where @f@ is not one of the
@forall@'d variables.
=====================================
compiler/GHC/Rename/Utils.hs
=====================================
@@ -495,7 +495,7 @@ pprHsDocContext PatCtx = text "a pattern type-signature"
pprHsDocContext SpecInstSigCtx = text "a SPECIALISE instance pragma"
pprHsDocContext DefaultDeclCtx = text "a `default' declaration"
pprHsDocContext DerivDeclCtx = text "a deriving declaration"
-pprHsDocContext (RuleCtx name) = text "the transformation rule" <+> ftext name
+pprHsDocContext (RuleCtx name) = text "the rewrite rule" <+> doubleQuotes (ftext name)
pprHsDocContext (TyDataCtx tycon) = text "the data type declaration for" <+> quotes (ppr tycon)
pprHsDocContext (FamPatCtx tycon) = text "a type pattern of family instance for" <+> quotes (ppr tycon)
pprHsDocContext (TySynCtx name) = text "the declaration for type synonym" <+> quotes (ppr name)
=====================================
compiler/GHC/Tc/Gen/Rule.hs
=====================================
@@ -7,7 +7,7 @@
{-# LANGUAGE ViewPatterns #-}
{-# LANGUAGE TypeFamilies #-}
--- | Typechecking transformation rules
+-- | Typechecking rewrite rules
module GHC.Tc.Gen.Rule ( tcRules ) where
import GHC.Prelude
@@ -239,7 +239,7 @@ tcRuleTmBndrs (L _ (RuleBndrSig _ (L _ name) rn_ty) : rule_bndrs)
; return (map snd tvs ++ tyvars, id : tmvars) }
ruleCtxt :: FastString -> SDoc
-ruleCtxt name = text "When checking the transformation rule" <+>
+ruleCtxt name = text "When checking the rewrite rule" <+>
doubleQuotes (ftext name)
=====================================
testsuite/tests/dependent/should_fail/T16326_Fail10.stderr
=====================================
@@ -4,4 +4,4 @@ T16326_Fail10.hs:12:18: error:
forall a -> a -> a
(GHC does not yet support this)
• In a RULE for ‘x’: forall a -> a -> a
- When checking the transformation rule "flurmp"
+ When checking the rewrite rule "flurmp"
=====================================
testsuite/tests/rename/should_compile/ExplicitForAllRules1.stderr
=====================================
@@ -1,4 +1,4 @@
ExplicitForAllRules1.hs:49:31: warning: [-Wunused-foralls (in -Wextra)]
Unused quantified type variable ‘b’
- In the transformation rule example7
+ In the rewrite rule "example7"
=====================================
testsuite/tests/safeHaskell/ghci/p14.stderr
=====================================
@@ -1,6 +1,6 @@
<interactive>:9:25: error:
- No instance for (Num a) arising from a use of ‘f’
- Possible fix: add (Num a) to the context of the RULE "id/Int"
- In the expression: f
- When checking the transformation rule "id/Int"
+ • No instance for (Num a) arising from a use of ‘f’
+ Possible fix: add (Num a) to the context of the RULE "id/Int"
+ • In the expression: f
+ When checking the rewrite rule "id/Int"
=====================================
testsuite/tests/typecheck/should_compile/T10072.stderr
=====================================
@@ -7,4 +7,4 @@ T10072.hs:3:31: error:
To use the inferred type, enable PartialTypeSignatures
• In the type ‘a -> _’
In a RULE for ‘f’: a -> _
- When checking the transformation rule "map/empty"
+ When checking the rewrite rule "map/empty"
=====================================
testsuite/tests/typecheck/should_fail/T5853.stderr
=====================================
@@ -9,7 +9,7 @@ T5853.hs:15:52: error:
bound by the RULE "map/map" at T5853.hs:15:2-57
NB: ‘Subst’ is a non-injective type family
• In the expression: (f . g) <$> xs
- When checking the transformation rule "map/map"
+ When checking the rewrite rule "map/map"
• Relevant bindings include
f :: Elem fa -> b (bound at T5853.hs:15:19)
g :: a -> Elem fa (bound at T5853.hs:15:21)
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/0e30ccaf1babce0ac7797252a004820ea95c803c
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/0e30ccaf1babce0ac7797252a004820ea95c803c
You're receiving this email because of your account on gitlab.haskell.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20200531/dcc46ad1/attachment-0001.html>
More information about the ghc-commits
mailing list