[Git][ghc/ghc][master] 3 commits: Fix typos and formatting in user guide

Marge Bot gitlab at gitlab.haskell.org
Wed Jun 17 19:30:42 UTC 2020



 Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC


Commits:
d0dcbfe6 by Jan Hrček at 2020-06-16T20:36:38+02:00
Fix typos and formatting in user guide

- - - - -
56a9e95f by Jan Hrček at 2020-06-16T20:36:38+02:00
Resolve TODO

- - - - -
3e884d14 by Jan Hrček at 2020-06-16T20:36:38+02:00
Rename TcHoleErrors to GHC.Tc.Errors.Hole

- - - - -


15 changed files:

- docs/users_guide/8.12.1-notes.rst
- docs/users_guide/extending_ghc.rst
- docs/users_guide/exts/constrained_class_methods.rst
- docs/users_guide/exts/flexible_contexts.rst
- docs/users_guide/exts/hex_float_literals.rst
- docs/users_guide/exts/instances.rst
- docs/users_guide/exts/nullary_type_classes.rst
- docs/users_guide/exts/primitives.rst
- docs/users_guide/exts/rank_polymorphism.rst
- docs/users_guide/exts/record_wildcards.rst
- docs/users_guide/exts/type_families.rst
- docs/users_guide/exts/undecidable_super_classes.rst
- docs/users_guide/profiling.rst
- docs/users_guide/win32-dlls.rst
- libraries/base/GHC/OverloadedLabels.hs


Changes:

=====================================
docs/users_guide/8.12.1-notes.rst
=====================================
@@ -40,7 +40,7 @@ Language
 
 * Record field selectors are now given type signatures that preserve the
   user-written order of quantified type variables. Moreover, field selector
-  type signatures no longer make inferred type variables avaiable for explicit
+  type signatures no longer make inferred type variables available for explicit
   type application. See :ref:`field-selectors-and-type-applications` for more
   details.
 
@@ -103,7 +103,7 @@ Language
   <https://gitlab.haskell.org/ghc/ghc/issues/18126>`_.
 
 * GHC now implements simplified subsumption, as described in `GHC Proposal #287 <https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0287-simplify-subsumption.rst>`__.
-  This change simplifies the type system, and prevents the possiblity of GHC
+  This change simplifies the type system, and prevents the possibility of GHC
   silently changing the semantics of user programs, but it does mean that some libraries
   may need eta-expansion to typecheck.  More info here: :ref:`simple-subsumption`.
 


=====================================
docs/users_guide/extending_ghc.rst
=====================================
@@ -936,8 +936,8 @@ at error generation.
     hfPlugin :: [CommandLineOption] -> Maybe HoleFitPlugin
 
 
-Where ``fromPureHFPlugin :: HoleFitPlugin -> HoleFitPluginR`` is a convencience
-function provided in the ``TcHoleErrors`` module, for defining plugins that do
+Where ``fromPureHFPlugin :: HoleFitPlugin -> HoleFitPluginR`` is a convenience
+function provided in the ``GHC.Tc.Errors.Hole`` module, for defining plugins that do
 not require internal state.
 
 
@@ -986,7 +986,7 @@ spent on searching for valid hole fits, after which new searches are aborted.
 
     import GHC.Plugins hiding ((<>))
 
-    import TcHoleErrors
+    import GHC.Tc.Errors.Hole
 
     import Data.List (stripPrefix, sortOn)
 


=====================================
docs/users_guide/exts/constrained_class_methods.rst
=====================================
@@ -19,8 +19,7 @@ class type variable, thus: ::
 
 The type of ``elem`` is illegal in Haskell 98, because it contains the
 constraint ``Eq a``, which constrains only the class type variable (in
-this case ``a``).
-this case ``a``).  More precisely, a constraint in a class method signature is rejected if
+this case ``a``). More precisely, a constraint in a class method signature is rejected if
 
 - The constraint mentions at least one type variable.  So this is allowed: ::
 


=====================================
docs/users_guide/exts/flexible_contexts.rst
=====================================
@@ -39,7 +39,7 @@ superclass of ``C``.)
 With the extension that adds a :ref:`kind of
 constraints <constraint-kind>`, you can write more exotic superclass
 definitions. The superclass cycle check is even more liberal in these
