1. 25 Apr, 2017 1 commit
    • Ben Gamari's avatar
      configure: Kill off FP_ARG_WITH_* · 9373994a
      Ben Gamari authored
      This replaces the --with-* configure flags with the usual autoconf
      environment variables, as suggested by #13583.
      
      Test Plan: Configure on various platforms
      
      Reviewers: hvr, trofi, thomie, austin
      
      Reviewed By: trofi
      
      Subscribers: rwbarton, erikd
      
      GHC Trac Issues: #13583
      
      Differential Revision: https://phabricator.haskell.org/D3499
      9373994a
  2. 17 Apr, 2017 1 commit
    • Sergei Trofimovich's avatar
      hs_add_root() RTS API removal · a92ff5d6
      Sergei Trofimovich authored
      Before ghc-7.2 hs_add_root() had to be used to initialize haskell
      modules when haskell was called from FFI.
      
      commit a52ff761
      ("Change the way module initialisation is done (#3252, #4417)")
      removed needs for hs_add_root() and made function a no-op.
      For backward compatibility '__stginit_<module>' symbol was
      not removed.
      
      This change removes no-op hs_add_root() function and unused
      '__stginit_<module>' symbol from each haskell module.
      Signed-off-by: default avatarSergei Trofimovich <slyfox@gentoo.org>
      
      Test Plan: ./validate
      
      Reviewers: simonmar, austin, bgamari, erikd
      
      Reviewed By: simonmar
      
      Subscribers: rwbarton, thomie
      
      Differential Revision: https://phabricator.haskell.org/D3460
      a92ff5d6
  3. 02 Apr, 2017 1 commit
    • David Feuer's avatar
      Derive the definition of null · bf5e0eab
      David Feuer authored
      We can sometimes produce much better code by deriving the
      definition of `null` rather than using the default. For example,
      given
      
          data SnocList a = Lin | Snoc (SnocList a) a
      
      the default definition of `null` will walk the whole list, but of
      course we can stop as soon as we see `Snoc`. Similarly, if a
      constructor contains some other `Foldable` type, we want to use its
      `null` rather than folding over the structure.
      
      Partially fixes Trac #13280
      
      Reviewers: austin, bgamari, RyanGlScott
      
      Reviewed By: RyanGlScott
      
      Subscribers: rwbarton, thomie
      
      Differential Revision: https://phabricator.haskell.org/D3402
      bf5e0eab
  4. 30 Mar, 2017 1 commit
    • 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