1. 04 Feb, 2019 1 commit
  2. 03 Jan, 2019 1 commit
    • My Nguyen's avatar
      Visible kind application · 17bd1635
      My Nguyen authored
      Summary:
      This patch implements visible kind application (GHC Proposal 15/#12045), as well as #15360 and #15362.
      It also refactors unnamed wildcard handling, and requires that type equations in type families in Template Haskell be
      written with full type on lhs. PartialTypeSignatures are on and warnings are off automatically with visible kind
      application, just like in term-level.
      
      There are a few remaining issues with this patch, as documented in
      ticket #16082.
      
      Includes a submodule update for Haddock.
      
      Test Plan: Tests T12045a/b/c/TH1/TH2, T15362, T15592a
      
      Reviewers: simonpj, goldfire, bgamari, alanz, RyanGlScott, Iceland_jack
      
      Subscribers: ningning, Iceland_jack, RyanGlScott, int-index, rwbarton, mpickering, carter
      
      GHC Trac Issues: `#12045`, `#15362`, `#15592`, `#15788`, `#15793`, `#15795`, `#15797`, `#15799`, `#15801`, `#15807`, `#15816`
      
      Differential Revision: https://phabricator.haskell.org/D5229
      17bd1635
  3. 22 Dec, 2018 1 commit
    • Ben Gamari's avatar
      testsuite: Remove expect_broken on readFail032 and readFail048 · 7e1d214f
      Ben Gamari authored
      As noted in #15662, these used to be broken on Darwin due to a Clang toolchain
      bug. However, this bug appears to be fixed in the Clang shipped with macOS
      Mojave. Unfortunately, we don't really have any way to only mark it as broken on
      certain operation system releases so I am just removing the expect_broken
      entirely.
      7e1d214f
  4. 01 Nov, 2018 1 commit
  5. 04 Oct, 2018 2 commits
    • Alec Theriault's avatar
      Improve generated `GHC.Prim` docs · feb8a671
      Alec Theriault authored
      Summary:
      * Extended `genprimcode` to generate Haddock-compatible deprecations,
        as well as displaying information about which functions are LLVM-only
        and which functions can fail with an unchecked exception.
      
      * Ported existing deprecations to the new format, and also added a
        deprecation on `par#` (see Trac #15227).
      
      * Emit an error on fixity/deprecation of builtins, unless we are
        processing the module in which that name is defined (see Trac #15233).
        That means the following is no longer accepted (outside of `GHC.Types`):
      
      ```
      infixr 7 :
      {-# DEPRECATED (:) "cons is deprecated" #-}
      ```
      
      * Generate `data (->) a b` with docs and fixity in `GHC.Prim`. This
        means: GHC can now parse `data (->) a b` and `infixr 0 ->` (only in
        `GHC.Prim`) and `genprimcode` can digest `primtype (->) a b` (See Trac
        #4861)
      
      as well as some misc fixes along the way.
      
      Reviewers: bgamari, RyanGlScott
      
      Reviewed By: RyanGlScott
      
      Subscribers: RyanGlScott, rwbarton, mpickering, carter
      
      GHC Trac Issues: #15227, #15233, #4861
      
      Differential Revision: https://phabricator.haskell.org/D5167
      feb8a671
    • Vladislav Zavialov's avatar
      Parse the (!) type operator and allow type operators in existential context · bd789853
      Vladislav Zavialov authored
      Summary:
      Improve the way `(!)`, `(~)`, and other type operators are handled in the parser,
      fixing two issues at once:
      
      1. `(!)` can now be used as a type operator
         that respects fixity and precedence (#15457)
      2. Existential context of a data constructor
         no longer needs parentheses (#15675)
      
      In addition to that, with this patch it is now trivial to adjust precedence of
      the `{-# UNPACK #-}` pragma, as suggested in
      https://ghc.haskell.org/trac/ghc/ticket/14761#comment:7
      
      There was a small change to API Annotations. Before this patch, `(~)` was a
      strange special case that produced an annotation unlike any other type
      operator. After this patch, when `(~)` or `(!)` are used to specify strictness they
      produce AnnTilde and AnnBang annotations respectively, and when they are used
      as type operators, they produce no annotations.
      
      Test Plan: Validate
      
      Reviewers: simonpj, bgamari, alanz, RyanGlScott
      
      Reviewed By: RyanGlScott
      
      Subscribers: RyanGlScott, rwbarton, mpickering, carter
      
      GHC Trac Issues: #15457, #15675
      
      Differential Revision: https://phabricator.haskell.org/D5180
      bd789853
  6. 21 Sep, 2018 2 commits
  7. 04 Sep, 2018 1 commit
  8. 21 Aug, 2018 1 commit
    • Ben Sklaroff's avatar
      Fix #line pragmas in nested comments · 02518f9d
      Ben Sklaroff authored
      When parsing a nested comment or nested doc comment in the lexer, if we
      see a line starting with '#' we attempt to parse a #line pragma. This
      fixes how ghc handles output of the C preproccesor (-cpp flag) when the
      original source has C comments or pragmas inside haskell comments.
      
      Updates haddock submodule.
      
      Test Plan: ./validate
      
      Reviewers: bgamari
      
      Reviewed By: bgamari
      
      Subscribers: rwbarton, thomie, carter
      
      GHC Trac Issues: #314
      
      Differential Revision: https://phabricator.haskell.org/D4934
      02518f9d
  9. 06 Jul, 2018 1 commit
  10. 14 Jun, 2018 1 commit
    • Vladislav Zavialov's avatar
      Embrace -XTypeInType, add -XStarIsType · d650729f
      Vladislav Zavialov authored
      Summary:
      Implement the "Embrace Type :: Type" GHC proposal,
      .../ghc-proposals/blob/master/proposals/0020-no-type-in-type.rst
      
      GHC 8.0 included a major change to GHC's type system: the Type :: Type
      axiom. Though casual users were protected from this by hiding its
      features behind the -XTypeInType extension, all programs written in GHC
      8+ have the axiom behind the scenes. In order to preserve backward
      compatibility, various legacy features were left unchanged. For example,
      with -XDataKinds but not -XTypeInType, GADTs could not be used in types.
      Now these restrictions are lifted and -XTypeInType becomes a redundant
      flag that will be eventually deprecated.
      
      * Incorporate the features currently in -XTypeInType into the
        -XPolyKinds and -XDataKinds extensions.
      * Introduce a new extension -XStarIsType to control how to parse * in
        code and whether to print it in error messages.
      
      Test Plan: Validate
      
      Reviewers: goldfire, hvr, bgamari, alanz, simonpj
      
      Reviewed By: goldfire, simonpj
      
      Subscribers: rwbarton, thomie, mpickering, carter
      
      GHC Trac Issues: #15195
      
      Differential Revision: https://phabricator.haskell.org/D4748
      d650729f
  11. 07 Jun, 2018 1 commit
    • Ryan Scott's avatar
      Don't expose (~#), (~R#), (~P#) from GHC.Prim · 5926b6ed
      Ryan Scott authored
      Currently, the primitive `(~#)`, `(~R#)`, and `(~P#)` type
      constructors are wired in to be exported from `GHC.Prim`. This has
      some unfortunate consequences, however. It turns out that `(~#)` is
      actually a legal infix identifier, so users can make use of unboxed
      equalities in strange ways in user code (see #15209). The other two,
      `(~R#)` and `(~P#)`, can't be used in source code, but they can be
      observed with GHCi's `:browse` command, which is somewhat unnerving.
      
      The fix for both of these problems is simple: just don't wire them
      to be exported from `GHC.Prim`.
      
      Test Plan: make test TEST="T12023 T15209"
      
      Reviewers: bgamari, dfeuer
      
      Reviewed By: bgamari, dfeuer
      
      Subscribers: rwbarton, thomie, carter, dfeuer
      
      GHC Trac Issues: #12023, #15209
      
      Differential Revision: https://phabricator.haskell.org/D4801
      5926b6ed
  12. 19 Apr, 2018 1 commit
  13. 14 Mar, 2018 1 commit
    • Ömer Sinan Ağacan's avatar
      Slighly improve infix con app pattern errors · cb6d8589
      Ömer Sinan Ağacan authored
      Given this program:
      
          main = do
            f $ do
              a <- return 3
                c <- do
                return 5
      
      GHC previously gave this error message:
      
          Main.hs:2:7: error:
              Parse error in pattern: do a <- return 3 c
              Possibly caused by a missing 'do'?
            |
          2 |   f $ do
            |       ^^...
      
      What happened is GHC considered the whole `f $ do a <- return 3 c` as a
      pattern. When parsed as an expression it becomes an infix application of
      `($)`, and GHC checks left and right hand sides before checking if `($)`
      is a valid infix constructor name, and shows the first error it got.
      
      If instead we first check if the infix op is valid in pattern context,
      the error message becomes much clearer:
      
          Main.hs:2:3: error:
              Parse error in pattern: f $ do a <- return 3 c
              Possibly caused by a missing 'do'?
            |
          2 |   f $ do
            |   ^^^^^^...
      
      This may not entirely fix #11188 but I think it's an improvement.
      
      Reviewers: bgamari
      
      Reviewed By: bgamari
      
      Subscribers: rwbarton, thomie, carter
      
      GHC Trac Issues: #11188
      
      Differential Revision: https://phabricator.haskell.org/D4497
      cb6d8589
  14. 13 Feb, 2018 1 commit
    • Tao He's avatar
      Raise parse error for `data T where`. · 8936ab69
      Tao He authored
      Empty GADTs data declarations can't be identified in type checker. This
      patch adds additional checks in parser and raise a parse error when
      encounter empty GADTs declarations but extension `GADTs` is not enabled.
      
      Only empty declarations are checked in parser to avoid affecting
      existing
      error messages related to missing GADTs extension.
      
      This patch should fix issue 8258.
      Signed-off-by: Tao He's avatarHE, Tao <sighingnow@gmail.com>
      
      Test Plan: make test TEST="T8258 T8258NoGADTs"
      
      Reviewers: bgamari, mpickering, alanz, RyanGlScott
      
      Reviewed By: bgamari, RyanGlScott
      
      Subscribers: adamse, RyanGlScott, rwbarton, thomie, mpickering, carter
      
      GHC Trac Issues: #8258
      
      Differential Revision: https://phabricator.haskell.org/D4350
      8936ab69
  15. 01 Feb, 2018 2 commits
    • Tao He's avatar
      UnboxedTuples can't be used as constraints · ced9fbd3
      Tao He authored
      Fixes #14740.
      
      Test Plan: make test TEST="14740"
      
      Reviewers: bgamari, simonpj
      
      Reviewed By: simonpj
      
      Subscribers: simonpj, rwbarton, thomie, carter
      
      GHC Trac Issues: #14740
      
      Differential Revision: https://phabricator.haskell.org/D4359
      ced9fbd3
    • takano-akio's avatar
      Implement BlockArguments (#10843) · be84823b
      takano-akio authored
      This patch implements the BlockArguments extension, as proposed at
      https://github.com/ghc-proposals/ghc-proposals/pull/90. It also
      fixes #10855 as a side-effect.
      
      This patch adds a large number of shift-reduce conflicts to the parser.
      All of them concern the ambiguity as to where constructs like `if` and
      `let` end. Fortunately they are resolved correctly by preferring shift.
      
      The patch is based on @gibiansky's ArgumentDo implementation (D1219).
      
      Test Plan: ./validate
      
      Reviewers: goldfire, bgamari, alanz, mpickering
      
      Reviewed By: bgamari, mpickering
      
      Subscribers: Wizek, dfeuer, gibiansky, rwbarton, thomie, mpickering, carter
      
      GHC Trac Issues: #10843, #10855
      
      Differential Revision: https://phabricator.haskell.org/D4260
      be84823b
  16. 21 Jan, 2018 1 commit
    • Takenobu Tani's avatar
      Implement underscores in numeric literals (NumericUnderscores extension) · 4a13c5b1
      Takenobu Tani authored
      Implement the proposal of underscores in numeric literals.
      Underscores in numeric literals are simply ignored.
      
      The specification of the feature is available here:
      https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/000
      9-numeric-underscores.rst
      
      For a discussion of the various choices:
      https://github.com/ghc-proposals/ghc-proposals/pull/76
      
      Implementation detail:
      
      * Added dynamic flag
        * `NumericUnderscores` extension flag is added for this feature.
      
      * Alex "Regular expression macros" in Lexer.x
        * Add `@numspc` (numeric spacer) macro to represent multiple
          underscores.
        * Modify `@decimal`, `@decimal`, `@binary`, `@octal`, `@hexadecimal`,
          `@exponent`, and `@bin_exponent` macros to include `@numspc`.
      
      * Alex "Rules" in Lexer.x
        * To be simpler, we have only the definitions with underscores.
          And then we have a separate function (`tok_integral` and `tok_frac`)
          that validates the literals.
      
      * Validation functions in Lexer.x
        * `tok_integral` and `tok_frac` functions validate
          whether contain underscores or not.
          If `NumericUnderscores` extensions are not enabled,
          check that there are no underscores.
        * `tok_frac` function is created by merging `strtoken` and
          `init_strtoken`.
        * `init_strtoken` is deleted. Because it is no longer used.
      
      * Remove underscores from target literal string
        * `parseUnsignedInteger`, `readRational__`, and `readHexRational} use
          the customized `span'` function to remove underscores.
      
      * Added Testcase
        * testcase for NumericUnderscores enabled.
            NumericUnderscores0.hs and NumericUnderscores1.hs
        * testcase for NumericUnderscores disabled.
            NoNumericUnderscores0.hs and NoNumericUnderscores1.hs
        * testcase to invalid pattern for NumericUnderscores enabled.
            NumericUnderscoresFail0.hs and NumericUnderscoresFail1.hs
      
      Test Plan: `validate` including the above testcase
      
      Reviewers: goldfire, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: carter, rwbarton, thomie
      
      GHC Trac Issues: #14473
      
      Differential Revision: https://phabricator.haskell.org/D4235
      4a13c5b1
  17. 21 Dec, 2017 1 commit
    • Ryan Scott's avatar
      Fix #14588 by checking for more bang patterns · 9caf40e9
      Ryan Scott authored
      Summary:
      Commit 37299536
      inadvertently removed a check in the parser which rejected
      let-bindings with bang patterns, leading to #14588. This fixes it by
      creating a `hintBangPat` function to perform this check, and
      sprinkling it in the right places.
      
      Test Plan: make test TEST=T14588
      
      Reviewers: bgamari, alanz, simonpj
      
      Reviewed By: bgamari, simonpj
      
      Subscribers: rwbarton, thomie, mpickering, carter
      
      GHC Trac Issues: #14588
      
      Differential Revision: https://phabricator.haskell.org/D4270
      9caf40e9
  18. 15 May, 2017 1 commit
  19. 29 Mar, 2017 1 commit
  20. 13 Mar, 2017 1 commit
  21. 06 Mar, 2017 1 commit
  22. 03 Mar, 2017 2 commits
  23. 19 May, 2016 1 commit
  24. 19 Feb, 2016 1 commit
    • thomie's avatar
      Modifier letter in middle of identifier is ok · d738e664
      thomie authored
      Refactoring only. Cleanup some loose ends from #10196.
      
      Initially the idea was to only allow modifier letters at the end of
      identifiers. Since we later decided to allow modifier letters also in
      the middle of identifiers (because not doing so would not fix the
      regression completely), the names `suffix` and `okIdSuffixChar` don't
      seem appropriate anymore.
      
      Remove TODO. Move test from should_fail to should_compile.
      d738e664
  25. 17 Feb, 2016 1 commit
  26. 22 Oct, 2015 1 commit
  27. 08 Oct, 2015 1 commit
    • thomie's avatar
      Parser: revert some error messages to what they were before 7.10 · e2b579e8
      thomie authored
      Among doing other things, Phab:D201 (bc2289e1)
      tried to improve the error messages thrown by the parser. For example a missing
      else clause now prints "parse error in if statement: else clause empty" instead
      of "parse error (possibly incorrect indentation or mismatched brackets)".
      
      Some error messages got much worse however (see tests), and the result seems to
      be a net negative. Although not entirely satisfactory, this commits therefore
      reverts those parser changes.
      
      Reviewed By: austin
      
      Differential Revision: https://phabricator.haskell.org/D1309
      
      GHC Trac Issues: #10498
      e2b579e8
  28. 03 Jul, 2015 1 commit
  29. 12 Jun, 2015 1 commit
  30. 09 Jun, 2015 1 commit
  31. 30 Mar, 2015 1 commit
  32. 27 Jun, 2014 1 commit
    • Herbert Valerio Riedel's avatar
      Add -XBinaryLiterals language extension (re #9224) · 1c0b5fdc
      Herbert Valerio Riedel authored
      Haskell2010 supports
      
      - base-10 (prefix-less),
      - base-8 (via `0[oO]`-prefix), and
      - base-16 (via `0[xX]`-prefix) integer literals.
      
      This commit adds syntax support for base-2 integer literals via the new `0[bB]`
      prefix. The use of a `0b` prefix for indicating binary literals is known
      from popular programming languages such as C++14, Perl, Python, Ruby, and Java.
      
      This syntax extension is disabled by default and can be enabled via the
      new `{-# LANGUAGE BinaryLiterals #-}` pragma and/or the new `-XBinaryLiterals`
      
      This new extensions requires to upgrade the `ExtsBitmap` type from
      `Word` to `Word64` as this adds a 33th flag which is not guaranteed to
      fit into a `Word`.
      Signed-off-by: Herbert Valerio Riedel's avatarHerbert Valerio Riedel <hvr@gnu.org>
      
      Differential Revision: https://phabricator.haskell.org/D22
      1c0b5fdc
  33. 06 Nov, 2013 1 commit
  34. 12 Oct, 2013 2 commits
  35. 11 Oct, 2013 1 commit