[Git][ghc/ghc][wip/marge_bot_batch_merge_job] 10 commits: Use foldl' in unionManyUniqDSets

Marge Bot gitlab at gitlab.haskell.org
Wed Jun 17 13:32:01 UTC 2020



 Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC


Commits:
9a9cc089 by Simon Jakobi at 2020-06-15T13:10:00-04:00
Use foldl' in unionManyUniqDSets

- - - - -
761dcb84 by Moritz Angermann at 2020-06-15T13:10:36-04:00
Load .lo as well.

Some archives contain so called linker objects, with the affectionate
.lo suffic.  For example the musl libc.a will come in that form.  We
still want to load those objects, hence we should not discard them and
look for .lo as well.  Ultimately we might want to fix this proerly by
looking at the file magic.

- - - - -
cf01477f by Vladislav Zavialov at 2020-06-15T13:11:20-04:00
User's Guide: KnownNat evidence is Natural

This bit of documentation got outdated after commit
1fcede43d2b30f33b7505e25eb6b1f321be0407f

- - - - -
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

- - - - -
f5553226 by Stefan Schulze Frielinghaus at 2020-06-17T09:29:59-04:00
hadrian: Build with threaded runtime if available

See #16873.

- - - - -
2a5fee96 by Sylvain Henry at 2020-06-17T09:30:03-04:00
T16190: only measure bytes_allocated

Just adding `{-# LANGUAGE BangPatterns #-}` makes the two other metrics
fluctuate by 13%.

- - - - -
ee5ce3f7 by Adam Sandberg Ericsson at 2020-06-17T09:30:18-04:00
docs: fix formatting in users guide

