[commit: ghc] master: Add fixity declaration for Data.List.NonEmpty.!! (398a444)

git at git.haskell.org git at git.haskell.org
Fri Jun 23 17:07:59 UTC 2017


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

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

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

commit 398a444bc673aa4bbdd30029e2cce440f0309e34
Author: Ryan Scott <ryan.gl.scott at gmail.com>
Date:   Fri Jun 23 11:37:19 2017 -0400

    Add fixity declaration for Data.List.NonEmpty.!!
    
    We have `infixl 9 !!` for `Data.List.!!`, but not for
    `Data.List.NonEmpty.!!`. We ought to.
    
    Test Plan: Read it
    
    Reviewers: bgamari, austin, hvr
    
    Reviewed By: bgamari
    
    Subscribers: rwbarton, thomie
    
    Differential Revision: https://phabricator.haskell.org/D3666


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

398a444bc673aa4bbdd30029e2cce440f0309e34
 libraries/base/Data/List/NonEmpty.hs | 1 +
 libraries/base/changelog.md          | 1 +
 2 files changed, 2 insertions(+)

diff --git a/libraries/base/Data/List/NonEmpty.hs b/libraries/base/Data/List/NonEmpty.hs
index 9a9de01..d1cc28c 100644
--- a/libraries/base/Data/List/NonEmpty.hs
+++ b/libraries/base/Data/List/NonEmpty.hs
@@ -477,6 +477,7 @@ isPrefixOf (y:ys) (x :| xs) = (y == x) && List.isPrefixOf ys xs
   | n == 0 = x
   | n > 0  = xs List.!! (n - 1)
   | otherwise = errorWithoutStackTrace "NonEmpty.!! negative argument"
+infixl 9 !!
 
 -- | The 'zip' function takes two streams and returns a stream of
 -- corresponding pairs.
diff --git a/libraries/base/changelog.md b/libraries/base/changelog.md
index 69baab3..0cfd9c1 100644
--- a/libraries/base/changelog.md
+++ b/libraries/base/changelog.md
@@ -8,6 +8,7 @@
   * Add instances `Num`, `Functor`, `Applicative`, `Monad`, `Semigroup`
     and `Monoid` for `Data.Ord.Down` (#13097).
 
+  * Add `infixl 9 !!` declaration for `Data.List.NonEmpty.!!`
 
 ## 4.10.0.0 *April 2017*
   * Bundled with GHC *TBA*



More information about the ghc-commits mailing list