1. 05 Aug, 2015 3 commits
    • Simon Peyton Jones's avatar
      Tidy up and refactor wildcard handling · 95364812
      Simon Peyton Jones authored
      When examining #10615, I found the wildcard handling hard
      to understand.  This patch refactors quite a bit, but with
      no real change in behaviour.
      
       * Split out TcIdSigInfo from TcSigInfo, as a separate type,
         like TcPatSynInfo.
      
       * Make TcIdSigInfo express more invariants by pushing the
         wildard info into TcIdSigBndr
      
       * Remove all special treatment of unification variables that arise
         from wildcards; so the TauTv of TcType.MetaInfo loses its Bool
         argument.
      
      A ton of konck on changes.  The result is significantly simpler, I think.
      95364812
    • Simon Peyton Jones's avatar
      Warn about missed specialisations for imports · a4261549
      Simon Peyton Jones authored
      This change was provoked by Trac #10720, where a missing
      INLINEABLE pragma gave very poor performance.
      
      The change is to warn when an imported function is not specialised
      in a situation where the user expects it to be.
      
      New flags
        -fwarn-missed-specialisations
        -fwarn-all-missed-specialisations
      
      Documented in user manual.
      See Note [Warning about missed specialisations]
      a4261549
    • Ryan Scott's avatar
      Add Fixity info for infix types · 575abf42
      Ryan Scott authored
      Template Haskell allows reification of fixity for infix functions and
      data constructors, and not for infix types. This adds a `Fixity` field
      to the relevant `Info` constructors that can have infix types (`ClassI`,
      `TyConI`, and `FamilyI`).
      
      I don't think that `VarI` or `PrimTyConI` can be infix, but I could be
      wrong.
      
      Test Plan: ./validate
      
      Reviewers: austin, goldfire, bgamari
      
      Reviewed By: goldfire, bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D1109
      
      GHC Trac Issues: #10704
      575abf42
  2. 04 Aug, 2015 2 commits
    • eir@cis.upenn.edu's avatar
      Test #9233 in perf/compiler/T9233 · b5f1c851
      eir@cis.upenn.edu authored
      Summary:
      Ideally, we could use Phab's numbers to set the perf
      test correctly. But even if that's not possible, then I need help
      writing my `all.T`. With the version you see here, I get the following
      
      ```
      Traceback (most recent call last):
        File "/Users/rae/Documents/ghc-valid/testsuite/driver/testlib.py", line 801, in do_test
          result = func(*[name,way] + args)
      TypeError: multimod_compile() takes exactly 4 arguments (6 given)
      ```
      
      I don't know how to fix this.
      
      Test Plan: validate
      
      Reviewers: austin, bgamari, thomie
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D1129
      
      GHC Trac Issues: #9233
      b5f1c851
    • eir@cis.upenn.edu's avatar
      Fix #10713. · f063bd54
      eir@cis.upenn.edu authored
      When doing the apartness/flattening thing, we really only need to
      eliminate non-generative tycons, not *all* families. (Data families
      are indeed generative!)
      f063bd54
  3. 03 Aug, 2015 6 commits
    • skvadrik's avatar
      Removed deprecated syntax for GADT constuctors. · 30c981e1
      skvadrik authored
      Old syntax was deprecated 6 years ago in this commit
      432b9c93 by simonpj:"New syntax for
      GADT-style record declarations, and associated refactoring" discussed
      in Trac #3306.
      
      This patch removes 2 reduce/reduce conflicts in parser. Conflicting
      productions were:
      
      ```
          gadt_constr -> con_list '::' sigtype
          gadt_constr -> oqtycon '{' fielddecls '}' '::' sigtype
      ```
      
      Recursive inlining of `con_list` and `oqtycon` helped reveal the
      conflict:
      
      ```
          gadt_constr -> '(' CONSYM ')' '::' sigtype
          gadt_constr -> '(' CONSYM ')' '{' fielddecls '}' '::' sigtype
      ```
      
      between two types of GADT constructors (second form stands for
      deprecated syntax).
      
      Test Plan: `make fasttest`, one breakage TEST="records-fail" (parse
      error instead of typecheck error due to removal of deprecated syntax).
      Updated test.
      
      Reviewers: simonmar, bgamari, austin, simonpj
      
      Reviewed By: simonpj
      
      Subscribers: thomie, mpickering, trofi
      
      Differential Revision: https://phabricator.haskell.org/D1118
      
      GHC Trac Issues: #3306
      30c981e1
    • Ben Gamari's avatar
      CmmParse: Don't force alignment in memcpy-ish operations · 64b6733e
      Ben Gamari authored
      This was initially made in 681973c3.
      Here I wanted to enforce that the alignment passed to %memcpy was a
      constant expression, as this is required by LLVM. However, this breaks
      the knot-tying done in `loopDecls`, causing T8131 to hang.
      
      Here I remove the `seq` and mark T8131 as `expect_broken` in the case
      of the NCG, which doesn't force the alignment in this case.
      
      Fixes #10664.
      64b6733e
    • Gabor Greif's avatar
      Typos in comments [skip ci] · 7ec6ffc4
      Gabor Greif authored
      7ec6ffc4
    • thomasw's avatar
      Support wild cards in data/type family instances · d9d2102e
      thomasw authored
      Handle anonymous wild cards in type or data family instance
      declarations like
      unnamed type variables. For instance (pun intented):
      
          type family F (a :: *) (b :: *) :: *
          type instance F Int _ = Int
      
      Is now the same as:
      
          type family F (a :: *) (b :: *) :: *
          type instance F Int x = Int
      
      Note that unlike wild cards in partial type signatures, no errors (or
      warnings
      with -XPartialTypeSignatures) are generated for these wild cards, as
      there is
      nothing interesting to report to the user, i.e. the inferred kind.
      
      Only anonymous wild cards are supported here, named and
      extra-constraints wild
      card are not.
      
      Test Plan: pass new tests
      
      Reviewers: goldfire, austin, simonpj, bgamari
      
      Reviewed By: simonpj, bgamari
      
      Subscribers: goldfire, thomie
      
      Differential Revision: https://phabricator.haskell.org/D1092
      
      GHC Trac Issues: #3699, #10586
      d9d2102e
    • Simon Peyton Jones's avatar
      Test Trac #10134 · 30b32f4c
      Simon Peyton Jones authored
      30b32f4c
    • Michal Terepeta's avatar
      Support MO_U_QuotRem2 in LLVM backend · 92f5385d
      Michal Terepeta authored
      This adds support for MO_U_QuotRem2 in LLVM backend.  Similarly to
      MO_U_Mul2 we use the standard LLVM instructions (in this case 'udiv'
      and 'urem') but do the computation on double the word width (e.g., for
      64-bit we will do them on 128 registers).
      
      Test Plan: validate
      
      Reviewers: rwbarton, austin, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D1100
      
      GHC Trac Issues: #9430
      92f5385d
  4. 02 Aug, 2015 1 commit
    • Alan Zimmerman's avatar
      Replace (SourceText,FastString) with StringLiteral data type · 15dd7007
      Alan Zimmerman authored
      Summary:
      Phab:D907 introduced SourceText for a number of data types, by replacing
      FastString with (SourceText,FastString). Since this has an Outputable
      instance, no warnings are generated when ppr is called on it, but
      unexpected output is generated. See Phab:D1096 for an example of this.
      
      Replace the (SourceText,FastString) tuples with a new data type,
      ```lang=hs
      data StringLiteral = StringLiteral SourceText FastString
      ```
      
      Update haddock submodule accordingly
      
      Test Plan: ./validate
      
      Reviewers: hvr, austin, rwbarton, trofi, bgamari
      
      Reviewed By: trofi, bgamari
      
      Subscribers: thomie, trofi, rwbarton, mpickering
      
      Differential Revision: https://phabricator.haskell.org/D1101
      
      GHC Trac Issues: #10692
      15dd7007
  5. 31 Jul, 2015 2 commits
  6. 30 Jul, 2015 14 commits
  7. 28 Jul, 2015 1 commit
    • Joachim Breitner's avatar
      Test case for #10698 · e343c0a7
      Joachim Breitner authored
      the expected error message is from an older version of GHC; I don’t know
      the exact error message that we should get here until the bug is
      fixed...
      e343c0a7
  8. 27 Jul, 2015 3 commits
    • Simon Peyton Jones's avatar
      Improve warnings for rules that might not fire · 2d88a531
      Simon Peyton Jones authored
      Two main things here
      
      * Previously we only warned about the "head" function of the rule,
        but actually the warning applies to any free variable on the LHS.
      
      * We now warn not only when one of these free vars can inline, but
        also if it has an active RULE (c.f. Trac #10528)
      
      See Note [Rules and inlining/other rules] in Desugar
      
      This actually shows up quite a few warnings in the libraries, notably
      in Control.Arrow, where it correctly points out that rules like
          "compose/arr"   forall f g .
                          (arr f) . (arr g) = arr (f . g)
      might never fire, because the rule for 'arr' (dictionary selection)
      might fire first.  I'm not really sure what to do here; there is some
      discussion in Trac #10595.
      
      A minor change is adding BasicTypes.pprRuleName to pretty-print RuleName.
      2d88a531
    • spinda's avatar
      Add UInfixT to TH types (fixes #10522) · 21782739
      spinda authored
      UInfixT is like UInfixE or UInfixP but for types. Template Haskell
      splices can use it to punt fixity handling to GHC when constructing
      types.
      
      UInfixT is converted in compiler/hsSyn/Convert to a right-biased tree of
      HsOpTy, which is already rearranged in compiler/rename/RnTypes to match
      operator fixities.
      
      This patch consists of (1) adding UInfixT to the AST, (2) implementing
      the conversion and updating relevant comments, (3) updating
      pretty-printing and library support, and (4) adding tests.
      
      Test Plan: validate
      
      Reviewers: austin, goldfire, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D1088
      
      GHC Trac Issues: #10522
      21782739
    • Adam Sandberg Eriksson's avatar
      Implementation of StrictData language extension · f842ad6c
      Adam Sandberg Eriksson authored
      This implements the `StrictData` language extension, which lets the
      programmer default to strict data fields in datatype declarations on a
      per-module basis.
      
      Specification and motivation can be found at
      https://ghc.haskell.org/trac/ghc/wiki/StrictPragma
      
      This includes a tricky parser change due to conflicts regarding `~` in
      the type level syntax: all ~'s are parsed as strictness annotations (see
      `strict_mark` in Parser.y) and then turned into equality constraints at
      the appropriate places using `RdrHsSyn.splitTilde`.
      
      Updates haddock submodule.
      
      Test Plan: Validate through Harbormaster.
      
      Reviewers: goldfire, austin, hvr, simonpj, tibbe, bgamari
      
      Reviewed By: simonpj, tibbe, bgamari
      
      Subscribers: lelf, simonpj, alanz, goldfire, thomie, bgamari, mpickering
      
      Differential Revision: https://phabricator.haskell.org/D1033
      
      GHC Trac Issues: #8347
      f842ad6c
  9. 25 Jul, 2015 1 commit
    • Sergei Trofimovich's avatar
      renamer: fix module-level deprecation message · b04bed0a
      Sergei Trofimovich authored
      Noticed today that deprecation warnings are
      slightly broken in -HEAD:
      
        mtl-2.2.1/Control/Monad/Error/Class.hs:46:1: warning:
          Module ‘Control.Monad.Trans.Error’ is deprecated:
            ([", U, s, e,  , C, o, n, t, r, o, l, ., M, o, n, a, d, ., T, r, a,
              n, s, ., E, x, c, e, p, t,  , i, n, s, t, e, a, d, "],
             Use Control.Monad.Trans.Except instead)
      
      Commit e6191d1c
      
      
      slightly changed WarningTxt declaration:
      
      -data WarningTxt = WarningTxt (Located SourceText) [Located FastString]
      -                | DeprecatedTxt (Located SourceText) [Located FastString]
      +data WarningTxt = WarningTxt (Located SourceText)
      +                             [Located (SourceText,FastString)]
      +                | DeprecatedTxt (Located SourceText)
      +                                [Located (SourceText,FastString)]
      
      But 'moduleWarn' function was not updated to do the stripping.
      Signed-off-by: default avatarSergei Trofimovich <siarheit@google.com>
      
      Reviewers: austin, bgamari, hvr, goldfire, rwbarton, alanz
      
      Reviewed By: rwbarton, alanz
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D1096
      
      GHC Trac Issues: #10313
      b04bed0a
  10. 24 Jul, 2015 1 commit
  11. 23 Jul, 2015 6 commits
    • Edward Z. Yang's avatar
      Library names, with Cabal submodule update · f9687caf
      Edward Z. Yang authored
      
      
      A library name is a package name, package version, and hash of the
      version names of all textual dependencies (i.e. packages which were included.) A library
      name is a coarse approximation of installed package IDs, which are suitable for
      inclusion in package keys (you don't want to put an IPID in a package key, since
      it means the key will change any time the source changes.)
      
          - We define ShPackageKey, which is the semantic object which
            is hashed into a PackageKey.  You can use 'newPackageKey'
            to hash a ShPackageKey to a PackageKey
      
          - Given a PackageKey, we can lookup its ShPackageKey with
            'lookupPackageKey'.  The way we can do this is by consulting
            the 'pkgKeyCache', which records a reverse mapping from
            every hash to the ShPackageKey.  This means that if you
            load in PackageKeys from external sources (e.g. interface
            files), you also need to load in a mapping of PackageKeys
            to their ShPackageKeys so we can populate the cache.
      
          - We define a 'LibraryName' which encapsulates the full
            depenency resolution that Cabal may have selected; this
            is opaque to GHC but can be used to distinguish different
            versions of a package.
      
          - Definite packages don't have an interesting PackageKey,
            so we rely on Cabal to pass them to us.
      
          - We can pretty-print package keys while displaying the
            instantiation, but it's not wired up to anything (e.g.
            the Outputable instance of PackageKey).
      Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
      
      Test Plan: validate
      
      Reviewers: austin, bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D1056
      
      GHC Trac Issues: #10566
      f9687caf
    • thomie's avatar
      ghci: fixity declarations for infix data constructors (#10018) · e809ef57
      thomie authored
      Declaring a custom fixity for an infix data constructor should work:
      
          Prelude> data Infix a b = a :@: b; infixl 4 :@:
      
      This is a followup to #2947, which handled fixity declarations in ghci
      statements (e.g. let add = (+); infixl 6 `add`).
      
      Support for declarations (data, type, newtype, class, instance,
      deriving, and foreign) was added to GHCi in #4929.
      
      Reviewers: simonpj, austin, thomie
      
      Subscribers: thomie, bgamari
      
      Differential Revision: https://phabricator.haskell.org/D1028
      
      GHC Trac Issues: #10018
      e809ef57
    • thomasw's avatar
      Parenthesise TypeOperator in import hints · b5c94262
      thomasw authored
      When a constructor was mistakenly imported directly instead of as a
      constructor of a data type, a hint will be shown on how to correctly
      import
      it. Just like the constructor, the data type should be surrounded in
      parentheses if it is an operator (TypeOperator in this case).
      
      Instead of:
      
          error:
              In module ‘Data.Type.Equality’:
                ‘Refl’ is a data constructor of ‘:~:’
              To import it use
                ‘import’ Data.Type.Equality( :~:( Refl ) )
              or
                ‘import’ Data.Type.Equality( :~:(..) )
      
      Print:
      
          error:
              In module ‘Data.Type.Equality’:
                ‘Refl’ is a data constructor of ‘(:~:)’
              To import it use
                ‘import’ Data.Type.Equality( (:~:)( Refl ) )
              or
                ‘import’ Data.Type.Equality( (:~:)(..) )
      
      Test Plan: pass new test
      
      Reviewers: austin, bgamari, simonpj
      
      Reviewed By: simonpj
      
      Subscribers: simonpj, thomie
      
      Differential Revision: https://phabricator.haskell.org/D1093
      
      GHC Trac Issues: #10668
      b5c94262
    • Ben Gamari's avatar
      Accept next-docstrings on GADT constructors. · 76e2341a
      Ben Gamari authored
      Accept next docstrings (`-- | Docstring`) on GADT constructors.
      
      I have confirmed that this adds no shift/reduce conflicts.
      
      Test Plan: haddockA034
      
      Reviewers: austin, simonpj, simonmar
      
      Reviewed By: simonmar
      
      Subscribers: Fuuzetsu, simonmar, thomie, mpickering, edsko
      
      Differential Revision: https://phabricator.haskell.org/D1086
      76e2341a
    • spinda's avatar
      Generate .dyn_o files for .hsig files with -dynamic-too · d2b4df15
      spinda authored
      With -dynamic-too, .dyn_o files were not being generated for .hsig
      files.  Normally, this is handled in the pipeline; however, the branch
      for .hsig files called compileEmptyStub directly instead of going
      through runPipeline.  When compiling a Cabal package that included .hsig
      files, this triggered a linker error later on, as it expected a .dyn_o
      file to have been generated for each .hsig.
      
      The fix is to use runPipeline for .hsig files, just as with .hs files.
      Alternately, one could duplicate the logic for handling -dynamic-too in
      the .hsig branch, but simply calling runPipeline ends up being much
      cleaner.
      
      Test Plan: validate
      
      Reviewers: austin, ezyang, bgamari, thomie
      
      Reviewed By: ezyang, thomie
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D1084
      
      GHC Trac Issues: #10660
      d2b4df15
    • thomie's avatar
      Lexer: support consecutive references to Haddock chunks (#10398) · d784bdeb
      thomie authored
      Reviewers: austin, bgamari, Fuuzetsu
      
      Reviewed By: bgamari
      
      Subscribers: thomie, bgamari
      
      Differential Revision: https://phabricator.haskell.org/D1025
      
      GHC Trac Issues: #10398
      d784bdeb