- - - - -
05df6359 by Sylvain Henry at 2020-06-17T09:30:20-04:00
Move CLabel assertions into smart constructors (#17957)

It avoids using DynFlags in the Outputable instance of Clabel to check
assertions at pretty-printing time.

- - - - -


26 changed files:

- compiler/GHC/Cmm/CLabel.hs
- compiler/GHC/StgToCmm/Closure.hs
- compiler/GHC/Tc/Instance/Class.hs
- compiler/GHC/Types/Unique/DSet.hs
- 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/explicit_forall.rst
- docs/users_guide/exts/flexible_contexts.rst
- docs/users_guide/exts/gadt_syntax.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/type_literals.rst
- docs/users_guide/exts/undecidable_super_classes.rst
- docs/users_guide/profiling.rst
- docs/users_guide/using-warnings.rst
- docs/users_guide/win32-dlls.rst
- hadrian/build-cabal
- libraries/base/GHC/OverloadedLabels.hs
- rts/linker/LoadArchive.c
- testsuite/tests/perf/compiler/all.T


Changes:

=====================================
compiler/GHC/Cmm/CLabel.hs
=====================================
@@ -567,17 +567,27 @@ mkLocalBlockLabel u = LocalBlockLabel u
 
 -- Constructing RtsLabels
 mkRtsPrimOpLabel :: PrimOp -> CLabel
-mkRtsPrimOpLabel primop         = RtsLabel (RtsPrimOp primop)
+mkRtsPrimOpLabel primop = RtsLabel (RtsPrimOp primop)
 
-mkSelectorInfoLabel  :: Bool -> Int -> CLabel
-mkSelectorEntryLabel :: Bool -> Int -> CLabel
-mkSelectorInfoLabel  upd off    = RtsLabel (RtsSelectorInfoTable upd off)
-mkSelectorEntryLabel upd off    = RtsLabel (RtsSelectorEntry     upd off)
+mkSelectorInfoLabel :: DynFlags -> Bool -> Int -> CLabel
+mkSelectorInfoLabel dflags upd offset =
+   ASSERT(offset >= 0 && offset <= mAX_SPEC_SELECTEE_SIZE dflags)
+   RtsLabel (RtsSelectorInfoTable upd offset)
 
-mkApInfoTableLabel :: Bool -> Int -> CLabel
-mkApEntryLabel     :: Bool -> Int -> CLabel
-mkApInfoTableLabel   upd off    = RtsLabel (RtsApInfoTable       upd off)
-mkApEntryLabel       upd off    = RtsLabel (RtsApEntry           upd off)
+mkSelectorEntryLabel :: DynFlags -> Bool -> Int -> CLabel
+mkSelectorEntryLabel dflags upd offset =
+   ASSERT(offset >= 0 && offset <= mAX_SPEC_SELECTEE_SIZE dflags)
+   RtsLabel (RtsSelectorEntry upd offset)
+
+mkApInfoTableLabel :: DynFlags -> Bool -> Int -> CLabel
+mkApInfoTableLabel dflags upd arity =
+   ASSERT(arity > 0 && arity <= mAX_SPEC_AP_SIZE dflags)
+   RtsLabel (RtsApInfoTable upd arity)
+
+mkApEntryLabel :: DynFlags -> Bool -> Int -> CLabel
+mkApEntryLabel dflags upd arity =
+   ASSERT(arity > 0 && arity <= mAX_SPEC_AP_SIZE dflags)
+   RtsLabel (RtsApEntry upd arity)
 
 
 -- A call to some primitive hand written Cmm code
@@ -1209,7 +1219,7 @@ pprCLabel dflags = \case
    lbl -> getPprStyle $ \sty ->
             if useNCG && asmStyle sty
             then maybe_underscore $ pprAsmCLbl lbl
-            else pprCLbl dflags lbl
+            else pprCLbl platform lbl
 
   where
     platform = targetPlatform dflags
@@ -1226,10 +1236,10 @@ pprCLabel dflags = \case
         -- In asm mode, we need to put the suffix on a stdcall ForeignLabel.
         -- (The C compiler does this itself).
         = ftext fs <> char '@' <> int sz
-    pprAsmCLbl lbl = pprCLbl dflags lbl
+    pprAsmCLbl lbl = pprCLbl platform lbl
 
-pprCLbl :: DynFlags -> CLabel -> SDoc
-pprCLbl dflags = \case
+pprCLbl :: Platform -> CLabel -> SDoc
+pprCLbl platform = \case
    (StringLitLabel u)   -> pprUniqueAlways u <> text "_str"
    (SRTLabel u)         -> tempLabelPrefixOrUnderscore platform <> pprUniqueAlways u <> pp_cSEP <> text "srt"
    (LargeBitmapLabel u) -> tempLabelPrefixOrUnderscore platform
@@ -1247,7 +1257,6 @@ pprCLbl dflags = \case
    (RtsLabel (RtsApFast str)) -> ftext str <> text "_fast"
 
    (RtsLabel (RtsSelectorInfoTable upd_reqd offset)) ->
-    ASSERT(offset >= 0 && offset <= mAX_SPEC_SELECTEE_SIZE dflags)
     hcat [text "stg_sel_", text (show offset),
           ptext (if upd_reqd
                  then (sLit "_upd_info")
@@ -1255,7 +1264,6 @@ pprCLbl dflags = \case
         ]
 
    (RtsLabel (RtsSelectorEntry upd_reqd offset)) ->
-    ASSERT(offset >= 0 && offset <= mAX_SPEC_SELECTEE_SIZE dflags)
     hcat [text "stg_sel_", text (show offset),
                 ptext (if upd_reqd
                         then (sLit "_upd_entry")
@@ -1263,7 +1271,6 @@ pprCLbl dflags = \case
         ]
 
    (RtsLabel (RtsApInfoTable upd_reqd arity)) ->
-    ASSERT(arity > 0 && arity <= mAX_SPEC_AP_SIZE dflags)
     hcat [text "stg_ap_", text (show arity),
                 ptext (if upd_reqd
                         then (sLit "_upd_info")
@@ -1271,7 +1278,6 @@ pprCLbl dflags = \case
         ]
 
    (RtsLabel (RtsApEntry upd_reqd arity)) ->
-    ASSERT(arity > 0 && arity <= mAX_SPEC_AP_SIZE dflags)
     hcat [text "stg_ap_", text (show arity),
                 ptext (if upd_reqd
                         then (sLit "_upd_entry")
@@ -1301,8 +1307,6 @@ pprCLbl dflags = \case
    (DynamicLinkerLabel {})  -> panic "pprCLbl DynamicLinkerLabel"
    (PicBaseLabel {})        -> panic "pprCLbl PicBaseLabel"
    (DeadStripPreventer {})  -> panic "pprCLbl DeadStripPreventer"
-  where
-   platform = targetPlatform dflags
 
 ppIdFlavor :: IdLabelInfo -> SDoc
 ppIdFlavor x = pp_cSEP <> text


=====================================
compiler/GHC/StgToCmm/Closure.hs
=====================================
@@ -637,7 +637,7 @@ mkClosureInfo dflags is_static id lf_info tot_wds ptr_wds val_descr
     prof       = mkProfilingInfo dflags id val_descr
     nonptr_wds = tot_wds - ptr_wds
 
-    info_lbl = mkClosureInfoTableLabel id lf_info
+    info_lbl = mkClosureInfoTableLabel dflags id lf_info
 
 --------------------------------------
 --   Other functions over ClosureInfo
@@ -786,14 +786,14 @@ closureLocalEntryLabel dflags
   | tablesNextToCode dflags = toInfoLbl  . closureInfoLabel
   | otherwise               = toEntryLbl . closureInfoLabel
 
-mkClosureInfoTableLabel :: Id -> LambdaFormInfo -> CLabel
-mkClosureInfoTableLabel id lf_info
+mkClosureInfoTableLabel :: DynFlags -> Id -> LambdaFormInfo -> CLabel
+mkClosureInfoTableLabel dflags id lf_info
   = case lf_info of
         LFThunk _ _ upd_flag (SelectorThunk offset) _
-                      -> mkSelectorInfoLabel upd_flag offset
+                      -> mkSelectorInfoLabel dflags upd_flag offset
 
         LFThunk _ _ upd_flag (ApThunk arity) _
-                      -> mkApInfoTableLabel upd_flag arity
+                      -> mkApInfoTableLabel dflags upd_flag arity
 
         LFThunk{}     -> std_mk_lbl name cafs
         LFReEntrant{} -> std_mk_lbl name cafs
@@ -825,13 +825,13 @@ thunkEntryLabel dflags thunk_id c _ _
 
 enterApLabel :: DynFlags -> Bool -> Arity -> CLabel
 enterApLabel dflags is_updatable arity
-  | tablesNextToCode dflags = mkApInfoTableLabel is_updatable arity
-  | otherwise               = mkApEntryLabel is_updatable arity
+  | tablesNextToCode dflags = mkApInfoTableLabel dflags is_updatable arity
+  | otherwise               = mkApEntryLabel     dflags is_updatable arity
 
 enterSelectorLabel :: DynFlags -> Bool -> WordOff -> CLabel
 enterSelectorLabel dflags upd_flag offset
-  | tablesNextToCode dflags = mkSelectorInfoLabel upd_flag offset
-  | otherwise               = mkSelectorEntryLabel upd_flag offset
+  | tablesNextToCode dflags = mkSelectorInfoLabel  dflags upd_flag offset
+  | otherwise               = mkSelectorEntryLabel dflags upd_flag offset
 
 enterIdLabel :: DynFlags -> Name -> CafInfo -> CLabel
 enterIdLabel dflags id c


=====================================
compiler/GHC/Tc/Instance/Class.hs
=====================================
@@ -259,12 +259,12 @@ Note [KnownNat & KnownSymbol and EvLit]
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 A part of the type-level literals implementation are the classes
 "KnownNat" and "KnownSymbol", which provide a "smart" constructor for
-defining singleton values.  Here is the key stuff from GHC.TypeLits
+defining singleton values.  Here is the key stuff from GHC.TypeNats
 
   class KnownNat (n :: Nat) where
     natSing :: SNat n
 
-  newtype SNat (n :: Nat) = SNat Integer
+  newtype SNat (n :: Nat) = SNat Natural
 
 Conceptually, this class has infinitely many instances:
 
@@ -291,10 +291,10 @@ Also note that `natSing` and `SNat` are never actually exposed from the
 library---they are just an implementation detail.  Instead, users see
 a more convenient function, defined in terms of `natSing`:
 
-  natVal :: KnownNat n => proxy n -> Integer
+  natVal :: KnownNat n => proxy n -> Natural
 
 The reason we don't use this directly in the class is that it is simpler
-and more efficient to pass around an integer rather than an entire function,
+and more efficient to pass around a Natural rather than an entire function,
 especially when the `KnowNat` evidence is packaged up in an existential.
 
 The story for kind `Symbol` is analogous:


=====================================
compiler/GHC/Types/Unique/DSet.hs
=====================================
@@ -81,8 +81,8 @@ unionUniqDSets :: UniqDSet a -> UniqDSet a -> UniqDSet a
 unionUniqDSets (UniqDSet s) (UniqDSet t) = UniqDSet (plusUDFM s t)
 
 unionManyUniqDSets :: [UniqDSet a] -> UniqDSet a
-unionManyUniqDSets [] = emptyUniqDSet
-unionManyUniqDSets sets = foldr1 unionUniqDSets sets
+unionManyUniqDSets []     = emptyUniqDSet
+unionManyUniqDSets (x:xs) = foldl' unionUniqDSets x xs
 
 minusUniqDSet :: UniqDSet a -> UniqDSet a -> UniqDSet a
 minusUniqDSet (UniqDSet s) (UniqDSet t) = UniqDSet (minusUDFM s t)


=====================================
docs/users_guide/8.12.1-notes.rst
=====================================
@@ -21,11 +21,10 @@ Highlights
 
 * Pattern-Match Coverage Checking
 
-  - The revamp of the pattern-match coverage checker that started in 8.10 concludes with this release and implements the 
+  - The revamp of the pattern-match coverage checker that started in 8.10 concludes with this release and implements the
     novel `*Lower Your Guards* <https://www.microsoft.com/en-us/research/uploads/prod/2020/03/lyg.pdf>`_ algorithm.
-  - Compared to 8.10, end users might notice improvements to "long-distance information": :: haskell
+  - Compared to 8.10, end users might notice improvements to "long-distance information": ::
 
-      :linenos:   
       f True = 1
       f x    = ... case x of { False -> 2; True -> 3 } ...
 
@@ -40,7 +39,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 +102,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`.
 
@@ -125,14 +124,14 @@ Language
       MkT2 :: (forall a. a -> T)
 
   ``MkT1`` and ``MkT2`` are rejected because the lack of an outermost
-  ``forall`` triggers implicit quantification, making the explicit ``forall``s
+  ``forall`` triggers implicit quantification, making the explicit ``forall``\ s
   nested. Furthermore, GADT constructors do not permit the use of nested
-  ``forall``s, as explained in :ref:`formal-gadt-syntax`.
+  ``forall``\ s, as explained in :ref:`formal-gadt-syntax`.
 
-  In addition to rejecting nested ``forall``s, GHC is now more stringent about
+  In addition to rejecting nested ``forall``\ s, GHC is now more stringent about
   rejecting uses of nested *contexts* in GADT constructors. For example, the
   following example, which previous versions of GHC would accept, is now
-  rejected:
+  rejected: ::
 
     data U a where
       MkU :: (Show a => U a)


=====================================
docs/users_guide/extending_ghc.rst
=====================================
@@ -775,7 +775,7 @@ each case:
     package/field-n
 
 To read an interface file from an external tool without linking to GHC, the format
-is described at `Extensible Interface Files<https://gitlab.haskell.org/ghc/ghc/wikis/Extensible-Interface-Files>`_.
+is described at `Extensible Interface Files <https://gitlab.haskell.org/ghc/ghc/wikis/Extensible-Interface-Files>`_.
 
 Source plugin example
 ^^^^^^^^^^^^^^^^^^^^^
@@ -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/explicit_forall.rst
=====================================
@@ -112,9 +112,9 @@ Notes:
 
     {-# RULES "f" forall (g :: forall a. a -> b) x. f g x = g x :: b #-}
 
-- GADT constructors are extra particular about their ``forall``s. In addition
+- GADT constructors are extra particular about their ``forall``\ s. In addition
   to adhering to the ``forall``-or-nothing rule, GADT constructors also forbid
-  nested ``forall``s. For example, GHC would reject the following GADT: ::
+  nested ``forall``\ s. For example, GHC would reject the following GADT: ::
 
     data T where
       MkT :: (forall a. a -> b -> T)
@@ -122,4 +122,4 @@ Notes:
   Because of the lack of an outermost ``forall`` in the type of ``MkT``, the
   ``b`` would be implicitly quantified. In effect, it would be as if one had
   written ``MkT :: forall b. (forall a. a -> b -> T)``, which contains nested
-  ``forall``s. See :ref:`formal-gadt-syntax`.
+  ``forall``\ s. See :ref:`formal-gadt-syntax`.


=====================================
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/gadt_syntax.rst
=====================================
@@ -161,23 +161,23 @@ Where:
 
 - ``btype`` is a type that is not allowed to have an outermost
   ``forall``/``=>`` unless it is surrounded by parentheses. For example,
-  ``forall a. a`` and ``Eq a => a`` are not legal ``btype``s, but
+  ``forall a. a`` and ``Eq a => a`` are not legal ``btype``\ s, but
   ``(forall a. a)`` and ``(Eq a => a)`` are legal.
 - ``ctype`` is a ``btype`` that has no restrictions on an outermost
-  ``forall``/``=>``, so ``forall a. a`` and ``Eq a => a`` are legal ``ctype``s.
-- ``return_type`` is a type that is not allowed to have ``forall``s, ``=>``s,
-  or ``->``s.
+  ``forall``/``=>``, so ``forall a. a`` and ``Eq a => a`` are legal ``ctype``\ s.
+- ``return_type`` is a type that is not allowed to have ``forall``\ s, ``=>``\ s,
+  or ``->``\ s.
 
 This is a simplified grammar that does not fully delve into all of the
 implementation details of GHC's parser (such as the placement of Haddock
 comments), but it is sufficient to attain an understanding of what is
 syntactically allowed. Some further various observations about this grammar:
 
-- GADT constructor types are currently not permitted to have nested ``forall``s
-  or ``=>``s. (e.g., something like ``MkT :: Int -> forall a. a -> T`` would be
+- GADT constructor types are currently not permitted to have nested ``forall``\ s
+  or ``=>``\ s. (e.g., something like ``MkT :: Int -> forall a. a -> T`` would be
   rejected.) As a result, ``gadt_sig`` puts all of its quantification and
   constraints up front with ``opt_forall`` and ``opt_context``. Note that
-  higher-rank ``forall``s and ``=>``s are only permitted if they do not appear
+  higher-rank ``forall``\ s and ``=>``\ s are only permitted if they do not appear
   directly to the right of a function arrow in a `prefix_gadt_body`. (e.g.,
   something like ``MkS :: Int -> (forall a. a) -> S`` is allowed, since
   parentheses separate the ``forall`` from the ``->``.)


=====================================
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/type_literals.rst
=====================================
@@ -10,10 +10,10 @@ Numeric literals are of kind ``Nat``, while string literals are of kind
 extension.
 
 The kinds of the literals and all other low-level operations for this
-feature are defined in module ``GHC.TypeLits``. Note that the module
-defines some type-level operators that clash with their value-level
-counterparts (e.g. ``(+)``). Import and export declarations referring to
-these operators require an explicit namespace annotation (see
+feature are defined in modules ``GHC.TypeLits`` and ``GHC.TypeNats``.
+Note that these modules define some type-level operators that clash with their
+value-level counterparts (e.g. ``(+)``). Import and export declarations
+referring to these operators require an explicit namespace annotation (see
 :ref:`explicit-namespaces`).
 
 Here is an example of using type-level numeric literals to provide a
@@ -59,7 +59,8 @@ a type-level literal. This is done with the functions ``natVal`` and
 These functions are overloaded because they need to return a different
 result, depending on the type at which they are instantiated. ::
 
-    natVal :: KnownNat n => proxy n -> Integer
+    natVal :: KnownNat n => proxy n -> Natural  -- from GHC.TypeNats
+    natVal :: KnownNat n => proxy n -> Integer  -- from GHC.TypeLits
 
     -- instance KnownNat 0
     -- instance KnownNat 1
@@ -79,7 +80,9 @@ will be unknown at compile-time, so it is hidden in an existential type.
 The conversion may be performed using ``someNatVal`` for integers and
 ``someSymbolVal`` for strings: ::
 
-    someNatVal :: Integer -> Maybe SomeNat
+    someNatVal :: Natural -> Maybe SomeNat  -- from GHC.TypeNats
+    someNatVal :: Integer -> Maybe SomeNat  -- from GHC.TypeLits
+
     SomeNat    :: KnownNat n => Proxy n -> SomeNat
 
 The operations on strings are similar.


=====================================
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/using-warnings.rst
=====================================
@@ -239,8 +239,7 @@ of ``-W(no-)*``.
 
      - ``Data.List`` due to the future addition of ``Data.List.singleton`` and
        specialisation of exports to the ``[]`` type. See the
-       :ref:`mailing list
-       <https://groups.google.com/forum/#!topic/haskell-core-libraries/q3zHLmzBa5E>`
+       `mailing list <https://groups.google.com/forum/#!topic/haskell-core-libraries/q3zHLmzBa5E>`_
        for details.
 
     This warning can be addressed by either adding an explicit import list or


=====================================
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


=====================================
hadrian/build-cabal
=====================================
@@ -1,7 +1,8 @@
 #!/usr/bin/env bash
 
 CABAL=cabal
-CABFLAGS="--disable-documentation --disable-profiling --disable-library-profiling $CABFLAGS"
+CABFLAGS=("--disable-documentation" "--disable-profiling" "--disable-library-profiling" $CABFLAGS)
+( ${GHC:-ghc} --info | grep -s '("Support SMP","YES")' > /dev/null ) || CABFLAGS+=("--constraint=hadrian -threaded")
 
 # It is currently more robust to pass Cabal an absolute path to the project file.
 PROJ="$PWD/hadrian/cabal.project"
@@ -21,27 +22,13 @@ fi
 CABVERSTR=$("$CABAL" --numeric-version)
 CABVER=( ${CABVERSTR//./ } )
 
-build_failed() {
-    ( ghc --info | grep -s '("Support SMP","YES")' > /dev/null ) \
-      || cat <<EOF
-Your compiler does not support the threaded runtime system.
-Please disable the \`threaded\` Cabal flag in project.cabal.local
-by running:
-
-    echo -e "package hadrian\n  flags: -threaded" >> project.cabal.local
-
-EOF
-    exit 1
-}
-
 if [ "${CABVER[0]}" -gt 2 -o "${CABVER[0]}" -eq 2 -a "${CABVER[1]}" -ge 2 ];
 then
-    "$CABAL" --project-file="$PROJ" new-build $CABFLAGS -j exe:hadrian
+    "$CABAL" --project-file="$PROJ" new-build "${CABFLAGS[@]}" -j exe:hadrian
     # use new-exec instead of new-run to make sure that the build-tools (alex & happy) are in PATH
-    "$CABAL" --project-file="$PROJ" new-exec  $CABFLAGS    hadrian -- \
+    "$CABAL" --project-file="$PROJ" new-exec  "${CABFLAGS[@]}"    hadrian -- \
         --directory "$PWD" \
-        "$@" \
-        || build_failed
+        "$@"
 else
     echo "Cabal version is too old; you need at least cabal-install 2.2"
     exit 2


=====================================
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.


=====================================
rts/linker/LoadArchive.c
=====================================
@@ -461,6 +461,7 @@ static HsInt loadArchive_ (pathchar *path)
         /* TODO: Stop relying on file extensions to determine input formats.
                  Instead try to match file headers. See #13103.  */
         isObject = (thisFileNameSize >= 2 && strncmp(fileName + thisFileNameSize - 2, ".o"  , 2) == 0)
+                || (thisFileNameSize >= 3 && strncmp(fileName + thisFileNameSize - 3, ".lo" , 3) == 0)
                 || (thisFileNameSize >= 4 && strncmp(fileName + thisFileNameSize - 4, ".p_o", 4) == 0)
                 || (thisFileNameSize >= 4 && strncmp(fileName + thisFileNameSize - 4, ".obj", 4) == 0);
 


=====================================
testsuite/tests/perf/compiler/all.T
=====================================
@@ -352,7 +352,7 @@ test ('WWRec',
 test('T16190',
       [ req_th,
         unless(have_ncg(), skip), # T16190 tests a NCG feature
-        collect_compiler_stats()
+        collect_compiler_stats('bytes allocated',20)
       ],
       multimod_compile,
       ['T16190.hs', '-v0'])



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/7a3f8090a6873d29185dba71aa5ed791816b7138...05df6359f7e82a16a113af9c3317c74188003ad3

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/7a3f8090a6873d29185dba71aa5ed791816b7138...05df6359f7e82a16a113af9c3317c74188003ad3
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/6ea10dae/attachment-0001.html>


More information about the ghc-commits mailing list