1. 27 Jun, 2015 1 commit
  2. 26 Jun, 2015 25 commits
    • Simon Peyton Jones's avatar
      Test Trac #10524 · 0e1e7987
      Simon Peyton Jones authored
      0e1e7987
    • Simon Peyton Jones's avatar
      Improve error message for Typeable k (T k) · ceb3c844
      Simon Peyton Jones authored
      GHC can't yest build a TypeRep for a type involving kind variables.
      (We await kinds = types for that.)  But the error message was terrible,
      as fixing #10524 reminded me.
      
      This improves it a lot.
      ceb3c844
    • Simon Peyton Jones's avatar
      Better tracing and tiny refactoring · a64a26f0
      Simon Peyton Jones authored
      a64a26f0
    • Simon Peyton Jones's avatar
      Make fvType ignore kinds · 8e347839
      Simon Peyton Jones authored
      TcValidity.fvTypes works in partnership with sizeTypes, and
      hence should ignore kinds in exactly the same way.  It wasn't
      doing so, which meant that validDerivPred said "No" when it
      should have said "Yes". That led to the bug reported in
      Trac #10524 comment:7.
      
      The error message is pretty terrible
        No instance for (Typeable T)
      but I'll fix that next
      8e347839
    • Simon Peyton Jones's avatar
      Kill off sizePred · 614ba3c5
      Simon Peyton Jones authored
      It really isn't needed, and life is simpler without
      614ba3c5
    • Simon Peyton Jones's avatar
      closeOverKinds *before* oclose in coverage check · 7c07cf16
      Simon Peyton Jones authored
      Combining functional dependencies with kind-polymorphism is
      devilishly tricky!  It's all documented in
          Note [Closing over kinds in coverage]
      
      Fixes Trac #10564
      7c07cf16
    • Simon Peyton Jones's avatar
      Improve CPR behavior for strict constructors · 0696fc6d
      Simon Peyton Jones authored
      When working on Trac #10482 I noticed that we could give constructor
      arguments the CPR property if they are use strictly.
      
      This is documented carefully in
          Note [CPR in a product case alternative]
      and also
          Note [Initial CPR for strict binders]
      
      There are a bunch of intersting examples in
          Note [CPR examples]
      which I have added to the test suite as T10482a.
      
      I also added a test for #10482 itself.
      0696fc6d
    • Simon Peyton Jones's avatar
      Small doc fixes · caf9d427
      Simon Peyton Jones authored
      caf9d427
    • Simon Peyton Jones's avatar
      Comments only · cbd9278c
      Simon Peyton Jones authored
      cbd9278c
    • thomie's avatar
      GHCi docs: layout rule is respected inside :{ :} · 7c8ffd3d
      thomie authored
      Summary:
      I don't know if or when this changed, but the documentation on :{ :}
      (multiline input) seems out of date. Layout rule works fine. I added a
      regression test.
      
      Reviewers: austin
      
      Subscribers: thomie, bgamari
      
      Differential Revision: https://phabricator.haskell.org/D1013
      7c8ffd3d
    • Simon Marlow's avatar
      Fix deadlock (#10545) · 111ba4be
      Simon Marlow authored
      yieldCapability() was not prepared to be called by a Task that is not
      either a worker or a bound Task.  This could happen if we ended up in
      yieldCapability via this call stack:
      
      performGC()
      scheduleDoGC()
      requestSync()
      yieldCapability()
      
      and there were a few other ways this could happen via requestSync.
      The fix is to handle this case in yieldCapability(): when the Task is
      not a worker or a bound Task, we put it on the returning_workers
      queue, where it will be woken up again.
      
      Summary of changes:
      
      * `yieldCapability`: factored out subroutine waitForWorkerCapability`
      * `waitForReturnCapability` renamed to `waitForCapability`, and
        factored out subroutine `waitForReturnCapability`
      * `releaseCapabilityAndQueue` worker renamed to `enqueueWorker`, does
        not take a lock and no longer tests if `!isBoundTask()`
      * `yieldCapability` adjusted for refactorings, only change in behavior
        is when it is not a worker or bound task.
      
      Test Plan:
      * new test concurrent/should_run/performGC
      * validate
      
      Reviewers: niteria, austin, ezyang, bgamari
      
      Subscribers: thomie, bgamari
      
      Differential Revision: https://phabricator.haskell.org/D997
      
      GHC Trac Issues: #10545
      111ba4be
    • Simon Marlow's avatar
      Fix for crash in setnumcapabilities001 · be0ce871
      Simon Marlow authored
      getNewNursery() was unconditionally incrementing next_nursery, which
      is normally fine but it broke an assumption in
      storageAddCapabilities().  This manifested as an occasional crash in
      the setnumcapabilities001 test.
      be0ce871
    • Simon Peyton Jones's avatar
      Tiny refactor plus comments · 0aaea5b8
      Simon Peyton Jones authored
      0aaea5b8
    • Simon Peyton Jones's avatar
      Error message wibbles from out-of-scope changes · b98ff25f
      Simon Peyton Jones authored
      The patch "Treat out-of-scope variables as holes" makes
      lots of error messages change a bit. This patch has all
      the change.
      b98ff25f
    • Simon Peyton Jones's avatar
      Treat out-of-scope variables as holes · fb7b6922
      Simon Peyton Jones authored
      This patch implements the idea in Trac #10569.
      
      * An out-of-scope variable is treated as a typed expression
        hole.
      
      * That is, we don't report it in the type checker, not the
        renamer, and we when we do report it, we give its type.
      
      * Moreover, we can defer the error to runtime with
        -fdefer-typed-holes
      
      In implementation terms:
      
      * The renamer turns an unbound variable into a HsUnboundVar
      
      * The type checker emits a Hole constraint for a
        HsUnboundVar, and turns it back into a HsVar
      
      It was a bit painful to implement because a whole raft of
      error messages change slightly.  But there was absolutely
      nothing hard in principle.
      
      Holes are reported with a bunch of possibly-useful context,
      notably the "relevant bindings".  I found that this was
      distracting clutter in the very common case of a mis-typed
      variable that is only accidentally not in scope, so I've
      arranged to print the context information only for true holes,
      that is ones starting with an underscore.
      
      Unbound data constructors use in patterns, like
        f (D x) = x
      are still reportd by the renamer, and abort compilation
      before type checking.
      fb7b6922
    • Simon Peyton Jones's avatar
      Get rid of irrelevant impredicative polymoprhism · 95fc6d59
      Simon Peyton Jones authored
      These tests aren't about impredicativity
      95fc6d59
    • Simon Peyton Jones's avatar
      Get rid of irrlevant result type signature · 2f16a3b8
      Simon Peyton Jones authored
      Result type-sigs are now illegal, but that's not what this test
      is about
      2f16a3b8
    • Simon Peyton Jones's avatar
      Add module header to test · 97e313cd
      Simon Peyton Jones authored
      ..to avoid irrelevant 'main is not defined' error message
      97e313cd
    • Simon Peyton Jones's avatar
      Don't float out alpha[sig] ~ Int · b69dc731
      Simon Peyton Jones authored
      This is just a small twiddle to TcSimplify.usefulToFloat
      See Note [Which equalities to float].
      b69dc731
    • Simon Peyton Jones's avatar
      Fix addDataConStrictness · 9014a7ee
      Simon Peyton Jones authored
      See Note [Add demands for strict constructors].
      
      The new bit is the test for isAbsDmd in addDataConStrictness.
      There was a cryptic note that said that this function
      should add a seqDmd even for Absent arguments, but that
      is definitely a bad thing (as the Note now says), causing
      unused arguments to be passed to the worker.
      
      Easy fix!
      9014a7ee
    • Simon Peyton Jones's avatar
      Minor fix to free-vars in RnTypes · cc0dba1e
      Simon Peyton Jones authored
      A type wild-card should't appear in the "uses"
      free-variable set.
      cc0dba1e
    • Simon Peyton Jones's avatar
      Allow recursive unwrapping of data families · 0b7e538a
      Simon Peyton Jones authored
      When doing strictness analysis, we need to look inside products.
      To avoid unpacking infinitely, we must be careful about
      infinite types.  That in turn is controlled by TyCon.checkRecTc.
      
      For data families like
         data instance T (a,b) = MkT a (T b)
      we want to unpack the thing recursively for types like
        T (Int, (Int, (Int, Int)))
      
      This patch elaborates the checkRecTc mechanism in TyCon, to
      maintain a *count* of how many times a TyCon has shown up,
      rather than just a boolean.
      
      A simple change, and a useful one.  Fixes Trac #10482.
      0b7e538a
    • Simon Peyton Jones's avatar
      Use a Representaional coercion for data families · ff8a6716
      Simon Peyton Jones authored
      When we have
        data instance T (a,b) = MkT a b
      we make a represntation type
        data TPair a b = MkT a b
      plus an axiom to connect the two
        ax a b :: T (a,b)  ~R  TPair a b
      
      Previously this was a Nominal equality, and that worked ok
      but seems illogical since Nominal equalities are between
      types that the programmer thinks of as being equal.  But
      TPair is not visible to the programmer; indeed we call it
      the "representation TyCon".  So a Representational equality
      seems more suitable here.
      ff8a6716
    • Simon Peyton Jones's avatar
      Improve pretty-printing for CoPat · 9195927d
      Simon Peyton Jones authored
      9195927d
    • Simon Peyton Jones's avatar
      White space only · 3edc1868
      Simon Peyton Jones authored
      3edc1868
  3. 25 Jun, 2015 4 commits
  4. 24 Jun, 2015 3 commits
  5. 23 Jun, 2015 4 commits
    • thomie's avatar
      Build system: delete unused variables in config.mk.in · 95d50310
      thomie authored
      GhcStage1DefaultNewCodegen, GhcStage2DefaultNewCodegen,
      GhcStage3DefaultNewCodegen and GhcCompilerWays are not used anywhere.
      95d50310
    • Edward Z. Yang's avatar
      Make $1 in $1_$2_$3_FOO actually be directory. · 73a6265e
      Edward Z. Yang authored
      
      
      Summary:
      Previously, we used $1_$2_PACKAGE_KEY to parametrize $1.  But the
      documentation says that $1 should be the directory...  and we're now
      putting the libraries in $1_$2_LIB_NAME.  So use /that/.  This is just
      alpha-renaming, so as long as we're consistent, there's no material
      difference.)
      
      I also fixed a bug of a package ID calculation which I missed first
      time around, which was tickled by this change.
      
      BTW, this means DEP_KEYS and TRANSITIVE_DEP_KEYS are unused, so
      remove them from ghc-cabal.
      Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
      
      Test Plan: validate
      
      Reviewers: austin
      
      Subscribers: thomie, bgamari
      
      Differential Revision: https://phabricator.haskell.org/D1010
      73a6265e
    • Sergei Trofimovich's avatar
      powerpc: add basic support for PLT relocations (#10402) · c0847967
      Sergei Trofimovich authored
      Commit a93ab43a
      
      
      enabled support for proper PIC relocations from
      assembler.
      
      Commit adds support for relocations of type:
          R_PPC_REL16_HI
          R_PPC_REL16_HA
          R_PPC_REL16_LO
          R_PPC_PLTREL24
      
      They are used only when GHC is built in
          DYNAMIC_GHC_PROGRAMS = NO
      mode.
      
      Verified by running the following test:
      
          // cat a.c
          #include <stdio.h>
      
          void ffi_a_hello (int i) {
              fprintf (stderr, "WEEEEEEEE: i=%d\n", i);
          }
      
          -- cat A.hs
          {-# LANGUAGE ForeignFunctionInterface #-}
          module A where
      
          import Foreign.C
      
          foreign import ccall "ffi_a_hello" a :: CInt -> IO ()
      
          # ghc -fPIC -c a.c -fforce-recomp
          # ghc -fPIC -c A.hs -fforce-recomp
          # ghc --interactive ./a.o A
          ...
          *A> a 42
          WEEEEEEEE: i=42
      See gory details in Trac #10402.
      Signed-off-by: default avatarColin Watson <cjwatson@debian.org>
      Signed-off-by: default avatarSergei Trofimovich <siarheit@google.com>
      
      Reviewed By: bgamari, austin
      
      Differential Revision: https://phabricator.haskell.org/D996
      
      GHC Trac Issues: #10402
      c0847967
    • Simon Peyton Jones's avatar
      Further elaborate Trac #10403 test · 55843f1c
      Simon Peyton Jones authored
      Adding app1, app2, as requested in the ticket
      55843f1c
  6. 22 Jun, 2015 3 commits