-case. For example, this is OK: ::
+cases. For example, this is OK: ::
 
       class A cls c where
         meth :: cls c => c -> c


=====================================
docs/users_guide/exts/hex_float_literals.rst
=====================================
@@ -21,6 +21,7 @@ powers of 16, while the ones to the right correspond to negative ones.
 
 You may also write an explicit exponent, which is similar to the exponent
 in decimal notation with the following differences:
+
 - the exponent begins with ``p`` instead of ``e``
 - the exponent is written in base ``10`` (**not** 16)
 - the base of the exponent is ``2`` (**not** 16).


=====================================
docs/users_guide/exts/instances.rst
=====================================
@@ -6,7 +6,7 @@ Instance declarations and resolution
 
 An instance declaration has the form ::
 
-      instance ( assertion1, ..., assertionn) => class type1 ... typem where ...
+      instance (assertion1, ..., assertionn) => class type1 ... typem where ...
 
 The part before the "``=>``" is the *context*, while the part after the
 "``=>``" is the *head* of the instance declaration.
@@ -74,7 +74,7 @@ GHC relaxes this rule in two ways:
    writing the RHS of the type synonym definition. For example: ::
 
          type Point a = (a,a)
-         instance C (Point a)   where ...
+         instance C (Point a) where ...
 
    is legal. The instance declaration is equivalent to ::
 
@@ -382,7 +382,7 @@ like this:
    target constraint is a substitution instance of :math:`I`. These instance
    declarations are the *candidates*.
 
--  If no candidates remain, the search failes
+-  If no candidates remain, the search fails
 
 -  Eliminate any candidate :math:`IX` for which there is another candidate
    :math:`IY` such that both of the following hold:
@@ -450,7 +450,7 @@ former is a substitution instance of the latter. For example (D) is
 "more specific" than (C) because you can get from (C) to (D) by
 substituting ``a := Int``.
 
-The final bullet (about unifiying instances)
+The final bullet (about unifying instances)
 makes GHC conservative about committing to an
 overlapping instance. For example: ::
 


=====================================
docs/users_guide/exts/nullary_type_classes.rst
=====================================
@@ -9,7 +9,7 @@ Nullary type classes
 
     :since: 7.8.1
 
-    Allows the use definition of type classes with no parameters. This extension
+    Allow use and definition of type classes with no parameters. This extension
     has been replaced by :extension:`MultiParamTypeClasses`.
 
 


=====================================
docs/users_guide/exts/primitives.rst
=====================================
@@ -70,7 +70,7 @@ Unboxed type kinds
 ------------------
 
 Because unboxed types are represented without the use of pointers, we
-cannot store them in use a polymorphic datatype at an unboxed type.
+cannot store them in a polymorphic datatype.
 For example, the ``Just`` node
 of ``Just 42#`` would have to be different from the ``Just`` node of
 ``Just 42``; the former stores an integer directly, while the latter
@@ -90,7 +90,7 @@ point. In contrast, the kind ``Type`` is actually just a synonym for ``TYPE
 'LiftedRep``. More details of the ``TYPE`` mechanisms appear in the `section
 on runtime representation polymorphism <#runtime-rep>`__.
 
-Given that ``Int#``'s kind is not ``Type``, it then it follows that ``Maybe
+Given that ``Int#``'s kind is not ``Type``, then it follows that ``Maybe
 Int#`` is disallowed. Similarly, because type variables tend to be of kind
 ``Type`` (for example, in ``(.) :: (b -> c) -> (a -> b) -> a -> c``, all the
 type variables have kind ``Type``), polymorphism tends not to work over
@@ -315,7 +315,7 @@ of a `newtype`. For example, the type ::
 is accepted when this extension is enabled. This creates a type
 ``A :: TYPE 'IntRep`` and a data constructor ``MkA :: Int# -> A``.
 Although the kind of ``A`` is inferred by GHC, there is nothing visually
-distictive about this type that indicated that is it not of kind ``Type``
+distinctive about this type that indicated that is it not of kind ``Type``
 like newtypes typically are. `GADTSyntax <#gadt-style>`__ can be used to
 provide a kind signature for additional clarity ::
 


=====================================
docs/users_guide/exts/rank_polymorphism.rst
=====================================
@@ -187,10 +187,10 @@ For example: ::
   f4 :: (Int -> forall a. (Eq a, Show a) => a -> a) -> Bool
   g4 ::  Int -> forall x. (Show x, Eq x) => x -> x) -> Bool
 
