1. 28 Sep, 2017 1 commit
    • Simon Marlow's avatar
      mkDataConRep: fix bug in strictness signature (#14290) · 5935acdb
      Simon Marlow authored
      The strictness signature for a data con wrapper wasn't including any
      dictionary arguments, which meant that bangs on the fields of a
      constructor with an existential context would be moved to the wrong
      fields.  See T14290 for an example.
      
      Test Plan:
      * New test T14290
      * validate
      
      Reviewers: simonpj, niteria, austin, bgamari, erikd
      
      Reviewed By: simonpj, bgamari
      
      Subscribers: rwbarton, thomie
      
      GHC Trac Issues: #14290
      
      Differential Revision: https://phabricator.haskell.org/D4040
      5935acdb
  2. 27 Sep, 2017 2 commits
  3. 26 Sep, 2017 4 commits
  4. 25 Sep, 2017 4 commits
    • Ryan Scott's avatar
      Bump template-haskell to 2.13.0.0 · 3804a7eb
      Ryan Scott authored
      Summary:
      Now that `MonadIO` is a superclass of `Quasi`, it's a good
      time to bump the `template-haskell` version so that libraries can
      accommodate the change using CPP.
      
      Test Plan: ./validate
      
      Reviewers: bgamari, austin
      
      Subscribers: rwbarton, thomie
      
      Differential Revision: https://phabricator.haskell.org/D4007
      3804a7eb
    • Simon Peyton Jones's avatar
      Fix solving of implicit parameter constraints · abed9bf5
      Simon Peyton Jones authored
      Trac #14218 showed that we were not solving implicit-parameter
      constraints correctly.  In particular,
      
      - A tuple constraint could "hide" an implicit-parameter wanted
        constraint, and that in turn could that we solved it from the
        wrong implicit-parameter binding.
      
      - As a special case the HasCallStack constraint (which is just
        short for (IP "callStack" CallStack), was getting mis-solved.
      
      The big change is to arrange that, in TcSMonad.findDict when looking
      for a dictionary, either when looking for a matching inert or solved
      dictionary, we fail for
      
        - Tuples that are hiding implicit parameters
          See Note [Tuples hiding implicit parameters]
      
        - HasCallStack constraints where we have not yet pushed
          on the call-site info
          See Note [Solving CallStack constraints]
      
      I also did a little refactoring
      
      * Move naturallyCoherentClass from Class to TcInteract, its sole
        use site.  Class.hs seems like the wrong place.  (And I also
        do not understand the reason that we need the eq/Coercible/
        Typable stuff in this predicate, but I'll tackle that separately.)
      
      * Move the code that pushes call-site info onto a call stack
        from the "interact" part to the "canonicalise" part of the solver.
      abed9bf5
    • Simon Peyton Jones's avatar
      Improve type-error reporting · 1b476ab5
      Simon Peyton Jones authored
      This patch does two things:
      
      * When reporting a hole, we now include its kind if the
        kind is not just '*'.  This addresses Trac #14265
      
      * When reporting things like "'a' is a rigid type varaible
        bound by ...", this patch arranges to group the type variables
        together, so we don't repeat the "bound by..." stuff endlessly
      1b476ab5
    • Simon Peyton Jones's avatar
      Deal with large extra-contraints wildcards · 3c74a512
      Simon Peyton Jones authored
      For reasons explained in TcHsType
      Note [Extra-constraint holes in partial type signatures],
      if we had
        f :: (_) => blahs
      and the '_' was filled in by more than a 62-tuple of contraints,
      GHC crashed.
      
      The same Note explains the hacky solution I have adopted to
      evade this.  Maybe there is some better way, but I couldn't
      see one that didn't involve a great deal of work. And the problem
      is a very narrow one!  If the hack bites us we'll need to think
      again.
      3c74a512
  5. 24 Sep, 2017 1 commit
  6. 22 Sep, 2017 1 commit
    • Facundo Domínguez's avatar
      Implement TH addCorePlugin. · 17558690
      Facundo Domínguez authored
      This allows template-haskell code to add plugins to the compilation
      pipeline. Otherwise, the user would have to pass -fplugin=... to ghc.
      
      For now, plugin modules in the current package can't be used. This is
      because when TH runs, it is too late to let GHC know that the plugin
      modules needed to be compiled first.
      
      Test Plan: ./validate
      
      Reviewers: simonpj, bgamari, austin, goldfire
      
      Reviewed By: bgamari
      
      Subscribers: angerman, rwbarton, mboes, thomie
      
      GHC Trac Issues: #13608
      
      Differential Revision: https://phabricator.haskell.org/D3821
      17558690
  7. 21 Sep, 2017 8 commits
    • Herbert Valerio Riedel's avatar
      Reexport Semigroup's <> operator from Prelude (#14191) · feac0a3b
      Herbert Valerio Riedel authored
      This completes the 2nd phase of the Semigroup=>Monoid Proposal (SMP)
      initiated in 8ae263ce.
      
      This updates a couple submodules to address <> naming clashes.
      feac0a3b
    • Ben Gamari's avatar
      testsuite: Bump allocations of T12150 · ddb38b51
      Ben Gamari authored
      It looks like this is probably just drift.
      ddb38b51
    • Matthías Páll Gissurarson's avatar
      Also show types that subsume a hole as valid substitutions for that hole. · 1c920832
      Matthías Páll Gissurarson authored
      This builds on the previous "Valid substitutions include..." functionality,
      but add subsumption checking as well, so that the suggested valid substitutions
      show not only exact matches, but also identifiers that fit the hole by virtue of
      subsuming the type of the hole (i.e. being more general than the type of the
      hole).
      
      Building on the previous example, in the given program
      
      ```
      ps :: String -> IO ()
      ps = putStrLn
      
      ps2 :: a -> IO ()
      ps2 _ = putStrLn "hello, world"
      
      main :: IO ()
      main = _ "hello, world"
      ```
      
      The results would be something like
      
      ```
          • Found hole: _ :: [Char] -> IO ()
          • In the expression: _
            In the expression: _ "hello, world"
            In an equation for ‘main’: main = _ "hello, world"
          • Relevant bindings include main :: IO () (bound at t1.hs:8:1)
            Valid substitutions include
              ps :: String -> IO () (defined at t1.hs:2:1)
              ps2 :: forall a. a -> IO () (defined at t1.hs:5:1)
              putStrLn :: String -> IO ()
                (imported from ‘Prelude’ at t1.hs:1:1
                 (and originally defined in ‘System.IO’))
              fail :: forall (m :: * -> *). Monad m => forall a. String -> m a
                (imported from ‘Prelude’ at t1.hs:1:1
                 (and originally defined in ‘GHC.Base’))
              mempty :: forall a. Monoid a => a
                (imported from ‘Prelude’ at t1.hs:1:1
                 (and originally defined in ‘GHC.Base’))
              print :: forall a. Show a => a -> IO ()
                (imported from ‘Prelude’ at t1.hs:1:1
                 (and originally defined in ‘System.IO’))
              (Some substitutions suppressed;
               use -fmax-valid-substitutions=N or -fno-max-valid-substitutions)
      ```
      Signed-off-by: Matthías Páll Gissurarson's avatarMatthías Páll Gissurarson <mpg@mpg.is>
      
      Modified according to suggestions from Simon PJ
      
      Accept tests that match the expectations, still a few to look better at
      
      Swithced to using tcLookup, after sit down with SPJ at ICFP. Implications are WIP.
      
      Now works with polymorphism and constraints!
      
      We still need to merge the latest master, before we can make a patch.
      
      Wrap the type of the hole, instead of implication shenanigans,
      
      As per SPJs suggestion, this is simpler and feels closer to
      what we actually want to do.
      
      Updated tests with the new implementation
      
      Remove debugging trace and update documentation
      
      Reviewers: austin, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: RyanGlScott, rwbarton, thomie
      
      Differential Revision: https://phabricator.haskell.org/D3930
      1c920832
    • Ben Gamari's avatar
      Bump base to 4.11.0.0 · 063e0b4e
      Ben Gamari authored
      Bumps numerous submodules.
      
      Reviewers: austin, hvr
      
      Subscribers: rwbarton, thomie
      
      Differential Revision: https://phabricator.haskell.org/D3974
      063e0b4e
    • Ben Gamari's avatar
      testsuite: Add unboxed sum to T13929 · d86b237d
      Ben Gamari authored
      Test Plan: Validate
      
      Reviewers: austin
      
      Subscribers: rwbarton, thomie
      
      GHC Trac Issues: #13929
      
      Differential Revision: https://phabricator.haskell.org/D3993
      d86b237d
    • Ben Gamari's avatar
      testsuite: Add testcase for #14253 · acd346e3
      Ben Gamari authored
      Reviewers: austin
      
      Subscribers: rwbarton, thomie
      
      Differential Revision: https://phabricator.haskell.org/D3997
      acd346e3
    • Adam Gundry's avatar
      Identify fields by selector when type-checking (fixes #13644) · 72b00c34
      Adam Gundry authored
      Test Plan: new test for #13847, and the test for #13644 now passes
      
      Reviewers: mpickering, austin, bgamari, simonpj
      
      Reviewed By: mpickering, simonpj
      
      Subscribers: simonpj, rwbarton, thomie
      
      GHC Trac Issues: #13644, #13847
      
      Differential Revision: https://phabricator.haskell.org/D3988
      72b00c34
    • Ben Gamari's avatar
      Typeable: Allow App to match arrow types · cc6be3a2
      Ben Gamari authored
      Test Plan: T14236
      
      Reviewers: austin, hvr, goldfire
      
      Reviewed By: goldfire
      
      Subscribers: RyanGlScott, simonpj, rwbarton, goldfire, thomie, dfeuer
      
      GHC Trac Issues: #14236
      
      Differential Revision: https://phabricator.haskell.org/D3969
      cc6be3a2
  8. 19 Sep, 2017 3 commits
  9. 17 Sep, 2017 1 commit
  10. 15 Sep, 2017 3 commits
    • Alan Zimmerman's avatar
      Renamer now preserves location for IEThingWith list items · 9498c50e
      Alan Zimmerman authored
      Prior to this, in the RenamedSource for
      
          module Renaming.RenameInExportedType
            (
            MyType (NT)
            ) where
      
          data MyType = MT Int | NT
      
      The (NT) was given the location of MyType earlier on the line in the
      export list.
      
      Also the location was discarded for any field labels, and replaced with
      a `noLoc`.
      
      Test Plan: ./validate
      
      Reviewers: bgamari, austin
      
      Reviewed By: bgamari
      
      Subscribers: rwbarton, thomie
      
      GHC Trac Issues: #14189
      
      Differential Revision: https://phabricator.haskell.org/D3968
      9498c50e
    • Ryan Scott's avatar
      Fix #14228 by marking SumPats as non-irrefutable · f4d50a0e
      Ryan Scott authored
      `isIrrefutableHsPat` should always return `False` for unboxed sum
      patterns (`SumPat`s), since they always have at least one other
      corresponding pattern of the same arity (since the minimum arity for a
      `SumPat` is 2). Failure to do so causes incorrect code to be generated
      for pattern synonyms that use unboxed sums, as shown in #14228.
      
      Test Plan: make test TEST=T14228
      
      Reviewers: austin, bgamari, simonpj
      
      Reviewed By: simonpj
      
      Subscribers: simonpj, rwbarton, thomie
      
      GHC Trac Issues: #14228
      
      Differential Revision: https://phabricator.haskell.org/D3951
      f4d50a0e
    • Tao He's avatar
      Fix missing fields warnings in empty record construction, fix #13870 · 9e227bb1
      Tao He authored
      Test Plan: make test TEST=T13870
      
      Reviewers: RyanGlScott, austin, bgamari, mpickering
      
      Reviewed By: mpickering
      
      Subscribers: mpickering, rwbarton, thomie, RyanGlScott
      
      Tags: #ghc
      
      GHC Trac Issues: #13870
      
      Differential Revision: https://phabricator.haskell.org/D3940
      9e227bb1
  11. 14 Sep, 2017 12 commits