1. 25 Sep, 2017 4 commits
    • 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
      Comments only · 3b4833a2
      Simon Peyton Jones authored
      3b4833a2
    • Simon Peyton Jones's avatar
      Make pprQuotedList use fsep not hsep · 7721e8ee
      Simon Peyton Jones authored
      This just does wrapping on very long lists
      7721e8ee
    • 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
  2. 24 Sep, 2017 3 commits
  3. 23 Sep, 2017 2 commits
    • Moritz Angermann's avatar
      Fix AsmTempLabel · d5596126
      Moritz Angermann authored
      Summary:
      This is another fallout from 8b007abb
      should fix Trac #14264. I am not sure if this is
      complete. It does however allow me to build an iOS
      LLVM cross compiler.
      
      Reviewers: bgamari, trofi, austin, simonmar
      
      Reviewed By: trofi
      
      Subscribers: rwbarton, thomie
      
      GHC Trac Issues: #14264
      
      Differential Revision: https://phabricator.haskell.org/D4014
      d5596126
    • Moritz Angermann's avatar
      Additional LLVM_TARGET logic. · c2373b7b
      Moritz Angermann authored
      Summary:
      This should help resolve the
      compilcation that came up in Trac #14261
      
      Test Plan: validate on various platforms
      
      Reviewers: trofi, bgamari, austin, hvr
      
      Reviewed By: trofi
      
      Subscribers: rwbarton, thomie, erikd
      
      GHC Trac Issues: #14261
      
      Differential Revision: https://phabricator.haskell.org/D4004
      c2373b7b
  4. 22 Sep, 2017 7 commits
  5. 21 Sep, 2017 13 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
      cmm/CBE: Use foldLocalRegsDefd · 9aa73892
      Ben Gamari authored
      Simonpj suggested this as a follow-on to #14226 to avoid code
      duplication. This also gives us the ability to CBE cases involving
      foreign calls for free.
      
      Test Plan: Validate
      
      Reviewers: austin, simonmar, simonpj
      
      Reviewed By: simonpj
      
      Subscribers: michalt, simonpj, rwbarton, thomie
      
      GHC Trac Issues: #14226
      
      Differential Revision: https://phabricator.haskell.org/D3999
      9aa73892
    • 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
      58a70629
    • 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: Generalize kind of represented type · 9e46d88a
      Ben Gamari authored
      This allows withTypeable to be used with things that are of kind other
      than Type.
      
      Test Plan: Validate
      
      Reviewers: austin, hvr, dfeuer
      
      Reviewed By: dfeuer
      
      Subscribers: rwbarton, thomie, dfeuer
      
      Differential Revision: https://phabricator.haskell.org/D3996
      9e46d88a
    • 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
    • Mathieu Boespflug's avatar
      Initial CircleCI support. · 283eb1a0
      Mathieu Boespflug authored
      283eb1a0
    • Ryan Scott's avatar
      Typofixes (visiblity -> visibility) · ced2cb5e
      Ryan Scott authored
      ced2cb5e
  6. 20 Sep, 2017 2 commits
    • Sergei Trofimovich's avatar
      aclocal.m4: call cygpath on mingw32 only · d7705f2f
      Sergei Trofimovich authored
      
      
      The only reason I noticed is warning these lines on linux:
      
      ```
      $ ./configure --target=sparc-unknown-linux-gnu
      ...
      ./configure: line 9708: cygpath: command not found
      ./configure: line 9708: ArCmd: command not found
      ```
      
      POSIX shell syntax requires no spaces in assignments.
      Fixed guarding condition while at it.
      Signed-off-by: default avatarSergei Trofimovich <slyfox@gentoo.org>
      d7705f2f
    • Herbert Valerio Riedel's avatar
      Add 'stm' package to the global package database · 02ff7056
      Herbert Valerio Riedel authored
      This is a preparation for `haskeline` picking up a dependency on `stm`
      real soon now. See https://github.com/judah/haskeline/pull/61 for details.
      
      If we figure out a way to not bundle the libraries depended upon by the
      GHCi executable in the global package database (see #8919 for the original
      reason why we had to start bundling terminfo/haskeline in the first place)
      we can get rid of `stm` again...
      
      On the bright side, we were able to avoid uploading new `stm` releases for
      over two years already, so it shouldn't cause too much trouble if GHC imposes
      a strong preference on the `stm` package's version (this most likely will
      mostly affect Linux distributions & similiar).
      
      While at it, this also update the stm submodule to include relaxed
      bounds to allow the upcoming base-4.11 version.
      02ff7056
  7. 19 Sep, 2017 9 commits
    • Tao He's avatar
      Make zipWith and zipWith3 inlinable. · 11d9615e
      Tao He authored
      Reviewers: austin, hvr, bgamari, dfeuer
      
      Reviewed By: dfeuer
      
      Subscribers: rwbarton, thomie
      
      GHC Trac Issues: #14224
      
      Differential Revision: https://phabricator.haskell.org/D3986
      11d9615e
    • ocheron's avatar
      Restore function powModSecInteger · 0aba999f
      ocheron authored
      The function existed in integer-gmp-0.5.1.0 but was removed as
      part of integer-gmp2 rewrite in #9281.  This is to bring it back.
      
      Test Plan: Case integerGmpInternals, with GMP 4.3.2 and GMP 6.1.2
      
      Reviewers: austin, hvr, goldfire, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: rwbarton, thomie
      
      Differential Revision: https://phabricator.haskell.org/D3947
      0aba999f
    • Ben Gamari's avatar
      cmm/CBE: Collapse blocks equivalent up to alpha renaming of local registers · 7920a7d9
      Ben Gamari authored
      As noted in #14226, the common block elimination pass currently
      implements an extremely strict equivalence relation, demanding that two
      blocks are equivalent including the names of their local registers. This
      is quite restrictive and severely hampers the effectiveness of the pass.
      
      Here we allow the CBE pass to collapse blocks which are equivalent up to
      alpha renaming of locally-bound local registers. This is completely safe
      and catches many more duplicate blocks.
      
      Test Plan: Validate
      
      Reviewers: austin, simonmar, michalt
      
      Reviewed By: michalt
      
      Subscribers: rwbarton, thomie
      
      GHC Trac Issues: #14226
      
      Differential Revision: https://phabricator.haskell.org/D3973
      7920a7d9
    • Arnaud Spiwack's avatar
      Factor mkCoreApp and mkCoreApps · 3198956d
      Arnaud Spiwack authored
      `mkCoreApps` re-implemented `mkCoreApp` in a recursive function,
      rather than using a simple `foldl'` in order to avoid repeatingly
      computing the type of the function argument. I've factored the two
      logic into a new (internal) function `mkCoreType` which assumes that
      the type is known. `mkCoreApp` and `mkCoreApps` are thin wrappers
      around it.
      
      Differences
      - The assertion failure message of `mkCoreApps` has more
        information in it.
      - `mkCoreApps` now special-cases coercion argument like
        `mkCoreApp` (previously they were given to `mk_val_app` instead)
      
      Reviewers: austin, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: rwbarton, thomie
      
      Differential Revision: https://phabricator.haskell.org/D3971
      3198956d
    • Ben Gamari's avatar
      users-guide: Mention changes necessary due to #13391 · bbb8cb92
      Ben Gamari authored
      Some variant of this should also be added to the migration guide.
      
      [skip ci]
      
      Test Plan: Read it
      
      Reviewers: goldfire, austin
      
      Reviewed By: goldfire
      
      Subscribers: rwbarton, thomie
      
      GHC Trac Issues: #13391
      
      Differential Revision: https://phabricator.haskell.org/D3966
      bbb8cb92
    • Niklas Hambüchen's avatar
      base: Add more detail to FD_SETSIZE related error message · 022455ff
      Niklas Hambüchen authored
      Reviewers: bgamari, austin, hvr
      
      Reviewed By: bgamari
      
      Subscribers: rwbarton, thomie
      
      Differential Revision: https://phabricator.haskell.org/D3960
      022455ff
    • Niklas Hambüchen's avatar
      base: Make it less likely for fdReady() to fail on Windows sockets. · ba4dcc7c
      Niklas Hambüchen authored
      See the added comment for details.
      
      It's "less likely" because it can still fail if the socket happens to
      have an FD larger than 1023, which can happen if many files are opened.
      
      Until now, basic socket programs that use `hWaitForInput` were broken on
      Windows.
      
      That is because on Windows `FD_SETSIZE` defaults to 64, but pretty much
      all GHC programs seem to have > 64 FDs open, so you can't actually
      create a socket on which you can `select()`.
      
      It errors with `fdReady: fd is too big` even with an example as simple
      as the following (in this case, on my machine the `fd` is `284`):
      
        {-# LANGUAGE OverloadedStrings #-}
      
        import Control.Monad (forever)
        import Network.Socket
        import System.IO
      
        -- Simple echo server: Reads up to 10 chars from network, echoes them back.
        -- Uses the Handle API so that `hWaitForInput` can be used.
        main :: IO ()
        main = do
          sock <- socket AF_INET Stream 0
          setSocketOption sock ReuseAddr 1
          bind sock (SockAddrInet 1234 0x0100007f)
            -- 0x0100007f == 127.0.0.1 localhost
          listen sock 2
          forever $ do
            (connSock, _connAddr) <- accept sock
            putStrLn "Got connection"
      
            h <- socketToHandle connSock ReadWriteMode
            hSetBuffering h NoBuffering
      
            ready <- hWaitForInput h (5 * 1000) -- 5 seconds
            putStrLn $ "Ready: " ++ show ready
      
            line <- hGetLine h
            putStrLn "Got line"
            hPutStrLn h ("Got: " ++ line)
            hClose h
      
      I'm not sure how this was not discovered earlier; for #13525 (where
      `fdReady()` breaking completely was also discovered late) at least it
      failed only when the timeout was non-zero, which is not used in ghc
      beyond in `hWaitForInput`, but in this Windows socket case it breaks
      even on the 0-timeout.
      
      Maybe there is not actually anybody who uses sockets as handles on
      Windows?
      
      The workaround for now is to increase `FD_SETSIZE` on Windows;
      increasing it is possible on Windows and BSD, see
      
      https://stackoverflow.com/questions/7976388/increasing-limit-of-fd-setsi
      ze-and-select
      
      A real fix would be to move to IO Completion Ports on Windows, and thus
      get rid of the last uses of `select()` (the other platforms already use
      `poll()` but Windows doesn't have that).
      
      Reviewers: bgamari, austin, hvr, erikd, simonmar
      
      Reviewed By: bgamari
      
      Subscribers: rwbarton, thomie
      
      Differential Revision: https://phabricator.haskell.org/D3959
      ba4dcc7c
    • Niklas Hambüchen's avatar
      rts: Fix typo in comment · b7f2d125
      Niklas Hambüchen authored
      Reviewers: bgamari, austin, erikd, simonmar
      
      Reviewed By: bgamari
      
      Subscribers: rwbarton, thomie
      
      Differential Revision: https://phabricator.haskell.org/D3958
      b7f2d125
    • Niklas Hambüchen's avatar
      rts: Update comment about FreeBSD's unsigned FD_SETSIZE · 11c478b5
      Niklas Hambüchen authored
      Reviewers: bgamari, austin, erikd, simonmar
      
      Reviewed By: bgamari
      
      Subscribers: rwbarton, thomie
      
      Differential Revision: https://phabricator.haskell.org/D3957
      11c478b5