This project is mirrored from https://gitlab.haskell.org/ghc/ghc.git. Pull mirroring failed .
Repository mirroring has been paused due to too many failed attempts. It can be resumed by a project maintainer.
Last successful update .
  1. 17 Dec, 2015 1 commit
  2. 11 Dec, 2015 1 commit
    • eir@cis.upenn.edu's avatar
      Add kind equalities to GHC. · 67465497
      eir@cis.upenn.edu authored
      This implements the ideas originally put forward in
      "System FC with Explicit Kind Equality" (ICFP'13).
      
      There are several noteworthy changes with this patch:
       * We now have casts in types. These change the kind
         of a type. See new constructor `CastTy`.
      
       * All types and all constructors can be promoted.
         This includes GADT constructors. GADT pattern matches
         take place in type family equations. In Core,
         types can now be applied to coercions via the
         `CoercionTy` constructor.
      
       * Coercions can now be heterogeneous, relating types
         of different kinds. A coercion proving `t1 :: k1 ~ t2 :: k2`
         proves both that `t1` and `t2` are the same and also that
         `k1` and `k2` are the same.
      
       * The `Coercion` type has been significantly enhanced.
         The documentation in `docs/core-spec/core-spec.pdf` reflects
         the new reality.
      
       * The type of `*` is now `*`. No more `BOX`.
      
       * Users can write explicit kind variables in their code,
         anywhere they can write type variables. For backward compatibility,
         automatic inference of kind-variable binding is still permitted.
      
       * The new extension `TypeInType` turns on the new user-facing
         features.
      
       * Type families and synonyms are now promoted to kinds. This causes
         trouble with parsing `*`, leading to the somewhat awkward new
         `HsAppsTy` constructor for `HsType`. This is dispatched with in
         the renamer, where the kind `*` can be told apart from a
         type-level multiplication operator. Without `-XTypeInType` the
         old behavior persists. With `-XTypeInType`, you need to import
         `Data.Kind` to get `*`, also known as `Type`.
      
       * The kind-checking algorithms in TcHsType have been significantly
         rewritten to allow for enhanced kinds.
      
       * The new features are still quite experimental and may be in flux.
      
       * TODO: Several open tickets: #11195, #11196, #11197, #11198, #11203.
      
       * TODO: Update user manual.
      
      Tickets addressed: #9017, #9173, #7961, #10524, #8566, #11142.
      Updates Haddock submodule.
      67465497
  3. 04 Dec, 2015 1 commit
    • Simon Peyton Jones's avatar
      Case-of-empty-alts is trivial (Trac #11155) · 1c9fd3f1
      Simon Peyton Jones authored
      As you'll see from Trac #11155, the code generator was confused
      by a binding let x = y in ....   Why did that happen? Because of
      a (case y of {}) expression on the RHS.
      
      The right thing is just to expand what a "trivial" expression is.
      
      See Note [Empty case is trivial] in CoreUtils.
      1c9fd3f1
  4. 30 Jul, 2015 1 commit
    • Simon Peyton Jones's avatar
      Define DsUtils.mkCastDs and use it · 92d25672
      Simon Peyton Jones authored
      This change avoids a spurious WARNing from mkCast.  In the output of
      the desugarer (only, I think) we can have a cast where the type of the
      expression and cast don't syntactically match, because of an enclosing
      type-let binding.
      92d25672
  5. 16 Jul, 2015 2 commits
  6. 18 Jun, 2015 1 commit
  7. 01 Jun, 2015 1 commit
  8. 24 Mar, 2015 2 commits
  9. 23 Mar, 2015 4 commits
  10. 18 Mar, 2015 1 commit
  11. 10 Feb, 2015 1 commit
  12. 04 Feb, 2015 1 commit
    • Simon Marlow's avatar
      Fix a profiling bug · daed18c3
      Simon Marlow authored
      Summary:
      We were erroneously discarding SCCs on function-typed variables.
      These can affect the call stack, so we have to retain them.  The bug
      was introduced during the recent SourceNote refactoring.
      
      This is an alternative to the fix proposed in D616.  I also added the
      scc005 test from that diff, which works with this change.
      
      While I was here, I also fixed up the other profiling tests, marking a
      few as expect_broken_for(10037) where the opt/unopt output differs in
      non-fatal ways.
      
      Test Plan: profiling tests
      
      Reviewers: scpmw, ezyang, austin
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D636
      
      GHC Trac Issues: #10007
      daed18c3
  13. 19 Jan, 2015 1 commit
  14. 23 Dec, 2014 2 commits
    • Simon Peyton Jones's avatar
      Eliminate so-called "silent superclass parameters" · a6f0f5ab
      Simon Peyton Jones authored
      The purpose of silent superclass parameters was to solve the
      awkward problem of superclass dictinaries being bound to bottom.
      See THE PROBLEM in Note [Recursive superclasses] in TcInstDcls
      
      Although the silent-superclass idea worked,
      
        * It had non-local consequences, and had effects even in Haddock,
          where we had to discard silent parameters before displaying
          instance declarations
      
        * It had unexpected peformance costs, shown up by Trac #3064 and its
          test case.  In monad-transformer code, when constructing a Monad
          dictionary you had to pass an Applicative dictionary; and to
          construct that you neede a Functor dictionary. Yet these extra
          dictionaries were often never used.  (All this got much worse when
          we added Applicative as a superclass of Monad.) Test T3064
          compiled *far* faster after silent superclasses were eliminated.
      
        * It introduced new bugs.  For example SilentParametersOverlapping,
          T5051, and T7862, all failed to compile because of instance overlap
          directly because of the silent-superclass trick.
      
      So this patch takes a new approach, which I worked out with Dimitrios
      in the closing hours before Christmas.  It is described in detail
      in THE PROBLEM in Note [Recursive superclasses] in TcInstDcls.
      
      Seems to work great!
      
      Quite a bit of knock-on effect
      
       * The main implementation work is in tcSuperClasses in TcInstDcls
         Everything else is fall-out
      
       * IdInfo.DFunId no longer needs its n-silent argument
         * Ditto IDFunId in IfaceSyn
         * Hence interface file format changes
      
       * Now that DFunIds do not have silent superclass parameters, printing
         out instance declarations is simpler. There is tiny knock-on effect
         in Haddock, so that submodule is updated
      
       * I realised that when computing the "size of a dictionary type"
         in TcValidity.sizePred, we should be rather conservative about
         type functions, which can arbitrarily increase the size of a type.
         Hence the new datatype TypeSize, which has a TSBig constructor for
         "arbitrarily big".
      
       * instDFunType moves from TcSMonad to Inst
      
       * Interestingly, CmmNode and CmmExpr both now need a non-silent
         (Ord r) in a couple of instance declarations. These were previously
         silent but must now be explicit.
      
       * Quite a bit of wibbling in error messages
      a6f0f5ab
    • Sergei Trofimovich's avatar
      dwarf: sync getIdFromTrivialExpr with exprIsTrivial (test break028 and others) · 30fdf86e
      Sergei Trofimovich authored
      Summary:
      The bug manifests when built with
          EXTRA_HC_OPTS += -g
      
      +++ ./ghci.debugger/scripts/break028.run.stderr 2014-12-19 23:08:46.199876621 +0000
      @@ -0,0 +1,11 @@
      +ghc-stage2: panic! (the 'impossible' happened)
      +  (GHC version 7.9.20141219 for x86_64-unknown-linux):
      +       getIdFromTrivialExpr x_alJ
      +
      +Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug
      
      
      +
      +
      +<interactive>:3:1: Not in scope: ‘g’
      +
      +<interactive>:3:3: Not in scope: data constructor ‘False’
      Signed-off-by: default avatarSergei Trofimovich <siarheit@google.com>
      
      Reviewers: simonmar, austin, scpmw
      
      Reviewed By: scpmw
      
      Subscribers: carter, thomie
      
      Differential Revision: https://phabricator.haskell.org/D580
      30fdf86e
  15. 17 Dec, 2014 1 commit
    • Simon Peyton Jones's avatar
      Improve TidyPgm.hasCafRefs to account for Integer literals (Trac #8525) · 6b11bab6
      Simon Peyton Jones authored
      See Note [Disgusting computation of CafRefs] in TidyPgm.
      
      Also affects CoreUtils.rhsIsStatic.
      
      The real solution here is to compute CAF and arity information
      from the STG-program, and feed it back to tidied program for
      the interface file and later GHCi clients.  A battle for another
      day.
      
      But at least this commit reduces the number of gratuitous CAFs, and
      hence SRT entries.  And kills off a batch of ASSERT failures.
      6b11bab6
  16. 16 Dec, 2014 2 commits
    • Peter Wortmann's avatar
      Annotation linting · 07d604fa
      Peter Wortmann authored
      This adds a way by which we can make sure that the Core passes treat
      annotations right: We run them twice and compare the results.
      
      The main problem here is that Core equivalence is awkward: We do not
      want the comparison to care about the order of, say, top-level or
      recursive bindings. This is important even if GHC generally generates
      the bindings in the right order - after all, if something goes wrong
      we don't want linting to dump out the whole program as the offense.
      
      So instead we do some heuristic matching - first greedily match
      everything that's easy, then match the rest by label order. This
      should work as long as GHC generates the labels in roughly the same
      order for both pass runs.  In practice it seems to work alright.
      
      We also check that IdInfos match, as this might cause hard-to-spot
      bugs down the line (I had at least one bug because unfolding guidance
      didn't match!). We especially check unfoldings up until the point
      where it might get us into an infinite loop.
      
      (From Phabricator D169)
      07d604fa
    • Peter Wortmann's avatar
      Source notes (Core support) · 993975d3
      Peter Wortmann authored
      This patch introduces "SourceNote" tickishs that link Core to the
      source code that generated it. The idea is to retain these source code
      links throughout code transformations so we can eventually relate
      object code all the way back to the original source (which we can,
      say, encode as DWARF information to allow debugging).  We generate
      these SourceNotes like other tickshs in the desugaring phase. The
      activating command line flag is "-g", consistent with the flag other
      compilers use to decide DWARF generation.
      
      Keeping ticks from getting into the way of Core transformations is
      tricky, but doable. The changes in this patch produce identical Core
      in all cases I tested -- which at this point is GHC, all libraries and
      nofib. Also note that this pass creates *lots* of tick nodes, which we
      reduce somewhat by removing duplicated and overlapping source
      ticks. This will still cause significant Tick "clumps" - a possible
      future optimization could be to make Tick carry a list of Tickishs
      instead of one at a time.
      
      (From Phabricator D169)
      993975d3
  17. 03 Dec, 2014 1 commit
  18. 19 Sep, 2014 1 commit
  19. 07 Aug, 2014 3 commits
    • Gabor Greif's avatar
      Fix some typos in recent comments/notes · 18ac546d
      Gabor Greif authored
      18ac546d
    • Simon Peyton Jones's avatar
      Extensive Notes on can_fail and has_side_effects · ab6480b8
      Simon Peyton Jones authored
      In fixing Trac #9390 I discovered that I *still* didn't really understand
      what the can_fail and has_side_effects properties of a PrimOp mean, precisely.
      
      The big new things I learned are
      
      * has_side_effects needs to be true only of *write* effects,
        Reads (which are, strictly speaking, effects) don't matter here.
      
      * has_side_effects must be true of primops that can throw a synchronous
        Haskell exception (eg raiseIO#)
      
      * can_fail is true only of primops that can cause an *unchecked* (not
        Haskell) system exception, like divide by zero, or accessing memory
        out of range through an array read or write.
      
      I've documented all this now.  The changes in this patch are only
      in comments.
      ab6480b8
    • Simon Peyton Jones's avatar
      Comments and white space · 61baf710
      Simon Peyton Jones authored
      61baf710
  20. 11 Jun, 2014 1 commit
    • eir@cis.upenn.edu's avatar
      Fix #9062. · e79e2c39
      eir@cis.upenn.edu authored
      Removed (pprEqPred (coercionKind co)) in favor of
      (pprType (coercionType co)).
      
      Also had to make "~R#" a *symbolic* identifier and BuiltInSyntax
      to squelch prefix notation and module prefixes in output. These
      changes are both sensible independent of #9062.
      e79e2c39
  21. 15 May, 2014 1 commit
    • Herbert Valerio Riedel's avatar
      Add LANGUAGE pragmas to compiler/ source files · 23892440
      Herbert Valerio Riedel authored
      In some cases, the layout of the LANGUAGE/OPTIONS_GHC lines has been
      reorganized, while following the convention, to
      
      - place `{-# LANGUAGE #-}` pragmas at the top of the source file, before
        any `{-# OPTIONS_GHC #-}`-lines.
      
      - Moreover, if the list of language extensions fit into a single
        `{-# LANGUAGE ... -#}`-line (shorter than 80 characters), keep it on one
        line. Otherwise split into `{-# LANGUAGE ... -#}`-lines for each
        individual language extension. In both cases, try to keep the
        enumeration alphabetically ordered.
        (The latter layout is preferable as it's more diff-friendly)
      
      While at it, this also replaces obsolete `{-# OPTIONS ... #-}` pragma
      occurences by `{-# OPTIONS_GHC ... #-}` pragmas.
      23892440
  22. 08 May, 2014 1 commit
  23. 17 Dec, 2013 1 commit
  24. 12 Dec, 2013 1 commit
  25. 29 Nov, 2013 1 commit
  26. 27 Nov, 2013 1 commit
  27. 21 Nov, 2013 1 commit
  28. 12 Nov, 2013 1 commit
  29. 23 Sep, 2013 1 commit
  30. 29 Aug, 2013 2 commits