-Then the application ``f3 g3a`` is well-typed, becuase ``g3a`` has a type that matches the type
+Then the application ``f3 g3a`` is well-typed, because ``g3a`` has a type that matches the type
 expected by ``f3``.  But ``f3 g3b`` is not well typed, because the foralls are in different places.
 Nor is ``f3 g3c``, where the foralls are in the same place but the variables are in a different order.
-Similarly ``f4 g4`` is not well typed, becuase the constraints appear in a different order.
+Similarly ``f4 g4`` is not well typed, because the constraints appear in a different order.
 
 These examples can be made to typecheck by eta-expansion. For example ``f3 (\x -> g3b x)``
 is well typed, and similarly ``f3 (\x -> g3c x)`` and ``f4 (\x -> g4 x)``.


=====================================
docs/users_guide/exts/record_wildcards.rst
=====================================
@@ -13,7 +13,7 @@ Record wildcards
     Allow the use of wildcards in record construction and pattern matching.
 
 Record wildcards are enabled by the language extension :extension:`RecordWildCards`. This
-exension implies :extension:`DisambiguateRecordFields`.
+extension implies :extension:`DisambiguateRecordFields`.
 
 For records with many fields, it can be tiresome to write out each field
 individually in a record pattern, as in ::


=====================================
docs/users_guide/exts/type_families.rst
=====================================
@@ -157,7 +157,7 @@ the left hand side can be explicitly bound. For example: ::
     data instance forall a (b :: Proxy a). F (Proxy b) = FProxy Bool
 
 When an explicit ``forall`` is present, *all* type and kind variables mentioned
-which are not already in scope must be bound by the ``forall``:
+which are not already in scope must be bound by the ``forall``: ::
 
     data instance forall   (a :: k). F a = FOtherwise  -- rejected: k not in scope
     data instance forall k (a :: k). F a = FOtherwise  -- accepted
@@ -368,7 +368,7 @@ as for :ref:`data-instance-declarations`.
 
 Also in the same way as :ref:`data-instance-declarations`, when
 :extension:`ExplicitForAll` is enabled, type and kind variables can be
-explicilty bound in a type instance declaration.
+explicitly bound in a type instance declaration.
 
 Type family instance declarations are only legitimate when an
 appropriate family declaration is in scope - just like class instances
@@ -550,7 +550,7 @@ Decidability of type synonym instances
     Relax restrictions on the decidability of type synonym family instances.
 
 In order to guarantee that type inference in the presence of type
-families decidable, we need to place a number of additional restrictions
+families is decidable, we need to place a number of additional restrictions
 on the formation of type instance declarations (c.f., Definition 5
 (Relaxed Conditions) of “\ `Type Checking with Open Type
 Functions <http://www.cse.unsw.edu.au/~chak/papers/SPCS08.html>`__\ ”).
@@ -660,8 +660,8 @@ keyword in the family instance: ::
       ...
 
 The data or type family instance for an associated type must follow
-the rule that the type indexes corresponding to class parameters must have
-precisely the same as type given in the instance head. For example: ::
+the rule that the type indexes corresponding to class parameters must be
+precisely the same as types given in the instance head. For example: ::
 
     class Collects ce where
       type Elem ce :: Type
@@ -786,49 +786,49 @@ Here are some examples:
 
         type F3 a
         type F3 [b] = b              -- BAD; only type variables allowed on the
-                                             LHS, and the argument to F3 is
-                                             instantiated to [b], which is not
-                                             a bare type variable
+                                     --      LHS, and the argument to F3 is
+                                     --      instantiated to [b], which is not
+                                     --      a bare type variable
 
         type F4 x y
         type F4 x x = x              -- BAD; the type variable x is repeated on
