1. 09 May, 2015 2 commits
  2. 08 May, 2015 4 commits
  3. 07 May, 2015 4 commits
  4. 06 May, 2015 11 commits
    • Austin Seipp's avatar
      Revert "API Annotations : add Locations in hsSyn were layout occurs" · 97d320f5
      Austin Seipp authored
      This reverts commit fb54b2c1.
      
      As Alan pointed out, this will make cherry picking a lot harder until
      7.10.2, so lets back it out until after the release.
      97d320f5
    • Austin Seipp's avatar
      Revert "ApiAnnotations : Nested forall loses forall annotation" · f34c0728
      Austin Seipp authored
      This reverts commit 81030ede.
      
      Alan is abandoning this approach in favor of D836.
      f34c0728
    • Alan Zimmerman's avatar
      ApiAnnotations : Nested forall loses forall annotation · 81030ede
      Alan Zimmerman authored
      When parsing
      
          {-# LANGUAGE ScopedTypeVariables #-}
      
          extremumNewton :: forall tag. forall tag1.
                             tag -> tag1 -> Int
          extremumNewton = undefined
      
      The parser attaches an AnnForall to the second forall, which appears as
      a nested HsForAllTy.
      
      Somewhere this nesting is flattened, and the tyvarbndrs are collapsed
      into a single HsForAllTy. In this process the second AnnForAll loses its
      anchor in the AST.
      
      Reviewed By: austin
      
      Differential Revision: https://phabricator.haskell.org/D833
      
      GHC Trac Issues: #10278
      81030ede
    • Alan Zimmerman's avatar
      ApiAnnotations : quoted type variables missing leading quote · 15aafc7f
      Alan Zimmerman authored
      The HsOpTy can be constructed for a promoted type operator, in which case it has the following form
      
              | btype SIMPLEQUOTE qconop type     { sLL $1 $> $ mkHsOpTy $1 $3 $4 }
              | btype SIMPLEQUOTE varop  type     { sLL $1 $> $ mkHsOpTy $1 $3 $4 }
      
      The SIMPLEQUOTE does not get an annotation, so cannot be reproduced via the API Annotations.
      
      Also, in
      
      splice_exp :: { LHsExpr RdrName }
              : TH_ID_SPLICE          { sL1 $1 $ mkHsSpliceE
                                              (sL1 $1 $ HsVar (mkUnqual varName
                                                              (getTH_ID_SPLICE $1))) }
              | '$(' exp ')'          {% ams (sLL $1 $> $ mkHsSpliceE $2) [mo $1,mc $3] }
              | TH_ID_TY_SPLICE       { sL1 $1 $ mkHsSpliceTE
                                              (sL1 $1 $ HsVar (mkUnqual varName
                                                           (getTH_ID_TY_SPLICE $1))) }
              | '$$(' exp ')'         {% ams (sLL $1 $> $ mkHsSpliceTE $2) [mo $1,mc $3] }
      
      the TH_ID_SPLICE and TH_ID_TY_SPLICE positions are lost.
      
      Reviewed By: austin
      
      Differential Revision: https://phabricator.haskell.org/D825
      
      GHC Trac Issues: #10268
      15aafc7f
    • Matthew Pickering's avatar
      Correct parsing of lifted empty list constructor · caeae1a3
      Matthew Pickering authored
      See #10299
      
      Previously `'[]` was parsed to a `HsTyVar` rather than a
      `HsExplicitListTy`. This patch fixes the
      shift-reduce conflict which caused this problem.
      
      Reviewed By: alanz, austin
      
      Differential Revision: https://phabricator.haskell.org/D840
      caeae1a3
    • Alan Zimmerman's avatar
      API Annotations : add Locations in hsSyn were layout occurs · fb54b2c1
      Alan Zimmerman authored
      At the moment ghc-exactprint, which uses the GHC API Annotations to
      provide a framework for roundtripping Haskell source code with optional
      AST edits, has to implement a horrible workaround to manage the points
      where layout needs to be captured.
      
      These are
      
          MatchGroup
          HsDo
          HsCmdDo
          HsLet
          LetStmt
          HsCmdLet
          GRHSs
      
      To provide a more natural representation, the contents subject to layout
      rules need to be wrapped in a SrcSpan.
      
      This commit does this.
      
      Trac ticket #10250
      
      Reviewed By: austin
      
      Differential Revision: https://phabricator.haskell.org/D815
      
      GHC Trac Issues: #10250
      fb54b2c1
    • bernalex's avatar
      base: Fix confusing docs typo · fa0474da
      bernalex authored
      Signed-off-by: bernalex's avatarAlexander Berntsen <alexander@plaimi.net>
      
      Reviewed By: austin
      
      Differential Revision: https://phabricator.haskell.org/D872
      fa0474da
    • Javran Cheng's avatar
      rts: add "-no-rtsopts-suggestions" option · 477f514f
      Javran Cheng authored
      Depends on D767
      
      Setting this flag prevents RTS from giving RTS suggestions like "Use
      `+RTS -Ksize -RTS' to increase it."
      
      According to the comment @rwbarton made in #9579, sometimes "+RTS"
      suggestions don't make sense (e.g. when the program is precompiled and
      installed through package managers), we can encourage people to
      distribute binaries with either "-no-rtsopts-suggestions" or "-rtsopts".
      
      Reviewed By: erikd, austin
      
      Differential Revision: https://phabricator.haskell.org/D809
      
      GHC Trac Issues: #9579
      477f514f
    • Zejun Wu's avatar
      Retain ic_monad and ic_int_print from external packages after load · 03c4893e
      Zejun Wu authored
      Retain ic_monad and ic_int_print in InteractiveContext after load
      when they are defined in external packages. This is supposed to be
      the desired behavior that the interactive-print and setGHCiMonad
      will survive after :cd, :add, :load, :reload and :set in GHCi.
      
      Test Plan:
      Install a interactive-print function and GHCi monad from extenal
      pacakge. Try :cd, :load and other commands, make sure that the
      interactive-print function and GHCi monad always keep the same.
      
      Reviewed By: simonmar
      
      Differential Revision: https://phabricator.haskell.org/D867
      03c4893e
    • Vikraman Choudhury's avatar
      Fix typo: identifer -> identifier · 458a97b8
      Vikraman Choudhury authored
      I noticed this typo while using template haskell.
      Signed-off-by: default avatarVikraman Choudhury <git@vikraman.org>
      
      Test Plan:
      ```
      λ> :set -XTemplateHaskell
      λ> :m +Language.Haskell.TH
      λ> data Foo = Foo
      λ> $(conE ''Foo)
      <interactive>:9:9:
          Type constructor ‘Foo’ used where a value identifier was expected
          In the expression: Foo
          In an equation for ‘f’: f = Foo
      
      ```
      
      Reviewed By: bgamari
      
      Differential Revision: https://phabricator.haskell.org/D871
      458a97b8
    • Christiaan Baaij's avatar
      Normalise type families in the type of an expression · f7daf5af
      Christiaan Baaij authored
      Before, the type of an expression, and the type of a variable
      binding that expression used to be different in GHCi. The
      reason being that types of bound variables were already normalised.
      Now, both are normalised.
      
      This implements the suggestions as given in Trac #10321
      Also adds an expected output for test T10321
      
      Reviewed By: goldfire, simonpj
      
      Differential Revision: https://phabricator.haskell.org/D870
      
      GHC Trac Issues: #10321
      f7daf5af
  5. 05 May, 2015 2 commits
  6. 04 May, 2015 5 commits
  7. 01 May, 2015 6 commits
    • Simon Peyton Jones's avatar
      Move IP, Symbol, Nat to ghc-prim · 2f6a0ac7
      Simon Peyton Jones authored
      This motivation is to declare class IP much earlier (in ghc-prim),
      so that implicit parameters (which depend on IP) is available
      to library code, notably the 'error' function.
      
      * Move class IP from base:GHC.IP
                      to ghc-prim:GHC.Classes
      * Delete module GHC.IP from base
      
      * Move types Symbol and Nat
            from base:GHC.TypeLits
            to ghc-prim:GHC.Types
      
      There was a name clash in GHC.RTS.Flags, where I renamed
      the local type Nat to RtsNat.
      2f6a0ac7
    • Simon Peyton Jones's avatar
      Kill off the default types in ghc-prim · de5d022e
      Simon Peyton Jones authored
      We were trying to load the type for Integer to do defaulting
      in ghc-prim, but it's simply not available at that time.
      de5d022e
    • Simon Peyton Jones's avatar
      Make Derived NomEq rewrite only Derived NomEq · b626cb08
      Simon Peyton Jones authored
      See Note [Deriveds do rewrite Deriveds].  The important point
      is that we want to maintain the Note [Can-rewrite relation]
      property, lest we risk loops.
      b626cb08
    • Simon Peyton Jones's avatar
      0d715db8
    • Simon Peyton Jones's avatar
      Refactor TyCon to eliminate TupleTyCon · f6ab0f2d
      Simon Peyton Jones authored
      This makes TupleTyCon into an ordinary AlgTyCon, distinguished
      by its AlgTyConRhs, rather than a separate constructor of TyCon.
      
      It is preparatory work for making constraint tuples into classes,
      for which the ConstraintTuple tuples will have a TyConParent
      of a ClassTyCon.  Tuples didn't have this possiblity before.
      
      The patch affects other modules because I eliminated the
      unsatisfactory partial functions tupleTyConBoxity and tupleTyConSort.
      And tupleTyConArity which is just tyConArity.
      f6ab0f2d
    • Simon Peyton Jones's avatar
      Comments only · bbfa0caa
      Simon Peyton Jones authored
      bbfa0caa
  8. 30 Apr, 2015 3 commits
  9. 29 Apr, 2015 3 commits
    • Simon Peyton Jones's avatar
      Typeset Backpack syntax in a figure · 54cefbd7
      Simon Peyton Jones authored
      54cefbd7
    • Simon Peyton Jones's avatar
      Test Trac #10226 · d4a926ba
      Simon Peyton Jones authored
      Fixed by the patch for #10009
      d4a926ba
    • Simon Peyton Jones's avatar
      Improve improvement in the constraint solver · a1275a76
      Simon Peyton Jones authored
      This regrettably-big patch substantially improves the way in which
      "improvement" happens in the constraint solver.  It was triggered by
      trying to crack Trac #10009, but it turned out to solve #10340 as
      well.
      
      The big picture, with several of the trickiest examples, is described
      in Note [The improvement story] in TcInteract.
      
      The major change is this:
      
      * After solving we explicitly try "improvement", by
           - making the unsolved Wanteds into Deriveds
           - allowing Deriveds to rewrite Deriveds
        This more aggressive rewriting "unlocks" some extra
        guess-free unifications.
      
      * The main loop is in TcInteract.solveSimpleWanteds, but I also ended
        up refactoring TcSimplify.simpl_loop, and its surrounding code.
      
        Notably, any insolubles from the Givens are pulled out
        and treated separately, rather than staying in the inert set
        during the solveSimpleWanteds loop.
      
      There are a lot of follow-on changes
      
      * Do not emit generate Derived improvements from Wanteds.
        This saves work in the common case where they aren't needed.
      
      * For improvement we should really do type-class reduction on Derived
        constraints in doTopReactDict.  That entailed changing the GenInst
        constructor a bit; a local and minor change
      
      * Some annoying faffing about with dropping derived constraints;
        see dropDerivedWC, dropDerivedSimples, dropDerivedInsols,
        and their Notes.
      
      * Some substantial refactoring in TcErrors.reportWanteds.
        This work wasn't strictly forced, but I got sucked into it.
        All the changes are in TcErrors.
      
      * Use TcS.unifyTyVar consistently, rather than setWantedTyBind,
        so that unifications are properly tracked.
      
      * Refactoring around solveWantedsTcM, solveWantedsAndDrop.
        They previously guaranteed a zonked result, but it's more
        straightforward for clients to zonk.
      a1275a76