[commit: ghc] master: Make ($!) representation-polymorphic (c9a88db)

git at git.haskell.org git at git.haskell.org
Tue Feb 13 01:03:09 UTC 2018


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/c9a88db3ac4f1c3e97e3492ebe076f2df6463540/ghc

>---------------------------------------------------------------

commit c9a88db3ac4f1c3e97e3492ebe076f2df6463540
Author: David Feuer <david.feuer at gmail.com>
Date:   Mon Feb 12 20:01:56 2018 -0500

    Make ($!) representation-polymorphic
    
    Now that `($)` is representation-polymorphic, `($!)` should
    surely follow suit.
    
    Reviewers: hvr, bgamari, simonpj
    
    Reviewed By: bgamari, simonpj
    
    Subscribers: simonpj, rwbarton, thomie, carter
    
    Differential Revision: https://phabricator.haskell.org/D4382


>---------------------------------------------------------------

c9a88db3ac4f1c3e97e3492ebe076f2df6463540
 docs/users_guide/8.6.1-notes.rst | 2 ++
 libraries/base/GHC/Base.hs       | 4 ++--
 libraries/base/changelog.md      | 4 ++++
 3 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/docs/users_guide/8.6.1-notes.rst b/docs/users_guide/8.6.1-notes.rst
index c17664f..e844ab6 100644
--- a/docs/users_guide/8.6.1-notes.rst
+++ b/docs/users_guide/8.6.1-notes.rst
@@ -49,6 +49,8 @@ Template Haskell
 ``base`` library
 ~~~~~~~~~~~~~~~~
 
+``($!)`` is now representation-polymorphic like ``($)``.
+
 
 Build system
 ~~~~~~~~~~~~
diff --git a/libraries/base/GHC/Base.hs b/libraries/base/GHC/Base.hs
index 7875fef..17d4151 100644
--- a/libraries/base/GHC/Base.hs
+++ b/libraries/base/GHC/Base.hs
@@ -1327,8 +1327,8 @@ f $ x =  f x
 -- argument, evaluates the argument to weak head normal form (WHNF), then calls
 -- the function with that value.
 
-($!)                    :: (a -> b) -> a -> b
-f $! x                  = let !vx = x in f vx  -- see #2273
+($!) :: forall r a (b :: TYPE r). (a -> b) -> a -> b
+f $! x = let !vx = x in f vx  -- see #2273
 
 -- | @'until' p f@ yields the result of applying @f@ until @p@ holds.
 until                   :: (a -> Bool) -> (a -> a) -> a -> a
diff --git a/libraries/base/changelog.md b/libraries/base/changelog.md
index ad8767f..fe7e377 100644
--- a/libraries/base/changelog.md
+++ b/libraries/base/changelog.md
@@ -1,5 +1,9 @@
 # Changelog for [`base` package](http://hackage.haskell.org/package/base)
 
+## 4.12.0.0 *TBA*
+
+  * `($!)` is now representation-polymorphic like `($)`.
+
 ## 4.11.1.0 *TBA*
   * `System.IO.openTempFile` is now thread-safe on Windows.
 



More information about the ghc-commits mailing list