-                                             the LHS
+                                     --      the LHS
 
         type F5 a
         type F5 b = a                -- BAD; 'a' is not in scope  in the RHS
 
         type F6 a :: [k]
         type F6 a = ('[] :: [x])     -- OK; the kind variable x is implicitly
-                                            bound by an invisible kind pattern
-                                            on the LHS
+                                     --     bound by an invisible kind pattern
+                                     --     on the LHS
 
         type F7 a
         type F7 a =
           Proxy ('[] :: [x])         -- BAD; the kind variable x is not bound,
-                                             even by an invisible kind pattern
+                                     --      even by an invisible kind pattern
 
         type F8 (x :: a) :: [a]
         type F8 x = ('[] :: [a])     -- OK; the kind variable a is implicitly
-                                            bound by the kind signature of the
-                                            LHS type pattern
+                                     --     bound by the kind signature of the
+                                     --     LHS type pattern
 
         type F9 (a :: k)
         type F9 a = Maybe a          -- BAD; the kind variable k is
-                                             instantiated to Type, which is not
-                                             a bare kind variable
+                                     --      instantiated to Type, which is not
+                                     --      a bare kind variable
 
         type F10 (a :: j) (b :: k)
         type F10 (a :: z) (b :: z)
           = Proxy a                  -- BAD; the kind variable z is repeated,
-                                     -- as both j and k are instantiated to z
+                                     --      as both j and k are instantiated to z
 
         type F11 a b
         type forall a b. F11 a b = a -- OK; LHS type variables can be
-                                        explicitly bound with 'forall'
+                                     --     explicitly bound with 'forall'
 
         type F12 (a :: k)
         type F12 @k a = Proxy a      -- OK; visible kind application syntax is
-                                            permitted in default declarations
+                                     --     permitted in default declarations
 
 .. _scoping-class-params:
 
@@ -900,7 +900,7 @@ Import and export
 -----------------
 
 The rules for export lists (Haskell Report `Section
-5.2 <http://www.haskell.org/onlinereport/modules.html#sect5.2>`__) needs
+5.2 <http://www.haskell.org/onlinereport/modules.html#sect5.2>`__) need
 adjustment for type families:
 
 -  The form ``T(..)``, where ``T`` is a data family, names the family


=====================================
docs/users_guide/exts/undecidable_super_classes.rst
=====================================
@@ -39,7 +39,7 @@ thence ``C Id`` again.
 But superclass constraints like these are sometimes useful, and the conservative
 check is annoying where no actual recursion is involved.
 
-Moreover genuninely-recursive superclasses are sometimes useful. Here's a real-life
+Moreover genuinely-recursive superclasses are sometimes useful. Here's a real-life
 example (#10318) ::
 
      class (Frac (Frac a) ~ Frac a,


=====================================
docs/users_guide/profiling.rst
=====================================
@@ -1634,7 +1634,7 @@ Because ticky-ticky profiling requires a certain familiarity with GHC
 internals, we have moved the documentation to the GHC developers wiki.
 Take a look at its
 :ghc-wiki:`overview of the profiling options <commentary/profiling>`,
-which includeds a link to the ticky-ticky profiling page.
+which includes a link to the ticky-ticky profiling page.
 
 .. [1]
    :ghc-flag:`-fprof-auto` was known as ``-auto-all`` prior to


=====================================
docs/users_guide/win32-dlls.rst
=====================================
@@ -132,7 +132,7 @@ your paths:
   - replace ``\`` with ``\\``
   - expand relative paths to absolute paths
 
-If you want to opt out of all preprocessing just expliticly use namespaces in
+If you want to opt out of all preprocessing just explicitly use namespaces in
 your paths. Due to this change, if you need to open raw devices (e.g. COM ports)
 you need to use the device namespace explicitly. (e.g. ``\\.\COM1``). GHC and
 Haskell programs in general no longer support opening devices in the legacy


=====================================
libraries/base/GHC/OverloadedLabels.hs
=====================================
@@ -17,7 +17,7 @@
 -- Stability   :  internal
 -- Portability :  non-portable (GHC extensions)
 --
--- This module defines the 'IsLabel' class is used by the
+-- This module defines the 'IsLabel' class used by the
 -- @OverloadedLabels@ extension.  See the
 -- <https://gitlab.haskell.org/ghc/ghc/wikis/records/overloaded-record-fields/overloaded-labels wiki page>
 -- for more details.



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/cf01477f03da13caaf78caacc5b001cb46a86685...3e884d14102948ad49d75611da247beff25911a4

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/cf01477f03da13caaf78caacc5b001cb46a86685...3e884d14102948ad49d75611da247beff25911a4
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/20200617/d131925e/attachment-0001.html>


More information about the ghc-commits mailing list