1. 03 Apr, 2017 4 commits
  2. 02 Apr, 2017 18 commits
  3. 01 Apr, 2017 9 commits
  4. 31 Mar, 2017 4 commits
    • rwbarton's avatar
      Fix space leaks in simplifier (#13426) · e13419c5
      rwbarton authored
      The Join points commit (8d5cf8bf) introduced a space leak
      somewhere in the simplifier. The extra strictness added in this commit
      fixes the leak. Unfortunately I don't really understand the details.
      
      Unfortunately, the extra strictness appears to result in more overall
      allocations in some cases, even while the peak heap size decreases in others.
      
      Test Plan: harbormaster
      
      Reviewers: austin, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D3399
      e13419c5
    • Ben Gamari's avatar
      Clean up coreView/tcView. · 6575f4b6
      Ben Gamari authored
      In Core, Constraint should be considered fully equal to
      TYPE LiftedRep, in all ways. Accordingly, coreView should
      unwrap Constraint to become TYPE LiftedRep. Of course, this
      would be a disaster in the type checker.
      
      So, where previously we used coreView in both the type checker
      and in Core, we now have coreView and tcView, which differ only
      in their treatment of Constraint.
      
      Historical note: once upon a past, we had tcView distinct from
      coreView. Back then, it was because newtypes were unwrapped in
      Core but not in the type checker. The distinction is back, but
      for a different reason than before.
      
      This had a few knock-on effects:
      
       * The Typeable solver must explicitly handle Constraint to ensure
         that we produce the correct evidence.
      
       * TypeMap now respects the Constraint/Type distinction
      
      Finished by: bgamari
      
      Test Plan: ./validate
      
      Reviewers: simonpj, austin, bgamari
      
      Reviewed By: simonpj
      
      Subscribers: rwbarton, thomie
      
      Differential Revision: https://phabricator.haskell.org/D3316
      6575f4b6
    • Simon Peyton Jones's avatar
      Refactor simplExpr (Type ty) · 29645274
      Simon Peyton Jones authored
      This small refactoring, provoked by comment:18 on Trac #13426,
      makes it so that simplExprF never gets a (Type ty) expression to
      simplify, which in turn means that calls to exprType on its argument
      will always succeed.
      
      No change in behaviour.
      29645274
    • Joachim Breitner's avatar
      Disable bogus lint checks about levity polimorphic coerions · 03c7dd09
      Joachim Breitner authored
      These checks, introduced in cea71418
      hugely inflated build logs, which incapitated perf.haskell.org.
      
      According to Richard, the checks are useless and wrong, and that Ben
      plans to investigate.
      (https://phabricator.haskell.org/rGHCcea7141851ce653cb20207da3591d09e73fa396d#64647)
      
      Until that happens, I remove them from the code.
      03c7dd09
  5. 30 Mar, 2017 2 commits
    • David Feuer's avatar
      Deriving for phantom and empty types · 69f070d8
      David Feuer authored
      Make `Functor`, `Foldable`, and `Traversable` take advantage
      of the case where the type parameter is phantom. In this case,
      
      * `fmap _ = coerce`
      * `foldMap _ _ = mempty`
      * `traverse _ x = pure (coerce x)`
      
      For the sake of consistency and especially simplicity, make other types
      with no data constructors behave the same:
      
      * `fmap _ x = case x of`
      * `foldMap _ _ = mempty`
      * `traverse _ x = pure (case x of)`
      
      Similarly, for `Generic`,
      
      * `to x = case x of`
      * `from x = case x of`
      
      Give all derived methods for types without constructors appropriate
      arities. For example,
      
      ```
          compare _ _ = error ...
      ```
      
      rather than
      
      ```
          compare = error ...
      ```
      
      Fixes #13117 and #13328
      
      Reviewers: austin, bgamari, RyanGlScott
      
      Reviewed By: RyanGlScott
      
      Subscribers: ekmett, RyanGlScott, rwbarton, thomie
      
      Differential Revision: https://phabricator.haskell.org/D3374
      69f070d8
    • Gabor Greif's avatar
      Typos in comments [ci skip] · ff7094e5
      Gabor Greif authored
      ff7094e5
  6. 29 Mar, 2017 3 commits
    • Sergei Trofimovich's avatar
      unique: fix UNIQUE_BITS crosscompilation (Trac #13491) · 01b062ec
      Sergei Trofimovich authored
      The #13491
      
       manifests best when we try to crosscompile
      from 32-bit (i386-linux) to 64-bit (powerpc64-linux)
      system:
          ./configure --target=powerpc64-unknown-linux-gnu
      
      The build fails at assembly time:
        "inplace/bin/ghc-stage1" ...  -c rts/StgStartup.cmm
          /tmp/ghc19687_0/ghc_4.s: Assembler messages:
      
          /tmp/ghc19687_0/ghc_4.s:11:0: error:
               Error: unknown pseudo-op: `.l'
             |
          11 | .L<\x00>4:
             | ^
      
      That happens because UNIQUE_BITS is defined in terms
      of WORD_SIZE_IN_BITS macro:
          #define UNIQUE_BITS (WORD_SIZE_IN_BITS - 8)
      
      WORD_SIZE_IN_BITS is 64 bits (equals to target value)
      while ghc-stage1 is still running on i386-linux
      
      The fix is to stop relying on target macros and use
      host's 'sizeof (HsInt)' and 'finiteBitSize' way to
      determine unique layout.
      Signed-off-by: default avatarSergei Trofimovich <slyfox@gentoo.org>
      
      Test Plan: build i386-to-powerpc64 crosscompiler
      
      Reviewers: rwbarton, austin, bgamari
      
      Reviewed By: bgamari
      
      Subscribe...
      01b062ec
    • Matthías Páll Gissurarson's avatar
      Show valid substitutions for typed holes · 26c95f46
      Matthías Páll Gissurarson authored
      The idea is to implement a mechanism similar to PureScript, where they
      suggest which identifiers in scope would fit the given hole. In
      PureScript, they use subsumption (which is what we would like here as
      well). For subsumption, we would have to check each type in scope
      whether the hole is a subtype of the given type, but that would require
      `tcSubType` and constraint satisfiability checking. Currently,
      `TcSimplify` uses a lot of functions from `TcErrors`, so that would
      require more of a rewrite, I will hold on with that for now, and submit
      the more simpler type equality version.
      
      As an example, consider
      
      ```
      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 a stmt of a 'do' block: _ "hello, world"
            In the expression:
              do _ "hello, world"
          • Relevant bindings include
              main :: IO () (bound at test.hs:13:1)
              ps :: String -> IO () (bound at test.hs:7:1)
              ps2 :: forall a. a  -> IO () (bound at test.hs:10:1)
            Valid substitutions include
              putStrLn :: String
                          -> IO () (imported from ‘Prelude’ at
      test.hs:1:1-14
                                    (and originally defined in
      ‘System.IO’))
              putStr :: String
                        -> IO () (imported from ‘Prelude’ at
      test.hs:1:1-14
                                  (and originally defined in ‘System.IO’))
      ```
      
      We'd like here for ps2 to be suggested as well, but for that we require
      subsumption.
      
      Reviewers: austin, bgamari, dfeuer, mpickering
      
      Reviewed By: dfeuer, mpickering
      
      Subscribers: mpickering, Wizek, dfeuer, rwbarton, thomie
      
      Differential Revision: https://phabricator.haskell.org/D3361
      26c95f46
    • Moritz Angermann's avatar
      Various patches to support android cross compilation · 924a65fc
      Moritz Angermann authored
      - Better test for SHT_INIT_ARRAY than openbsd_HOST_OS
        This is actually bens patch:
        https://gist.github.com/bgamari/c846e6a5f2cd988716cd5e36c68d5bef
      - linux-android defines.
      - No need for -lpthread on OSAndroid
        However, I’m confused why we do not use the AC NEED_PTHREAD_LIB
        value here?
      - Use mmap on android
      - Support `none` vendor.
      
      Reviewers: austin, hvr, bgamari, erikd, simonmar
      
      Reviewed By: bgamari
      
      Subscribers: rwbarton, thomie, erikd
      
      Differential Revision: https://phabricator.haskell.org/D3356
      924a65fc