1. 16 Oct, 2017 15 commits
    • Ben Gamari's avatar
      users-guide: Fix various warnings · c5da84db
      Ben Gamari authored
      [skip ci]
    • Ben Gamari's avatar
      users guide: Eliminate redundant :category: tags in debugging.rst · d7f4f41b
      Ben Gamari authored
      The categories in this file are defined in flags.py.
    • Ben Gamari's avatar
      users-guide: Rework and finish debug flag documentation · 8536b7f8
      Ben Gamari authored
      This documentation was incomplete and not terribly well organized. Given that
      I've spent a lot of time searching through this page, I figured it is perhaps
      worth it to clean it up a bit.
    • Ben Gamari's avatar
      rts: Label all threads created by the RTS · 7e790b38
      Ben Gamari authored and Ben Gamari's avatar Ben Gamari committed
      Reviewers: austin, erikd, simonmar
      Reviewed By: simonmar
      Subscribers: pacak, rwbarton, thomie
      Differential Revision: https://phabricator.haskell.org/D4068
    • Ben Gamari's avatar
      FreeBSD dtrace probe support · 5dab5442
      Ben Gamari authored
      Reviewers: austin, hvr, erikd, simonmar, bgamari
      Reviewed By: bgamari
      Subscribers: snowleopard, raichoo, rwbarton, thomie, erikd
      Differential Revision: https://phabricator.haskell.org/D3994
    • Edward Z. Yang's avatar
      Levity polymorphic Backpack. · fd8b044e
      Edward Z. Yang authored and Ben Gamari's avatar Ben Gamari committed
      This patch makes it possible to specify non * kinds of
      abstract data types in signatures, so you can have
      levity polymorphism through Backpack, without the runtime
      representation constraint!
      Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
      Test Plan: validate
      Reviewers: andrewthad, bgamari, austin, goldfire
      Reviewed By: bgamari
      Subscribers: goldfire, rwbarton, thomie
      GHC Trac Issues: #13955
      Differential Revision: https://phabricator.haskell.org/D3825
    • Ben Gamari's avatar
      configure: Fix CC version check on Apple compilers · 71a42356
      Ben Gamari authored and Ben Gamari's avatar Ben Gamari committed
      It seems that some Apple LLVM wrappers emit multiple messages containing
      the string "version", which we previously used to find the version
      number.  For instance,
          Configured with: --prefix=/Applications/Xcode.app/Contents/...
          Apple LLVM version 9.0.0 (clang-900.0.37)
          Target: x86_64-apple-darwin16.7.0
          Thread model: posix
          InstalledDir: /Applications/Xcode.app/Contents/Developer/...
          Found CUDA installation: /usr/local/cuda, version 8.0
      We now take care to only look at the first occurrence of this string.
      New `sed` command due to @merijn.
      Test Plan: Validate on all the compilers
      Reviewers: austin, hvr
      Subscribers: rwbarton, thomie, merijn, erikd
      Differential Revision: https://phabricator.haskell.org/D4069
    • Herbert Valerio Riedel's avatar
      Implement {set,clear,complement}BitBigNat primitives · 6cc232ae
      Herbert Valerio Riedel authored
      This implements the missing `{set,clear,complement}BitBigNat` primitives
      and hooks them up to `Natural`'s `Bits` instance.
      This doesn't yet benefit `Integer`, as we still need "negative" `BigNat`
      variants of those primitives.
      Addresses #7860 (partly)
      Reviewed By: bgamari
      Differential Revision: https://phabricator.haskell.org/D3415
    • Herbert Valerio Riedel's avatar
      Enable testing 'Natural' type in TEST=arith011 · 843772b8
      Herbert Valerio Riedel authored
      This now passes thanks to 5984a698 (re #13203)
    • Herbert Valerio Riedel's avatar
      Override default `clearBit` method impl for `Natural` · 5984a698
      Herbert Valerio Riedel authored
      The default implementation of `clearBit` is in terms of
      `complement`. However, `complement` is not well-defined
      for `Natural` and this consequently renders the default
      implementation of `clearBit` dysfunctional.
      This implements `clearBit` in terms of `testBit`
      and `setBit` which are both well-defined for `Natural`s.
      This addresses #13203
    • Herbert Valerio Riedel's avatar
      Implement new `compareByteArrays#` primop · e3ba26f8
      Herbert Valerio Riedel authored
      The new primop
          compareByteArrays# :: ByteArray# -> Int# {- offset -}
                             -> ByteArray# -> Int# {- offset -}
                             -> Int# {- length -}
                             -> Int#
      allows to compare the subrange of the first `ByteArray#` to
      the (same-length) subrange of the second `ByteArray#` and returns a
      value less than, equal to, or greater than zero if the range is found,
      respectively, to be byte-wise lexicographically less than, to match,
      or be greater than the second range.
      Under the hood, the new primop is implemented in terms of the standard
      ISO C `memcmp(3)` function. It is currently an out-of-line primop but
      work is underway to optimise this into an inline primop for a future
      follow-up Differential (see D4091).
      This primop has applications in packages like `text`, `text-short`,
      `bytestring`, `text-containers`, `primitive`, etc.  which currently
      have to incur the overhead of an ordinary FFI call to directly or
      indirectly invoke `memcmp(3)` as well has having to deal with some
      While at it, this also improves the documentation for the existing
      `copyByteArray#` primitive which has a non-trivial type-signature
      that significantly benefits from a more explicit description of its
      Reviewed By: bgamari
      Differential Revision: https://phabricator.haskell.org/D4090
    • Herbert Valerio Riedel's avatar
      Fix panic for `ByteArray#` arguments in CApiFFI foreign imports · add85cc2
      Herbert Valerio Riedel authored
      Declarations such as
        foreign import capi  unsafe "string.h strlen"
            c_strlen_capi :: ByteArray# -> IO CSize
        foreign import capi  unsafe "string.h memset"
            c_memset_capi :: MutableByteArray# s -> CInt -> CSize -> IO ()
      would cause GHC to panic because the CApiFFI c-wrapper generator didn't
      know what C type to use for `(Mutable)ByteArray#` types (unlike the
      `ccall` codepath).
      This addresses #9274
      Reviewed By: bgamari
      Differential Revision: https://phabricator.haskell.org/D4092
    • Peter Trommler's avatar
      Fix typo · 6aa6a86b
      Peter Trommler authored and Gabor Greif's avatar Gabor Greif committed
    • Peter Trommler's avatar
      Fix typo · afac6b11
      Peter Trommler authored and Gabor Greif's avatar Gabor Greif committed
    • Simon Marlow's avatar
      Fix calculation in threadStackOverflow · 8adb84fe
      Simon Marlow authored
      The calculation was too conservative, and could result in copying zero
      frames into the new stack chunk, which caused a knock-on failure in
      the interpreter.
      Test Plan: Tested on an in-house repro (not shareable, unfortunately)
      Reviewers: niteria, bgamari, austin, erikd
      Subscribers: rwbarton, thomie
      Differential Revision: https://phabricator.haskell.org/D4052
  2. 15 Oct, 2017 1 commit
  3. 13 Oct, 2017 1 commit
    • Ryan Scott's avatar
      Delete obsolete docs on GADT interacton with TypeApplications · 2be55b85
      Ryan Scott authored
      Even since ef26182e, this section of
      the users' guide is wrong, as there are no longer special rules for
      the order of type variables in GADT constructors' type signatures
      vis-à-vis visible type application. As a result, this section can
      simply be deleted, as there is no longer anything interesting to say
      about the topic.
  4. 12 Oct, 2017 4 commits
    • Simon Peyton Jones's avatar
      Re-apply "Typeable: Allow App to match arrow types" · 3de788c4
      Simon Peyton Jones authored
      This re-applies
       commit cc6be3a2
        Author: Ben Gamari <bgamari.foss@gmail.com>
        Date:   Tue Sep 19 18:57:38 2017 -0400
          Typeable: Allow App to match arrow types
      which was reverted because of Trac #14270.  Now the latter is
      fixed we can re-apply it.
      The original ticket was Trac #14236
    • Simon Peyton Jones's avatar
      Do not bind coercion variables in SpecConstr rules · fb050a33
      Simon Peyton Jones authored
      Trac #14270 showed that SpecConstr could cause nasty Lint failures
      if it generates a RULE that binds coercion varables.  See
       * Note [SpecConstr and casts], and
       * the test simplCore/should_compile/T14270.
      This doesn't feel like the final word to me, because somehow the
      specialisation "ought" to work.  So I left in a debug WARN to yell if
      the new check acutally fires.
      Meanwhile, it stops the erroneous specialisation.
      binding coercion
    • Simon Peyton Jones's avatar
      Add missing T14325.stderr · 15aefb48
      Simon Peyton Jones authored
    • Simon Peyton Jones's avatar
      Do not quantify over deriving clauses · 82b77ec3
      Simon Peyton Jones authored
      Trac #14331 showed that in a data type decl like
         data D = D deriving (C (a :: k))
      we were quantifying D over the 'k' in the deriving clause.  Yikes.
      Easily fixed, by deleting code in RnTypes.extractDataDefnKindVars
      See the discussion on the ticket, esp comment:8.
  5. 11 Oct, 2017 11 commits
    • Simon Peyton Jones's avatar
      Add a missing zonk in TcDerivInfer.simplifyDeriv · 13fdca3d
      Simon Peyton Jones authored
      I'm astonished that anything worked without this!
      Fixes Trac #14339
    • Simon Peyton Jones's avatar
      Avoid creating dependent types in FloatOut · 4bb54a45
      Simon Peyton Jones authored
      This bug was exposed by Trac #14270.  The problem and its cure
      is described in SetLevels, Note [Floating and kind casts].
      It's simple and will affect very few programs.  But the very
      fact that it was so unexpected is discomforting.
    • Alan Zimmerman's avatar
      Pretty-printing of derived multi-parameter classes omits parentheses · 6869864e
      Alan Zimmerman authored
      Pretty printing a splice with an HsAppType in the deriving clause, such as
          $([d| data Foo a = Foo a deriving (C a) |])
      would omit the parens.
      Test Plan: ./validate
      Reviewers: RyanGlScott, austin, bgamari
      Subscribers: rwbarton, thomie
      GHC Trac Issues: #14289
      Differential Revision: https://phabricator.haskell.org/D4056
    • Ryan Scott's avatar
      Fix #10816 by renaming FixitySigs more consistently · 9c3f7316
      Ryan Scott authored
      #10816 surfaced because we were renaming top-level fixity
      declarations with a different code path (`rnSrcFixityDecl`) than
      the code path for fixity declarations inside of type classes, which
      is not privy to names that exist in the type namespace. Luckily, the
      fix is simple: use `rnSrcFixityDecl` in both places.
      Test Plan: make test TEST=T10816
      Reviewers: austin, bgamari, simonpj
      Reviewed By: simonpj
      Subscribers: simonpj, rwbarton, thomie
      GHC Trac Issues: #10816
      Differential Revision: https://phabricator.haskell.org/D4077
    • Simon Peyton Jones's avatar
      Remove wc_insol from WantedConstraints · f20cf982
      Simon Peyton Jones authored
      This patch is a pure refactoring, which I've wanted to do for
      some time.  The main payload is
      * Remove the wc_insol field from WantedConstraints;
        instead put all the insolubles in wc_simple
      * Remove inert_insols from InertCans
        Instead put all the insolubles in inert_irreds
      * Add a cc_insol flag to CIrredCan, to record that
        the constraint is definitely insoluble
      * Quite a bit of code gets slightly simpler
      * Fewer concepts to keep separate
      * Insolubles don't happen at all in production code that is
        just being recompiled, so previously there was a lot of
        moving-about of empty sets
      A couple of error messages acutally improved.
    • Simon Peyton Jones's avatar
      Delete two unused functions · 3e44562a
      Simon Peyton Jones authored
      Delete unused functions
      from TyCoRep
    • Simon Peyton Jones's avatar
      Change "cobox" to "co" in debug output · 79ae03aa
      Simon Peyton Jones authored
      These coercions are /not/ boxed, so "cobox" is positively misleading.
      And it's longer than necessary.
    • Simon Peyton Jones's avatar
      Fix over-eager error suppression in TcErrors · c81f66cc
      Simon Peyton Jones authored
      See Note [Given insolubles] in TcRnTypes
      Fixes Trac #14325.
    • Simon Peyton Jones's avatar
      Minor refactoring · 461c8316
      Simon Peyton Jones authored
      I'm trying to understand Check.hs.  This patch is a very
      minor refactoring.  No change in behaviour.
    • Simon Peyton Jones's avatar
      Typos in comments only · ab1a7583
      Simon Peyton Jones authored
    • Simon Peyton Jones's avatar
      Tidy up some convoluted "child/parent" code · 7720c293
      Simon Peyton Jones authored
      In investigating something else (Trac #14307) I encountered the
      wonders of TcRnExports.lookupChildrenExport, and the data
      type ChildLookupResult.
      I managed to remove the NameErr constructor from ChildLookupResult,
      and simplify the code significantly at the same time.
      This is just refactoring; no change in behaviour.
  6. 10 Oct, 2017 1 commit
    • Tamar Christina's avatar
      Split SysTools up some · e51e565d
      Tamar Christina authored
      SysTools and DriverTools have an annoying mutual dependency.
      They also each contain pieces of the linker. In order for
      changes to be shared between the library and the exe linking
      code this dependency needs to be broken in order to avoid
      using hs-boot files.
      Reviewers: austin, bgamari, erikd
      Reviewed By: bgamari
      Subscribers: rwbarton, thomie
      Differential Revision: https://phabricator.haskell.org/D4071
  7. 07 Oct, 2017 3 commits
    • Ryan Scott's avatar
      Simply Data instance context for AmbiguousFieldOcc · f337a208
      Ryan Scott authored
      The current, verbose instance context can be compacted into
      `DataId pass`. Indeed, that's what most of the `Data` instances
      in this module already do, so this just makes things consistent.
    • Ryan Scott's avatar
      Fix #14320 by looking through HsParTy in more places · f1d2db68
      Ryan Scott authored
      GHC was needlessly rejecting GADT constructors' type
      signatures that were surrounded in parentheses due to the fact that
      `splitLHsForAllTy` and `splitLHsQualTy` (which are used to check as
      part of checking if GADT constructor return types are correct)
      weren't looking through parentheses (i.e., `HsParTy`). This is
      easily fixed, though.
      Test Plan: make test TEST=T14320
      Reviewers: austin, bgamari
      Reviewed By: bgamari
      Subscribers: rwbarton, thomie
      GHC Trac Issues: #14320
      Differential Revision: https://phabricator.haskell.org/D4072
    • Ryan Scott's avatar
      Incorporate changes from #11721 into Template Haskell · 341d3a78
      Ryan Scott authored
      #11721 changed the order of type variables in GADT
      constructor type signatures, but these changes weren't reflected in
      Template Haskell reification of GADTs. Let's do that.
      Along the way, I:
      * noticed that the `T13885` test was claiming to test TH reification
        of GADTs, but the reified data type wasn't actually a GADT! Since
        this patch touches that part of the codebase, I decided to fix
      * incorporated some feedback from @simonpj in
        https://phabricator.haskell.org/D3687#113566. (These changes alone
        don't account for any different in behavior.)
      Test Plan: make test TEST=T11721_TH
      Reviewers: goldfire, austin, bgamari, simonpj
      Reviewed By: goldfire, bgamari, simonpj
      Subscribers: rwbarton, thomie, simonpj
      GHC Trac Issues: #11721
      Differential Revision: https://phabricator.haskell.org/D4070
  8. 06 Oct, 2017 1 commit
  9. 05 Oct, 2017 2 commits
  10. 04 Oct, 2017 1 commit