1. 23 Oct, 2018 1 commit
  2. 07 Oct, 2018 1 commit
  3. 21 Jul, 2018 1 commit
    • David Feuer's avatar
      Harden fixST · 5a49651f
      David Feuer authored and David Feuer's avatar David Feuer committed
      Trac #15349 reveals that lazy blackholing can cause trouble for
      `fixST` much like it can for `fixIO`. Make `fixST` work just
      like `fixIO`.
      
      Reviewers: simonmar, hvr, bgamari
      
      Reviewed By: simonmar
      
      Subscribers: rwbarton, thomie, carter
      
      GHC Trac Issues: #15349
      
      Differential Revision: https://phabricator.haskell.org/D4948
      5a49651f
  4. 31 May, 2018 1 commit
  5. 28 May, 2018 1 commit
    • Tamar Christina's avatar
      Clean up Windows testsuite failures · 60fb2b21
      Tamar Christina authored
      Summary:
      Another round and attempt at getting these down to 0.
      
      We really should re-enable the CI and not wait for those cloud based ones.
      
      I've disabled the backpack tests on windows as they are too broad, they test
      as much the shell as they do the compiler.
      
      The perf tests have been too long to track down. but the numbers are horrible
      but I don't see them getting fixed so just have to accept them.
      
      T9293 has new windows specific output because a Dyn way only flag was added.
      This will of course not work on non-Dyn way builds.
      
      Test Plan: ./validate
      
      Reviewers: bgamari, hvr, simonmar
      
      Reviewed By: bgamari
      
      Subscribers: rwbarton, thomie, carter
      
      GHC Trac Issues: #15107
      
      Differential Revision: https://phabricator.haskell.org/D4668
      60fb2b21
  6. 20 May, 2018 1 commit
  7. 16 May, 2018 2 commits
  8. 03 May, 2018 1 commit
    • Chaitanya Koparkar's avatar
      Move the ResponseFile module from haddock into base · 866525a1
      Chaitanya Koparkar authored and Ben Gamari's avatar Ben Gamari committed
      GHC and the build tools use "response files" to work around the limit
      on the length of command line arguments on Windows. Haddock's
      implementation of parsing response files (i.e escaping/unescaping the
      appropriate characters) seems complete, is well tested, and also
      closely matches the GCC version. This patch moves the relevant bits
      into `base` so that it's easier for other libraries to reuse it.
      
      Test Plan: make test TEST=T13896
      
      Reviewers: bgamari, RyanGlScott, 23Skidoo, hvr
      
      Reviewed By: RyanGlScott
      
      Subscribers: thomie, carter
      
      GHC Trac Issues: #13896
      
      Differential Revision: https://phabricator.haskell.org/D4612
      866525a1
  9. 20 Apr, 2018 1 commit
  10. 09 Nov, 2017 2 commits
  11. 25 Oct, 2017 1 commit
  12. 19 Oct, 2017 1 commit
  13. 25 Aug, 2017 1 commit
  14. 22 Aug, 2017 1 commit
    • Ryan Scott's avatar
      Make the Read instance for Proxy (and friends) ignore precedence · 8fd95999
      Ryan Scott authored
      Summary:
      The `Read` instance for `Proxy`, as well as a handful of other data
      types in `base` which only have a single constructor, are doing something
      skeevy: they're requiring that they be surrounded by parentheses if the parsing
      precedence is sufficiently high. This means that `"Thing (Proxy)"` would parse,
      but not `"Thing Proxy"`. But the latter really ought to parse, since there's no
      need to surround a single constructor with parentheses. Indeed, that's the
      output of `show (Thing Proxy)`, so the current `Read` instance for `Proxy`
      violates `read . show = id`.
      
      The simple solution is to change `readParen (d > 10)` to `readParen False` in
      the `Read` instance for `Proxy`. But given that a derived `Read` instance would
      essentially accomplish the same thing, but with even fewer characters, I've
      opted to just replace the hand-rolled `Read` instance with a derived one.
      
      Test Plan: make test TEST=T12874
      
      Reviewers: ekmett, austin, hvr, goldfire, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: rwbarton, thomie
      
      GHC Trac Issues: #12874
      
      Differential Revision: https://phabricator.haskell.org/D3871
      8fd95999
  15. 31 Jul, 2017 1 commit
  16. 29 Jul, 2017 1 commit
  17. 25 Apr, 2017 1 commit
  18. 23 Apr, 2017 1 commit
  19. 21 Apr, 2017 1 commit
    • Ben Gamari's avatar
      base: Fix hWaitForInput with timeout on POSIX · e5732d2a
      Ben Gamari authored and Ben Gamari's avatar Ben Gamari committed
      This was previously broken (#13252) by
      f46369b8, which ported the fdReady
      function from `select` to `poll` and in so doing dropping support for
      timeouts. Unfortunately, while `select` tells us the amount of time not
      slept (on Linux anyways; it turns out this is implementation dependent),
      `poll` does not give us this luxury. Consequently, we manually need to
      track time slept in this case.
      
      Unfortunately, portably measuring time is hard. Ideally we would use
      `clock_gettime` with the monotonic clock here, but sadly this isn't
      supported on most versions of Darwin. Consequently, we instead use
      `gettimeofday`, running the risk of system time changes messing us up.
      
      Test Plan: Validate
      
      Reviewers: simonmar, austin, hvr
      
      Reviewed By: simonmar
      
      Subscribers: rwbarton, thomie
      
      GHC Trac Issues: #13252
      
      Differential Revision: https://phabricator.haskell.org/D3473
      e5732d2a
  20. 05 Apr, 2017 2 commits
  21. 26 Feb, 2017 1 commit
    • rwbarton's avatar
      tests: remove extra_files.py (#12223) · 3415bcaa
      rwbarton authored and Ben Gamari's avatar Ben Gamari committed
      The script I used is included as testsuite/driver/kill_extra_files.py,
      though at this point it is for mostly historical interest.
      
      Some of the tests in libraries/hpc relied on extra_files.py, so this
      commit includes an update to that submodule.
      
      One test in libraries/process also relies on extra_files.py, but we
      cannot update that submodule so easily, so for now we special-case it
      in the test driver.
      3415bcaa
  22. 18 Feb, 2017 2 commits
    • Ben Gamari's avatar
      Type-indexed Typeable · 8fa4bf9a
      Ben Gamari authored
      This at long last realizes the ideas for type-indexed Typeable discussed in A
      Reflection on Types (#11011). The general sketch of the project is described on
      the Wiki (Typeable/BenGamari). The general idea is that we are adding a type
      index to `TypeRep`,
      
          data TypeRep (a :: k)
      
      This index allows the typechecker to reason about the type represented by the `TypeRep`.
      This index representation mechanism is exposed as `Type.Reflection`, which also provides
      a number of patterns for inspecting `TypeRep`s,
      
      ```lang=haskell
      pattern TRFun :: forall k (fun :: k). ()
                    => forall (r1 :: RuntimeRep) (r2 :: RuntimeRep)
                              (arg :: TYPE r1) (res :: TYPE r2).
                       (k ~ Type, fun ~~ (arg -> res))
                    => TypeRep arg
                    -> TypeRep res
                    -> TypeRep fun
      
      pattern TRApp :: forall k2 (t :: k2). ()
                    => forall k1 (a :: k1 -> k2) (b :: k1). (t ~ a b)
                    => TypeRep a -> TypeRep b -> TypeRep t
      
      -- | Pattern match on a type constructor.
      pattern TRCon :: forall k (a :: k). TyCon -> TypeRep a
      
      -- | Pattern match on a type constructor including its instantiated kind
      -- variables.
      pattern TRCon' :: forall k (a :: k). TyCon -> [SomeTypeRep] -> TypeRep a
      ```
      
      In addition, we give the user access to the kind of a `TypeRep` (#10343),
      
          typeRepKind :: TypeRep (a :: k) -> TypeRep k
      
      Moreover, all of this plays nicely with 8.2's levity polymorphism, including the
      newly levity polymorphic (->) type constructor.
      
      Library changes
      ---------------
      
      The primary change here is the introduction of a Type.Reflection module to base.
      This module provides access to the new type-indexed TypeRep introduced in this
      patch. We also continue to provide the unindexed Data.Typeable interface, which
      is simply a type synonym for the existentially quantified SomeTypeRep,
      
          data SomeTypeRep where SomeTypeRep :: TypeRep a -> SomeTypeRep
      
      Naturally, this change also touched Data.Dynamic, which can now export the
      Dynamic data constructor. Moreover, I removed a blanket reexport of
      Data.Typeable from Data.Dynamic (which itself doesn't even import Data.Typeable
      now).
      
      We also add a kind heterogeneous type equality type, (:~~:), to
      Data.Type.Equality.
      
      Implementation
      --------------
      
      The implementation strategy is described in Note [Grand plan for Typeable] in
      TcTypeable. None of it was difficult, but it did exercise a number of parts of
      the new levity polymorphism story which had not yet been exercised, which took
      some sorting out.
      
      The rough idea is that we augment the TyCon produced for each type constructor
      with information about the constructor's kind (which we call a KindRep). This
      allows us to reconstruct the monomorphic result kind of an particular
      instantiation of a type constructor given its kind arguments.
      
      Unfortunately all of this takes a fair amount of work to generate and send
      through the compilation pipeline. In particular, the KindReps can unfortunately
      get quite large. Moreover, the simplifier will float out various pieces of them,
      resulting in numerous top-level bindings. Consequently we mark the KindRep
      bindings as noinline, ensuring that the float-outs don't make it into the
      interface file. This is important since there is generally little benefit to
      inlining KindReps and they would otherwise strongly affect compiler performance.
      
      Performance
      -----------
      
      Initially I was hoping to also clear up the remaining holes in Typeable's
      coverage by adding support for both unboxed tuples (#12409) and unboxed sums
      (#13276). While the former was fairly straightforward, the latter ended up being
      quite difficult: while the implementation can support them easily, enabling this
      support causes thousands of Typeable bindings to be emitted to the GHC.Types as
      each arity-N sum tycon brings with it N promoted datacons, each of which has a
      KindRep whose size which itself scales with N. Doing this was simply too
      expensive to be practical; consequently I've disabled support for the time
      being.
      
      Even after disabling sums this change regresses compiler performance far more
      than I would like. In particular there are several testcases in the testsuite
      which consist mostly of types which regress by over 30% in compiler allocations.
      These include (considering the "bytes allocated" metric),
      
       * T1969:  +10%
       * T10858: +23%
       * T3294:  +19%
       * T5631:  +41%
       * T6048:  +23%
       * T9675:  +20%
       * T9872a: +5.2%
       * T9872d: +12%
       * T9233:  +10%
       * T10370: +34%
       * T12425: +30%
       * T12234: +16%
       * 13035:  +17%
       * T4029:  +6.1%
      
      I've spent quite some time chasing down the source of this regression and while
      I was able to make som improvements, I think this approach of generating
      Typeable bindings at time of type definition is doomed to give us unnecessarily
      large compile-time overhead.
      
      In the future I think we should consider moving some of all of the Typeable
      binding generation logic back to the solver (where it was prior to
      91c6b1f5). I've opened #13261 documenting this
      proposal.
      8fa4bf9a
    • Ben Gamari's avatar
      Generalize kind of the (->) tycon · b207b536
      Ben Gamari authored
      This is generalizes the kind of `(->)`, as discussed in #11714.
      
      This involves a few things,
      
       * Generalizing the kind of `funTyCon`, adding two new `RuntimeRep`
      binders,
        ```lang=haskell
      (->) :: forall (r1 :: RuntimeRep) (r2 :: RuntimeRep)
                     (a :: TYPE r1) (b :: TYPE r2).
              a -> b -> *
        ```
      
       * Unsaturated applications of `(->)` are expressed as explicit
      `TyConApp`s
      
       * Saturated applications of `(->)` are expressed as `FunTy` as they are
      currently
      
       * Saturated applications of `(->)` are expressed by a new `FunCo`
      constructor in coercions
      
       * `splitTyConApp` needs to ensure that `FunTy`s are split to a
      `TyConApp`
         of `(->)` with the appropriate `RuntimeRep` arguments
      
       * Teach CoreLint to check that all saturated applications of `(->)` are
      represented with `FunTy`
      
      At the moment I assume that `Constraint ~ *`, which is an annoying
      source of complexity. This will
      be simplified once D3023 is resolved.
      
      Also, this introduces two known regressions,
      
      `tcfail181`, `T10403`
      =====================
      Only shows the instance,
      
          instance Monad ((->) r) -- Defined in ‘GHC.Base’
      
      in its error message when -fprint-potential-instances is used. This is
      because its instance head now mentions 'LiftedRep which is not in scope.
      I'm not entirely sure of the right way to fix this so I'm just accepting
      the new output for now.
      
      T5963 (Typeable)
      ================
      
      T5963 is now broken since Data.Typeable.Internals.mkFunTy computes its
      fingerprint without the RuntimeRep variables that (->) expects. This
      will be fixed with the merge of D2010.
      
      Haddock performance
      ===================
      
      The `haddock.base` and `haddock.Cabal` tests regress in allocations by
      about 20%. This certainly hurts, but it's also not entirely unexpected:
      the size of every function type grows with this patch and Haddock has a
      lot of functions in its heap.
      b207b536
  23. 06 Feb, 2017 1 commit
    • David Feuer's avatar
      Add liftA2 to Applicative class · a2f39da0
      David Feuer authored and David Feuer's avatar David Feuer committed
      * Make `liftA2` a method of `Applicative`.
      
      * Add explicit `liftA2` definitions to instances in `base`.
      
      * Add explicit invocations in `base`.
      
      Reviewers: ekmett, bgamari, RyanGlScott, austin, hvr
      
      Reviewed By: RyanGlScott
      
      Subscribers: ekmett, RyanGlScott, rwbarton, thomie
      
      Differential Revision: https://phabricator.haskell.org/D3031
      a2f39da0
  24. 03 Feb, 2017 1 commit
    • David Feuer's avatar
      Attempt to make lazy ST thread safe · 2f5cb3d4
      David Feuer authored and David Feuer's avatar David Feuer committed
      Use `noDuplicate#` to prevent lazy `ST` thunks from
      being evaluated in multiple GHC threads.
      
      Some lazy `ST` functions added laziness that did not seem to be useful
      (e.g.,
      creating lazy pairs that will never be matched unless one of their
      components
      is demanded). Stripped that out.
      
      Reviewers: ekmett, simonpj, bgamari, simonmar, austin, hvr
      
      Subscribers: rwbarton, thomie
      
      Differential Revision: https://phabricator.haskell.org/D3038
      
      GHC Trac Issues: #11760
      2f5cb3d4
  25. 30 Jan, 2017 1 commit
    • Rufflewind's avatar
      Fix broken tests · 2ec1c834
      Rufflewind authored and Ben Gamari's avatar Ben Gamari committed
      1. DoParamM requires the FlexibleContexts pragma now.
      
      2. topHandler02 and topHandler03 were broken as timeout.py failed to
         translate signals to exit codes.
      
      3. topHandler03 does not produce a consistent stderr, as it depends on
         what the user has /bin/sh set to.  dash writes "Terminated" whereas
         bash and zsh produce nothing in non-interactive mode.
      
      4. The remaining tests are broken due to changes in the error message
         formatting.
      
      Test Plan: validate
      
      Reviewers: thomie, dfeuer, austin, hvr, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: Phyx, dfeuer
      
      Differential Revision: https://phabricator.haskell.org/D2807
      2ec1c834
  26. 22 Jan, 2017 1 commit
  27. 19 Dec, 2016 1 commit
  28. 23 Nov, 2016 1 commit
  29. 01 Jul, 2016 1 commit
  30. 29 Jun, 2016 1 commit
    • Thomas Miedema's avatar
      Testsuite: use ignore_stderr/stdout instead of ignore_output · 1084d375
      Thomas Miedema authored
      The problem with ignore_output is that it hides errors for WAY=ghci.
      GHCi always returns with exit code 0 (unless it is broken itself).
      
      For example: ghci015 must have been failing with compile errors for
      years, but we didn't notice because all output was ignored.
      
      Therefore, replace all uses of ignore_output with either ignore_stderr
      or ignore_stdout. In some cases I opted for adding the expected output.
      
      Update submodule hpc and stm.
      
      Reviewed by: simonmar
      
      Differential Revision: https://phabricator.haskell.org/D2367
      1084d375
  31. 28 Jun, 2016 1 commit
  32. 25 May, 2016 1 commit
  33. 26 Apr, 2016 1 commit
  34. 20 Mar, 2016 1 commit
  35. 11 Mar, 2016 1 commit
    • Ben Gamari's avatar
      Make `catch` lazy in the action · 30ee9102
      Ben Gamari authored and Ben Gamari's avatar Ben Gamari committed
      Previously
      ```lang=haskell
      catch (error "uh oh") (\(_ :: SomeException) -> print "it failed")
      ```
      would unexpectedly fail with "uh oh" instead of the handler being run
      due to the strictness of `catch` in its first argument. See #11555 for
      details.
      
      Test Plan: Validate
      
      Reviewers: austin, hvr, simonpj
      
      Reviewed By: simonpj
      
      Subscribers: simonpj, thomie
      
      Differential Revision: https://phabricator.haskell.org/D1973
      
      GHC Trac Issues: #11555
      30ee9102
  36. 17 Jan, 2016 1 commit
    • Ryan Scott's avatar
      Show TYPE 'Lifted/TYPE 'Unlifted as */# in Show TypeRep instance · 65b810bd
      Ryan Scott authored and Ben Gamari's avatar Ben Gamari committed
      Kind equalities changed how `*`/`#` are represented internally, which
      means that showing a `TypeRep` that contains either of those kinds
      produces a rather gross-looking result, e.g.,
      
      ```
      > typeOf (Proxy :: Proxy 'Just)
      Proxy (TYPE 'Lifted -> Maybe (TYPE 'Lifted)) 'Just
      ```
      
      We can at least special-case the `Show` instance for `TypeRep` so that
      it prints `*` to represent `TYPE 'Lifted` and `#` to represent `TYPE
      'Unlifted`.
      
      Addresses one of the issues uncovered in #11334.
      
      Test Plan: ./validate
      
      Reviewers: simonpj, hvr, austin, goldfire, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D1757
      
      GHC Trac Issues: #11334
      65b810bd