1. 16 Jul, 2018 2 commits
    • Simon Marlow's avatar
      Fix space leaks · 71f6b18b
      Simon Marlow authored
      Summary:
      All these were detected by -fghci-leak-check when GHC was
      compiled *without* optimisation (e.g. using the "quick" build flavour).
      
      Unfortunately I don't know of a good way to keep this working.  I'd like
      to just disable the -fghci-leak-check flag when the compiler is built
      without optimisation, but it doesn't look like we have an easy way to do
      that. And even if we could, it would be fragile anyway,
      
      Test Plan: `cd testsuite/tests/ghci; make`
      
      Reviewers: bgamari, hvr, erikd, tdammers
      
      Subscribers: tdammers, rwbarton, thomie, carter
      
      GHC Trac Issues: #15246
      
      Differential Revision: https://phabricator.haskell.org/D4872
      71f6b18b
    • Ryan Scott's avatar
      Fix parse errors in core-spec.pdf · 8b6a9e55
      Ryan Scott authored
      Summary:
      `core-spec.pdf` was emitting parse errors due to not specifying
      role arguments in some uses of `nth`. This patch adds those
      role arguments. (Credit goes to Richard Eisenberg for actually
      figuring out what said arguments should be.)
      
      Test Plan: Read it
      
      Reviewers: goldfire, bgamari
      
      Reviewed By: goldfire
      
      Subscribers: rwbarton, thomie, carter
      
      GHC Trac Issues: #15373
      
      Differential Revision: https://phabricator.haskell.org/D4965
      8b6a9e55
  2. 15 Jul, 2018 9 commits
    • Alan Zimmerman's avatar
      TTG typo: XFieldOcc should be XCFieldOcc · 92695419
      Alan Zimmerman authored
      In the following
      
        data FieldOcc pass = FieldOcc { extFieldOcc     :: XFieldOcc pass
                                      , rdrNameFieldOcc :: Located RdrName
                                         -- ^ See Note [Located RdrNames] in HsExpr
                                      }
      
          | XFieldOcc
              (XXFieldOcc pass)
      
      we are using XFieldOcc for both the extFieldOcc type and the extra constructor.
      
      The first one should be XCFieldOcc
      
      Updates haddock submodule
      closes #15386
      92695419
    • David Feuer's avatar
      Replace atomicModifyMutVar# · af9b744b
      David Feuer authored
      Reviewers: simonmar, hvr, bgamari, erikd, fryguybob, rrnewton
      
      Reviewed By: simonmar
      
      Subscribers: fryguybob, rwbarton, thomie, carter
      
      GHC Trac Issues: #15364
      
      Differential Revision: https://phabricator.haskell.org/D4884
      af9b744b
    • Richard Eisenberg's avatar
      Reclassify some performance tests · 8a70ccbb
      Richard Eisenberg authored
      There were some performance tests not classified by
      compiler_num_stats_field, causing erroneous failures when
      testing a DEBUG compiler. This fixes that oversight,
      addressing #15374.
      8a70ccbb
    • Richard Eisenberg's avatar
      Disable -fghci-leak-check in DEBUG mode · 6d55e36f
      Richard Eisenberg authored
      The DEBUG compiler's GHCi still leaks. This commit suppresses
      testsuite failures due to this leak. See #15372.
      6d55e36f
    • Richard Eisenberg's avatar
      Don't mkNakedCastTy on something unsaturated · 15ce9b45
      Richard Eisenberg authored
      A recent commit added extra calls to mkNakedCastTy to satisfy
      Note [The tcType invariant]. However, some of these casts were
      being applied to unsaturated type family applications, which
      caused ASSERTion failures in TcFlatten later on. This patch
      is more judicious in using mkNakedCastTy to avoid this problem.
      15ce9b45
    • Richard Eisenberg's avatar
      Move check for dcUserTyVarBinders invariant · fe0fa63e
      Richard Eisenberg authored
      Previously, this check was done in mkDataCon. But this
      sometimes caused assertion failures if an invalid data
      con was made. I've moved the check to checkValidDataCon,
      where we can be sure the datacon is otherwise valid first.
      fe0fa63e
    • Richard Eisenberg's avatar
      Make some tests robust against DEBUG compiler · b7d60022
      Richard Eisenberg authored
      Several tests were failing in DEBUG mode, but fixing this
      was easy: just pass $(TEST_HC_OPTS) in the relevant
      Makefiles.
      b7d60022
    • Richard Eisenberg's avatar
      Remove ASSERTion about increasing TcLevels · a754a420
      Richard Eisenberg authored
      This removes an ASSERTion that TcLevels should increase by
      exactly one in every implication. While this is a sensible
      goal, it's not true today, and we should not be crippling
      DEBUG for everyone while debugging this.
      
      The ASSERT was added in 261dd83c
      a754a420
    • Simon Marlow's avatar
      Optimise wakeups for STM · 502640c9
      Simon Marlow authored
      Avoids repeated wakeup messages being sent when a TVar is written to
      multiple times. See comments for details.
      
      Test Plan:
      * Test from #15136 (will be added to stm shortly)
      * existing stm tests
      
      Reviewers: bgamari, osa1, erikd
      
      Reviewed By: bgamari
      
      Subscribers: rwbarton, thomie, carter
      
      GHC Trac Issues: #15136
      
      Differential Revision: https://phabricator.haskell.org/D4961
      502640c9
  3. 14 Jul, 2018 5 commits
  4. 13 Jul, 2018 6 commits
    • Simon Peyton Jones's avatar
      Comments only · 2928b925
      Simon Peyton Jones authored
      2928b925
    • Simon Marlow's avatar
      submodule update · e40eb738
      Simon Marlow authored
      e40eb738
    • Simon Peyton Jones's avatar
      Improve comments about CUSKs · 56b9e470
      Simon Peyton Jones authored
      56b9e470
    • Simon Peyton Jones's avatar
      Refactor floatEqualities slightly · b56926d8
      Simon Peyton Jones authored
      A conversation with Richard made me look at floatEqualities again, and
      I did not find it easy to read.  This patch refactors it sligtly, with
      better variable naming and more comments.
      
      I also fixed one latent bug, I think.  In the old code, I think that an
      inhomogeneous or insoluble equality (co :: t1~t2), which doesn't float,
      and ended up in the badly-named 'non_eqs', would not end up in
      extended_skols.  Hence it would not capture an equality that mentioned
      'co' in a cast.
      
      It's still pretty horrible (as Richard and I have been discussing),
      but better.
      
      No change in behaviour; I don't know a program that would trigger
      the latent bug, even if my reasoning is right.
      b56926d8
    • Ömer Sinan Ağacan's avatar
      Fix processHeapClosureForDead CONSTR_NOCAF case · 2625f131
      Ömer Sinan Ağacan authored
      CONSTR_NOCAF was introduced with 55d535da as a replacement for
      CONSTR_STATIC and CONSTR_NOCAF_STATIC, however, as explained in Note
      [static constructors], we copy CONSTR_NOCAFs (which can also be seen in
      evacuate) during GC, and they can become dead, like other CONSTR_X_Ys.
      processHeapClosureForDead is updated to reflect this.
      
      Test Plan: Validates on x86_64. Existing failures on i386.
      
      Reviewers: simonmar, bgamari, erikd
      
      Reviewed By: simonmar, bgamari
      
      Subscribers: rwbarton, thomie, carter
      
      GHC Trac Issues: #7836, #15063, #15087, #15165
      
      Differential Revision: https://phabricator.haskell.org/D4928
      2625f131
    • Simon Marlow's avatar
      Update submodule · 3ee7ca1b
      Simon Marlow authored
      3ee7ca1b
  5. 12 Jul, 2018 18 commits
    • Simon Marlow's avatar
      Fix deadlock between STM and throwTo · 7fc418df
      Simon Marlow authored
      There was a lock-order reversal between lockTSO() and the TVar lock,
      see #15136 for the details.
      
      It turns out we can fix this pretty easily by just deleting all the
      locking code(!).  The principle for unblocking a `BlockedOnSTM` thread
      then becomes the same as for other kinds of blocking: if the TSO
      belongs to this capability then we do it directly, otherwise we send a
      message to the capability that owns the TSO. That is, a thread blocked
      on STM is owned by its capability, as it should be.
      
      The possible downside of this is that we might send multiple messages
      to wake up a thread when the thread is on another capability. This is
      safe, it's just not very efficient.  I'll try to do some experiments
      to see if this is a problem.
      
      Test Plan: Test case from #15136 doesn't deadlock any more.
      
      Reviewers: bgamari, osa1, erikd
      
      Reviewed By: osa1
      
      Subscribers: rwbarton, thomie, carter
      
      GHC Trac Issues: #15136
      
      Differential Revision: https://phabricator.haskell.org/D4956
      7fc418df
    • Matthew Pickering's avatar
      Run the renamed source plugin after each HsGroup · 1a79270c
      Matthew Pickering authored
      This allows modification of each `HsGroup` after it has been renamed.
      
      The old behaviour of keeping the renamed source until later can be
      recovered if desired by using the `keepRenamedSource` plugin but it
      shouldn't really be necessary as it can be inspected in the `TcGblEnv`.
      
      Reviewers: nboldi, bgamari, alpmestan
      
      Reviewed By: nboldi, alpmestan
      
      Subscribers: alpmestan, rwbarton, thomie, carter
      
      GHC Trac Issues: #15315
      
      Differential Revision: https://phabricator.haskell.org/D4947
      1a79270c
    • Matthew Pickering's avatar
      Release notes about source plugins · 305da44c
      Matthew Pickering authored
      305da44c
    • Krzysztof Gogolewski's avatar
      docs: remove leftovers of static flags · f282f02d
      Krzysztof Gogolewski authored
      Remove "dynamic + :set" category from documentation,
      because all dynamic flags support ":set"; this is a
      leftover of "static + :set".
      
      Test Plan: make html
      
      Reviewers: bgamari, mpickering
      
      Reviewed By: mpickering
      
      Subscribers: mpickering, osa1, rwbarton, thomie, carter
      
      Differential Revision: https://phabricator.haskell.org/D4942
      f282f02d
    • Matthew Pickering's avatar
      Export findImportUsage and ImportDeclUsage · 2b1adaa7
      Matthew Pickering authored
      Reviewers: bgamari, alpmestan
      
      Reviewed By: alpmestan
      
      Subscribers: alpmestan, rwbarton, thomie, carter
      
      GHC Trac Issues: #15335
      
      Differential Revision: https://phabricator.haskell.org/D4927
      2b1adaa7
    • Michael Sloan's avatar
      Fix handling of unbound constructor names in TH #14627 · 0f79b0ef
      Michael Sloan authored
      Also adds a comment to UnboundVarE clarifying that it also is used for
      unbound constructor identifiers, since that isn't very clear from the
      name.
      
      Test Plan: testsuite/tests/th/T14627.hs
      
      Reviewers: goldfire, bgamari
      
      Reviewed By: goldfire
      
      Subscribers: rwbarton, thomie, carter
      
      Differential Revision: https://phabricator.haskell.org/D4923
      0f79b0ef
    • Michael Sloan's avatar
      Fix handling of ApplicativeDo in TH AST quotes · 234093cf
      Michael Sloan authored
      See https://ghc.haskell.org/trac/ghc/ticket/14471
      
      Also fixes a parenthesization bug in pprStmt when ret_stripped is True
      
      Test Plan: tests added to testsuite
      
      Trac issues: #14471
      
      Reviewers: goldfire, bgamari
      
      Reviewed By: goldfire
      
      Subscribers: rwbarton, thomie, carter
      
      Differential Revision: https://phabricator.haskell.org/D4912
      234093cf
    • Matthías Páll Gissurarson's avatar
      Add flag to show docs of valid hole fits · c4d98341
      Matthías Páll Gissurarson authored
      One issue with valid hole fits is that the function names can often be
      opaque for the uninitiated, such as `($)`. This diff adds a new flag,
      `-fshow-docs-of-hole-fits` that adds the documentation of the identifier
      in question to the message, using the same mechanism as the `:doc`
      command.
      
      As an example, with this flag enabled, the valid hole fits for `_ ::
      [Int] -> Int` will include:
      
      ```
      Valid hole fits include
        head :: forall a. [a] -> a
          {-^ Extract the first element of a list, which must be non-empty.-}
          with head @Int
          (imported from ‘Prelude’ (and originally defined in ‘GHC.List’))
      ```
      
      And one of the refinement hole fits, `($) _`, will read:
      
      ```
      Valid refinement hole fits include
        ...
        ($) (_ :: [Int] -> Int)
            where ($) :: forall a b. (a -> b) -> a -> b
            {-^ Application operator.  This operator is redundant, since ordinary
                application @(f x)@ means the same as @(f '$' x)@. However, '$' has
                low, right-associative binding precedence, so it sometimes allows
                parentheses to be omitted; for example:
      
                > f $ g $ h x  =  f (g (h x))
      
                It is also useful in higher-order situations, such as @'map' ('$' 0) xs@,
                or @'Data.List.zipWith' ('$') fs xs@.
      
                Note that @($)@ is levity-polymorphic in its result type, so that
                    foo $ True    where  foo :: Bool -> Int#
                is well-typed-}
            with ($) @'GHC.Types.LiftedRep @[Int] @Int
            (imported from ‘Prelude’ (and originally defined in ‘GHC.Base’))
      
      ```
      
      Another example of where documentation can come in very handy, is when
      working with the `lens` library.
      
      When you compile
      ```
      {-# OPTIONS_GHC -fno-show-provenance-of-hole-fits -fshow-docs-of-hole-fits #-}
      module LensDemo where
      
      import Control.Lens
      import Control.Monad.State
      
      newtype Test = Test { _value :: Int } deriving (Show)
      
      value :: Lens' Test Int
      value f (Test i) = Test <$> f i
      
      updTest :: Test -> Test
      updTest t = t &~ do
          _ value (1 :: Int)
      ```
      
      You get:
      ```
        Valid hole fits include
          (#=) :: forall s (m :: * -> *) a b.
                  MonadState s m =>
                  ALens s s a b -> b -> m ()
            {-^ A version of ('Control.Lens.Setter..=') that works on 'ALens'.-}
            with (#=) @Test @(StateT Test Identity) @Int @Int
          (<#=) :: forall s (m :: * -> *) a b.
                   MonadState s m =>
                   ALens s s a b -> b -> m b
            {-^ A version of ('Control.Lens.Setter.<.=') that works on 'ALens'.-}
            with (<#=) @Test @(StateT Test Identity) @Int @Int
          (<*=) :: forall s (m :: * -> *) a.
                   (MonadState s m, Num a) =>
                   LensLike' ((,) a) s a -> a -> m a
            {-^ Multiply the target of a numerically valued 'Lens' into your 'Monad''s
                state and return the result.
      
                When you do not need the result of the multiplication,
                ('Control.Lens.Setter.*=') is more flexible.
      
                @
                ('<*=') :: ('MonadState' s m, 'Num' a) => 'Lens'' s a -> a -> m a
                ('<*=') :: ('MonadState' s m, 'Num' a) => 'Control.Lens.Iso.Iso'' s a -> a -> m a
                @-}
            with (<*=) @Test @(StateT Test Identity) @Int
          (<+=) :: forall s (m :: * -> *) a.
                   (MonadState s m, Num a) =>
                   LensLike' ((,) a) s a -> a -> m a
            {-^ Add to the target of a numerically valued 'Lens' into your 'Monad''s state
                and return the result.
      
                When you do not need the result of the addition,
                ('Control.Lens.Setter.+=') is more flexible.
      
                @
                ('<+=') :: ('MonadState' s m, 'Num' a) => 'Lens'' s a -> a -> m a
                ('<+=') :: ('MonadState' s m, 'Num' a) => 'Control.Lens.Iso.Iso'' s a -> a -> m a
                @-}
            with (<+=) @Test @(StateT Test Identity) @Int
          (<-=) :: forall s (m :: * -> *) a.
                   (MonadState s m, Num a) =>
                   LensLike' ((,) a) s a -> a -> m a
            {-^ Subtract from the target of a numerically valued 'Lens' into your 'Monad''s
                state and return the result.
      
                When you do not need the result of the subtraction,
                ('Control.Lens.Setter.-=') is more flexible.
      
                @
                ('<-=') :: ('MonadState' s m, 'Num' a) => 'Lens'' s a -> a -> m a
                ('<-=') :: ('MonadState' s m, 'Num' a) => 'Control.Lens.Iso.Iso'' s a -> a -> m a
                @-}
            with (<-=) @Test @(StateT Test Identity) @Int
          (<<*=) :: forall s (m :: * -> *) a.
                    (MonadState s m, Num a) =>
                    LensLike' ((,) a) s a -> a -> m a
            {-^ Modify the target of a 'Lens' into your 'Monad''s state by multipling a value
                and return the /old/ value that was replaced.
      
                When you do not need the result of the operation,
                ('Control.Lens.Setter.*=') is more flexible.
      
                @
                ('<<*=') :: ('MonadState' s m, 'Num' a) => 'Lens'' s a -> a -> m a
                ('<<*=') :: ('MonadState' s m, 'Num' a) => 'Iso'' s a -> a -> m a
                @-}
            with (<<*=) @Test @(StateT Test Identity) @Int
          (Some hole fits suppressed; use -fmax-valid-hole-fits=N or -fno-max-valid-hole-fits)
      
      ```
      
      Which allows you to see at a glance what opaque operators like `(<<*=)`
      and `(<#=)` do.
      
      Reviewers: bgamari, sjakobi
      
      Reviewed By: sjakobi
      
      Subscribers: sjakobi, alexbiehl, rwbarton, thomie, carter
      
      Differential Revision: https://phabricator.haskell.org/D4848
      c4d98341
    • Neil Mitchell's avatar
      Make boot work if ACLOCAL_PATH is not set · 101e9047
      Neil Mitchell authored
      101e9047
    • Bodigrim's avatar
      Fix gcdExtInteger (trac#15350) · 7c207c86
      Bodigrim authored
      7c207c86
    • Ningning Xie's avatar
      19e1e6bf
    • AntC's avatar
      Trac #8581 users_guide/glasgow_exts section 10.7 · 471a992a
      AntC authored
      as per comments on the ticket; also linked to Haskell folk art of 'Smart constructors'.
      471a992a
    • Ben Gamari's avatar
      Bump xhtml submodule to 3000.2.2.1 · 8e51eced
      Ben Gamari authored
      8e51eced
    • Alec Theriault's avatar
      8bccefc0
    • David Sanders's avatar
      Link to iterate' doesn't work. · 6a1e7e76
      David Sanders authored
      6a1e7e76
    • Michael Sloan's avatar
      Attempt to fix travis build · 7527d1fe
      Michael Sloan authored
      7527d1fe
    • jhb563's avatar
      Adding missing 'no' · 00cb530c
      jhb563 authored
      00cb530c
    • Sasa Bogicevic's avatar
      Correct Simple to Complex wording · 5ee9a1cd
      Sasa Bogicevic authored
      5ee9a1cd