1. 16 Jan, 2016 2 commits
    • Alan Zimmerman's avatar
      Work SourceText in for all integer literals · 3a1babd6
      Alan Zimmerman authored
      Summary:
      Certain syntactic elements have integers in them, such as fixity
      specifications, SPECIALISE pragmas and so on.
      
      The lexer will accept mult-radix literals, with arbitrary leading zeros
      in these.
      
      Bring in a SourceText field to each affected AST element to capture the
      original literal text for use with API Annotations.
      
      Affected hsSyn elements are
      
      ```
           -- See note [Pragma source text]
           data Activation = NeverActive
                           | AlwaysActive
                           | ActiveBefore SourceText PhaseNum
                                -- Active only *strictly before* this phase
                           | ActiveAfter SourceText PhaseNum
                                 -- Active in this phase and later
                           deriving( Eq, Data, Typeable )
                                     -- Eq used in comparing rules in HsDecls
      
           data Fixity = Fixity SourceText Int FixityDirection
             -- Note [Pragma source text]
             deriving (Data, Typeable)
       ```
      
      and
      
      ```
            | HsTickPragma         -- A pragma introduced tick
               SourceText           -- Note [Pragma source text] in BasicTypes
               (StringLiteral,(Int,Int),(Int,Int))
                                                -- external span for this tick
               ((SourceText,SourceText),(SourceText,SourceText))
                  -- Source text for the four integers used in the span.
                  -- See note [Pragma source text] in BasicTypes
               (LHsExpr id)
      ```
      
      Updates haddock submodule
      
      Test Plan: ./validate
      
      Reviewers: goldfire, bgamari, austin
      
      Reviewed By: bgamari
      
      Subscribers: thomie, mpickering
      
      Differential Revision: https://phabricator.haskell.org/D1781
      
      GHC Trac Issues: #11430
      3a1babd6
    • Rik Steenkamp's avatar
      Fix some typos · 148a50b5
      Rik Steenkamp authored
      Differential Revision: https://phabricator.haskell.org/D1785
      148a50b5
  2. 15 Jan, 2016 8 commits
    • eir@cis.upenn.edu's avatar
      Fix #11405. · 3c6635ef
      eir@cis.upenn.edu authored
      This adds a new variant of AbsBinds that is used solely for bindings
      with a type signature. This allows for a simpler desugaring that
      does not produce the bogus output that tripped up Core Lint in
      ticket #11405. Should make other desugarings simpler, too.
      3c6635ef
    • eir@cis.upenn.edu's avatar
      Fix typo in error message (#11409) · 80b4c71c
      eir@cis.upenn.edu authored
      80b4c71c
    • eir@cis.upenn.edu's avatar
      Tiny refactoring in TcUnify · 33950aa6
      eir@cis.upenn.edu authored
      33950aa6
    • eir@cis.upenn.edu's avatar
      Constrained types have kind * in validity check. · bafbde7e
      eir@cis.upenn.edu authored
      This addresses #11405, but a deeper problem lurks.
      Try test dependent/should_compile/T11405 and see comment:3
      on the ticket.
      bafbde7e
    • eir@cis.upenn.edu's avatar
      Fix #11254. · 39ea4b4b
      eir@cis.upenn.edu authored
      This moves the call to tcSubType into the context of the
      checkInstConstraints call, allowing the deferred type error
      somewhere to hang its hat.
      39ea4b4b
    • eir@cis.upenn.edu's avatar
      Fix #11355. · e6ca9300
      eir@cis.upenn.edu authored
      Previously, the check for impredicative type applications was
      in the wrong spot.
      
      Test case: typecheck/should_fail/T11355
      e6ca9300
    • Ryan Scott's avatar
      Expand type/kind synonyms in TyVars before deriving-related typechecking · 165ae440
      Ryan Scott authored
      Before, it was possible to have a datatypes such as
      
      ```
      type ConstantT a b = a
      newtype T (f :: * -> *) (a :: ConstantT * f) = T (f a) deriving Functor
      
      data family TFam (f :: * -> *) (a :: *)
      newtype instance TFam f (ConstantT a f) = TFam (f a) deriving Functor
      ```
      
      fail to eta-reduce because either (1) a TyVar had a kind synonym that
      mentioned another TyVar, or (2) an instantiated type was itself a type
      synonym that mentioned another TyVar. A little bit of tweaking to
      `expandTypeSynonyms` and applying it before the eta-reduction check in
      the `deriving` machinery is sufficient to fix this.
      
      Fixes #11416.
      
      Test Plan: ./validate
      
      Reviewers: goldfire, simonpj, austin, bgamari
      
      Reviewed By: simonpj
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D1772
      
      GHC Trac Issues: #11416
      165ae440
    • Ryan Scott's avatar
      Refactor lookupFixityRn-related code following D1744 · 756b2283
      Ryan Scott authored
      Test Plan: ./validate
      
      Reviewers: goldfire, austin, bgamari, simonpj
      
      Subscribers: simonpj, thomie
      
      Differential Revision: https://phabricator.haskell.org/D1766
      
      GHC Trac Issues: #11345
      756b2283
  3. 14 Jan, 2016 2 commits
  4. 13 Jan, 2016 1 commit
  5. 09 Jan, 2016 1 commit
  6. 08 Jan, 2016 3 commits
    • Ryan Scott's avatar
      Fix Template Haskell's handling of infix GADT constructors · 01634277
      Ryan Scott authored
      This is the second (and hopefully last) fix needed to make TH handle
      GADTs properly (after D1465). This Diff addresses some issues with infix
      GADT constructors, specifically:
      
      * Before, you could not determine if a GADT constructor was declared
        infix because TH did not give you the ability to determine if there is
        a //user-specified// fixity declaration for that constructor. The
        return type of `reifyFixity` was changed to `Maybe Fixity` so that it
        yields `Just` the fixity is there is a fixity declaration, and
        `Nothing` otherwise (indicating it has `defaultFixity`).
      * `DsMeta`/`Convert` were changed so that infix GADT constructors are
        turned into `GadtC`, not `InfixC` (which should be reserved for
        Haskell98 datatype declarations).
      * Some minor fixes to the TH pretty-printer so that infix GADT
        constructors will be parenthesized in GADT signatures.
      
      Fixes #11345.
      
      Test Plan: ./validate
      
      Reviewers: goldfire, austin, bgamari, jstolarek
      
      Reviewed By: jstolarek
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D1744
      
      GHC Trac Issues: #11345
      01634277
    • Simon Marlow's avatar
      Support for qRecover in TH with -fexternal-interpreter · 09425cbe
      Simon Marlow authored
      Summary: This completes the support for TH with -fexternal-interpreter.
      
      Test Plan: validate
      
      Reviewers: bgamari, ezyang, austin, niteria, goldfire, erikd
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D1748
      
      GHC Trac Issues: #11100
      09425cbe
    • Simon Marlow's avatar
      Enable stack traces with ghci -fexternal-interpreter -prof · 6be09e88
      Simon Marlow authored
      Summary:
      The main goal here is enable stack traces in GHCi.  After this change,
      if you start GHCi like this:
      
        ghci -fexternal-interpreter -prof
      
      (which requires packages to be built for profiling, but not GHC
      itself) then the interpreter manages cost-centre stacks during
      execution and can produce a stack trace on request.  Call locations
      are available for all interpreted code, and any compiled code that was
      built with the `-fprof-auto` familiy of flags.
      
      There are a couple of ways to get a stack trace:
      
      * `error`/`undefined` automatically get one attached
      * `Debug.Trace.traceStack` can be used anywhere, and prints the current
        stack
      
      Because the interpreter is running in a separate process, only the
      interpreted code is running in profiled mode and the compiler itself
      isn't slowed down by profiling.
      
      The GHCi debugger still doesn't work with -fexternal-interpreter,
      although this patch gets it a step closer.  Most of the functionality
      of breakpoints is implemented, but the runtime value introspection is
      still not supported.
      
      Along the way I also did some refactoring and added type arguments to
      the various remote pointer types in `GHCi.RemotePtr`, so there's
      better type safety and documentation in the bridge code between GHC
      and ghc-iserv.
      
      Test Plan: validate
      
      Reviewers: bgamari, ezyang, austin, hvr, goldfire, erikd
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D1747
      
      GHC Trac Issues: #11047, #11100
      6be09e88
  7. 07 Jan, 2016 8 commits
    • Gabor Greif's avatar
      Typos in docs and comments · c78fedde
      Gabor Greif authored
      c78fedde
    • Simon Peyton Jones's avatar
      Turn AThing into ATcTyCon, in TcTyThing · a5cea73c
      Simon Peyton Jones authored
      This change tidies up and simplifies (a bit) the knot-tying
      when kind-checking groups of type and class declarations.
      
      The trouble (shown by Trac #11356) was that we wanted an error message
      (a kind-mismatch) that involved a type mentioned a (AThing k), which
      blew up.
      
      Since we now seem to have TcTyCons, I decided to use them here.
      It's still not great, but it's easier to understand and more robust.
      a5cea73c
    • Simon Peyton Jones's avatar
      Use an Implication in 'deriving' error · 02c1c573
      Simon Peyton Jones authored
      Trac #11437 showed that erroneous constraints from a 'deriving'
      clause need to be wrapped in an Implication to properly scope
      their skolems.
      
      The main change is in TcDeriv.simplifyDeriv; the call to
      buildImplicationFor is new.
      02c1c573
    • Simon Peyton Jones's avatar
      Refactor simpl_top · dc970966
      Simon Peyton Jones authored
      simpl_top was being polluted with Safe Haskell stuff which was only
      used in one of its four calls.  This moves the Safe Haskell stuff
      to the place it is actually used
      dc970966
    • Simon Peyton Jones's avatar
      Inline solveTopConstraints · 29b46327
      Simon Peyton Jones authored
      It was only called in one place; easier to inline it
      29b46327
    • Simon Peyton Jones's avatar
      Comment wibble · 4dda4edb
      Simon Peyton Jones authored
      4dda4edb
    • Simon Peyton Jones's avatar
      Tidy up tidySkolemInfo · 290a553e
      Simon Peyton Jones authored
      Previously tidySkolemInfo used tidyOpenType, and returned a new
      TidyEnv.  But that's not needed any more, because all the skolems
      should be in scope in the constraint tree.
      
      I also removed a (now-unnecessary) field of UnifyForAllSkol
      290a553e
    • Simon Peyton Jones's avatar
      Spelling in a comment · 97c49e9e
      Simon Peyton Jones authored
      97c49e9e
  8. 06 Jan, 2016 2 commits
    • Jan Stolarek's avatar
      Change Template Haskell representation of GADTs. · cac0795a
      Jan Stolarek authored
      Previous representation of GADTs in TH was not expressive enough
      to express possible GADT return types. See #11341
      
      Test Plan: ./validate
      
      Reviewers: goldfire, austin, bgamari
      
      Subscribers: thomie, RyanGlScott
      
      Differential Revision: https://phabricator.haskell.org/D1738
      
      GHC Trac Issues: #11341
      cac0795a
    • Ryan Scott's avatar
      Restore old GHC generics behavior vis-à-vis Fixity · 852b6030
      Ryan Scott authored
      Phab:D493 accidentally changed the way GHC generics looks up `Fixity`
      information when deriving `Generic` or `Generic1`. Before, a `Fixity` of
      `Infix` would be given only if a data constructor was declared infix,
      but now, `Infix` is given to any data constructor that has a fixity
      declaration (not to be confused with being declared infix!). This commit
      reverts back to the original behavior for consistency's sake.
      
      Fixes #11358.
      
      Test Plan: ./validate
      
      Reviewers: kosmikus, dreixel, austin, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D1740
      
      GHC Trac Issues: #11358
      852b6030
  9. 31 Dec, 2015 2 commits
  10. 30 Dec, 2015 2 commits
    • Gabor Greif's avatar
      Fix some typos · b0fa2864
      Gabor Greif authored
      b0fa2864
    • eir@cis.upenn.edu's avatar
      Fix #11305. · c06b46d0
      eir@cis.upenn.edu authored
      Summary:
      In the fallthrough case when doing a subsumption case, we
      need to deeply instantiate to remove any buried foralls in
      the "actual" type.
      
      Once this validates, please feel free to commit it; I may not
      have the chance to do this on Tuesday. Back in full action on
      Wed.
      
      Test Plan: ./validate, typecheck/should_compiler/T11305
      
      Reviewers: austin, bgamari, hvr
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D1715
      
      GHC Trac Issues: #11305
      c06b46d0
  11. 26 Dec, 2015 3 commits
  12. 24 Dec, 2015 2 commits
    • eir@cis.upenn.edu's avatar
      Visible type application · 2db18b81
      eir@cis.upenn.edu authored
      This re-working of the typechecker algorithm is based on
      the paper "Visible type application", by Richard Eisenberg,
      Stephanie Weirich, and Hamidhasan Ahmed, to be published at
      ESOP'16.
      
      This patch introduces -XTypeApplications, which allows users
      to say, for example `id @Int`, which has type `Int -> Int`. See
      the changes to the user manual for details.
      
      This patch addresses tickets #10619, #5296, #10589.
      2db18b81
    • Simon Peyton Jones's avatar
      Refactoring only · 1af0d36b
      Simon Peyton Jones authored
      This moves code around to more sensible places.
      
      - Construction for CoAxiom is localised in FamInstEnv
      
      - orphNamesOfxx moves to CoreFVs
      
      - roughMatchTcs, instanceCantMatch moves to Unify
      
      - mkNewTypeCo moves from Coercion to FamInstEnv, and is
        renamed mkNewTypeCoAxiom, which makes more sense
      1af0d36b
  13. 23 Dec, 2015 4 commits