[arch-commits] Commit in agda/repos (8 files)

Felix Yan felixonmars at archlinux.org
Wed Jan 11 09:19:12 UTC 2017


    Date: Wednesday, January 11, 2017 @ 09:19:11
  Author: felixonmars
Revision: 206788

archrelease: copy trunk to community-i686, community-x86_64

Added:
  agda/repos/community-i686/PKGBUILD
    (from rev 206787, agda/trunk/PKGBUILD)
  agda/repos/community-i686/unordered-containers-0.2.6.patch
    (from rev 206787, agda/trunk/unordered-containers-0.2.6.patch)
  agda/repos/community-x86_64/PKGBUILD
    (from rev 206787, agda/trunk/PKGBUILD)
  agda/repos/community-x86_64/unordered-containers-0.2.6.patch
    (from rev 206787, agda/trunk/unordered-containers-0.2.6.patch)
Deleted:
  agda/repos/community-i686/PKGBUILD
  agda/repos/community-i686/unordered-containers-0.2.6.patch
  agda/repos/community-x86_64/PKGBUILD
  agda/repos/community-x86_64/unordered-containers-0.2.6.patch

---------------------------------------------------+
 /PKGBUILD                                         |  120 ++++++++++++++++++++
 /unordered-containers-0.2.6.patch                 |   80 +++++++++++++
 community-i686/PKGBUILD                           |   65 ----------
 community-i686/unordered-containers-0.2.6.patch   |   40 ------
 community-x86_64/PKGBUILD                         |   65 ----------
 community-x86_64/unordered-containers-0.2.6.patch |   40 ------
 6 files changed, 200 insertions(+), 210 deletions(-)

Deleted: community-i686/PKGBUILD
===================================================================
--- community-i686/PKGBUILD	2017-01-11 09:18:41 UTC (rev 206787)
+++ community-i686/PKGBUILD	2017-01-11 09:19:11 UTC (rev 206788)
@@ -1,65 +0,0 @@
-# $Id$
-# Maintainer: Felix Yan <felixonmars at archlinux.org>
-# Contributor: Arch Haskell Team <arch-haskell at haskell.org>
-
-_hkgname=Agda
-pkgname=agda
-pkgver=2.5.1.1
-pkgrel=2
-pkgdesc="A dependently typed functional programming language and proof assistant"
-url="http://wiki.portal.chalmers.se/agda/"
-license=("custom")
-arch=('i686' 'x86_64')
-depends=('gmp' 'libffi' 'zlib')
-makedepends=("ghc=8.0.1" "alex" "happy" "haskell-boxes" "haskell-cpphs"
-             "haskell-data-hash" "haskell-edisonapi" "haskell-edisoncore"
-             "haskell-edit-distance" "haskell-equivalence" "haskell-filemanip"
-             "haskell-geniplate-mirror" "haskell-hashable" "haskell-hashtables"
-             "haskell-monadplus" "haskell-mtl" "haskell-parallel"
-             "haskell-quickcheck" "haskell-src-exts" "haskell-strict"
-             "haskell-text" "haskell-transformers-compat"
-             "haskell-unordered-containers" "haskell-zlib")
-optdepends=('agda-stdlib: for standard library')
-source=("http://hackage.haskell.org/packages/archive/${_hkgname}/${pkgver}/${_hkgname}-${pkgver}.tar.gz")
-sha256sums=('563b8063fc94349b56ae1867e973f1751db0e9a8997af7ede93d3c3a8c66a6b0')
-
-prepare() {
-    sed -e 's/, EdisonAPI == 1.3/, EdisonAPI >= 1.3/' \
-        -e 's/, QuickCheck >= 2.8.2 && < 2.9/, QuickCheck >= 2.8.2 \&\& < 2.10/' \
-        -i $_hkgname-$pkgver/$_hkgname.cabal
-
-    # TODO: Find a better way!
-    # Build it twice to compile the agdai file.
-    cp -a ${_hkgname}-${pkgver}{,-tmp}
-}
-
-build() {
-    cd "${srcdir}/${_hkgname}-${pkgver}"
-    
-    runhaskell Setup configure -O --enable-library-profiling --enable-shared \
-        --prefix=/usr --docdir="/usr/share/doc/${pkgname}" --datasubdir="$pkgname" \
-        --libsubdir=\$compiler/site-local/\$pkgid \
-            -fcpphs -f-uhc
-    LC_CTYPE=en_US.UTF-8 runhaskell Setup build
-
-    cd "${srcdir}/${_hkgname}-${pkgver}-tmp"
-    runhaskell Setup configure --prefix="$PWD/target" --datasubdir="$pkgname"
-    LC_CTYPE=en_US.UTF-8 runhaskell Setup build
-    runhaskell Setup copy
-
-    target/bin/agda target/share/agda/lib/prim/Agda/Primitive.agda
-    for _file in target/share/agda/lib/prim/Agda/Builtin/*.agda; do
-        target/bin/agda "$_file"
-    done
-}
-
-package() {
-    cd "${srcdir}/${_hkgname}-${pkgver}"
-    runhaskell Setup copy --destdir="${pkgdir}"
-
-    install -m644 "${srcdir}/${_hkgname}-${pkgver}-tmp"/target/share/agda/lib/prim/Agda/Primitive.agdai "$pkgdir"/usr/share/agda/lib/prim/Agda/Primitive.agdai  
-    install -m644 "${srcdir}/${_hkgname}-${pkgver}-tmp"/target/share/agda/lib/prim/Agda/Builtin/*.agdai "$pkgdir"/usr/share/agda/lib/prim/Agda/Builtin/
-
-    rm -r "$pkgdir"/usr/{lib,share/doc}
-    install -D -m644 "LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
-}

Copied: agda/repos/community-i686/PKGBUILD (from rev 206787, agda/trunk/PKGBUILD)
===================================================================
--- community-i686/PKGBUILD	                        (rev 0)
+++ community-i686/PKGBUILD	2017-01-11 09:19:11 UTC (rev 206788)
@@ -0,0 +1,60 @@
+# $Id$
+# Maintainer: Felix Yan <felixonmars at archlinux.org>
+# Contributor: Arch Haskell Team <arch-haskell at haskell.org>
+
+_hkgname=Agda
+pkgname=agda
+pkgver=2.5.2
+pkgrel=1
+pkgdesc="A dependently typed functional programming language and proof assistant"
+url="http://wiki.portal.chalmers.se/agda/"
+license=("custom")
+arch=('i686' 'x86_64')
+depends=('gmp' 'libffi' 'zlib')
+makedepends=("ghc=8.0.1" "alex" "happy" "haskell-boxes" "haskell-cpphs" "haskell-data-hash"
+             "haskell-edisonapi" "haskell-edisoncore" "haskell-edit-distance" "haskell-equivalence"
+             "haskell-filepath" "haskell-geniplate-mirror" "haskell-gitrev" "haskell-hashable"
+             "haskell-hashtables" "haskell-ieee754" "haskell-monadplus" "haskell-mtl"
+             "haskell-murmur-hash" "haskell-parallel" "haskell-regex-tdfa" "haskell-strict"
+             "haskell-text" "haskell-transformers-compat" "haskell-unordered-containers"
+             "haskell-zlib")
+optdepends=('agda-stdlib: for standard library')
+source=("http://hackage.haskell.org/packages/archive/${_hkgname}/${pkgver}/${_hkgname}-${pkgver}.tar.gz")
+sha256sums=('d812cec3bf7f03c4b27248572475c7e060154102771a8434cc11ba89f5691439')
+
+prepare() {
+    # TODO: Find a better way!
+    # Build it twice to compile the agdai file.
+    cp -a ${_hkgname}-${pkgver}{,-tmp}
+}
+
+build() {
+    cd "${srcdir}/${_hkgname}-${pkgver}"
+    
+    runhaskell Setup configure -O \
+        --prefix=/usr --docdir="/usr/share/doc/${pkgname}" --datasubdir="$pkgname" \
+        --libsubdir=\$compiler/site-local/\$pkgid \
+            -fcpphs -f-uhc -f-debug
+    LC_CTYPE=en_US.UTF-8 runhaskell Setup build
+
+    cd "${srcdir}/${_hkgname}-${pkgver}-tmp"
+    runhaskell Setup configure --prefix="$PWD/target" --datasubdir="$pkgname"
+    LC_CTYPE=en_US.UTF-8 runhaskell Setup build
+    runhaskell Setup copy
+
+    target/bin/agda target/share/agda/lib/prim/Agda/Primitive.agda
+    for _file in target/share/agda/lib/prim/Agda/Builtin/*.agda; do
+        target/bin/agda "$_file"
+    done
+}
+
+package() {
+    cd "${srcdir}/${_hkgname}-${pkgver}"
+    runhaskell Setup copy --destdir="${pkgdir}"
+
+    install -m644 "${srcdir}/${_hkgname}-${pkgver}-tmp"/target/share/agda/lib/prim/Agda/Primitive.agdai "$pkgdir"/usr/share/agda/lib/prim/Agda/Primitive.agdai  
+    install -m644 "${srcdir}/${_hkgname}-${pkgver}-tmp"/target/share/agda/lib/prim/Agda/Builtin/*.agdai "$pkgdir"/usr/share/agda/lib/prim/Agda/Builtin/
+
+    rm -r "$pkgdir"/usr/{lib,share/doc}
+    install -D -m644 "LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
+}

Deleted: community-i686/unordered-containers-0.2.6.patch
===================================================================
--- community-i686/unordered-containers-0.2.6.patch	2017-01-11 09:18:41 UTC (rev 206787)
+++ community-i686/unordered-containers-0.2.6.patch	2017-01-11 09:19:11 UTC (rev 206788)
@@ -1,40 +0,0 @@
-diff --git a/src/full/Agda/Utils/HashMap.hs b/src/full/Agda/Utils/HashMap.hs
-index 5e1da8b..bd14fac 100644
---- a/src/full/Agda/Utils/HashMap.hs
-+++ b/src/full/Agda/Utils/HashMap.hs
-@@ -1,29 +1,14 @@
- module Agda.Utils.HashMap
-   ( module HashMap
--  , mapMaybe
--  , alter
-   ) where
- 
--import Data.Hashable
- import Data.HashMap.Strict as HashMap
--import qualified Data.Maybe as Maybe
- 
---- | Like 'Data.Map.Strict.mapMaybe'.
-+-- ASR (20 January 2016) Issue 1779: I removed the @mapMaybe@ and
-+-- @alter@ functions because them currently aren't used and
-+-- them were added in unordered-containers 0.2.6.0.
- 
---- This code has not been benchmarked. Other implementations may be
---- more efficient.
-+-- mapMaybe :: (a -> Maybe b) -> HashMap k a -> HashMap k b
- 
--mapMaybe :: (a -> Maybe b) -> HashMap k a -> HashMap k b
--mapMaybe f = fmap Maybe.fromJust . HashMap.filter Maybe.isJust . fmap f
--
---- | Like 'Data.Map.Strict.alter'.
--
--alter :: (Eq k, Hashable k) =>
--         (Maybe a -> Maybe a) -> k -> HashMap k a -> HashMap k a
--alter f k m = case HashMap.lookup k m of
--  Nothing -> case f Nothing of
--    Nothing -> m
--    Just v  -> HashMap.insert k v m
--  Just v  -> case f (Just v) of
--    Nothing -> HashMap.delete k m
--    Just v  -> HashMap.insert k v m
-+-- alter :: (Eq k, Hashable k) =>
-+--          (Maybe a -> Maybe a) -> k -> HashMap k a -> HashMap k a

Copied: agda/repos/community-i686/unordered-containers-0.2.6.patch (from rev 206787, agda/trunk/unordered-containers-0.2.6.patch)
===================================================================
--- community-i686/unordered-containers-0.2.6.patch	                        (rev 0)
+++ community-i686/unordered-containers-0.2.6.patch	2017-01-11 09:19:11 UTC (rev 206788)
@@ -0,0 +1,40 @@
+diff --git a/src/full/Agda/Utils/HashMap.hs b/src/full/Agda/Utils/HashMap.hs
+index 5e1da8b..bd14fac 100644
+--- a/src/full/Agda/Utils/HashMap.hs
++++ b/src/full/Agda/Utils/HashMap.hs
+@@ -1,29 +1,14 @@
+ module Agda.Utils.HashMap
+   ( module HashMap
+-  , mapMaybe
+-  , alter
+   ) where
+ 
+-import Data.Hashable
+ import Data.HashMap.Strict as HashMap
+-import qualified Data.Maybe as Maybe
+ 
+--- | Like 'Data.Map.Strict.mapMaybe'.
++-- ASR (20 January 2016) Issue 1779: I removed the @mapMaybe@ and
++-- @alter@ functions because them currently aren't used and
++-- them were added in unordered-containers 0.2.6.0.
+ 
+--- This code has not been benchmarked. Other implementations may be
+--- more efficient.
++-- mapMaybe :: (a -> Maybe b) -> HashMap k a -> HashMap k b
+ 
+-mapMaybe :: (a -> Maybe b) -> HashMap k a -> HashMap k b
+-mapMaybe f = fmap Maybe.fromJust . HashMap.filter Maybe.isJust . fmap f
+-
+--- | Like 'Data.Map.Strict.alter'.
+-
+-alter :: (Eq k, Hashable k) =>
+-         (Maybe a -> Maybe a) -> k -> HashMap k a -> HashMap k a
+-alter f k m = case HashMap.lookup k m of
+-  Nothing -> case f Nothing of
+-    Nothing -> m
+-    Just v  -> HashMap.insert k v m
+-  Just v  -> case f (Just v) of
+-    Nothing -> HashMap.delete k m
+-    Just v  -> HashMap.insert k v m
++-- alter :: (Eq k, Hashable k) =>
++--          (Maybe a -> Maybe a) -> k -> HashMap k a -> HashMap k a

Deleted: community-x86_64/PKGBUILD
===================================================================
--- community-x86_64/PKGBUILD	2017-01-11 09:18:41 UTC (rev 206787)
+++ community-x86_64/PKGBUILD	2017-01-11 09:19:11 UTC (rev 206788)
@@ -1,65 +0,0 @@
-# $Id$
-# Maintainer: Felix Yan <felixonmars at archlinux.org>
-# Contributor: Arch Haskell Team <arch-haskell at haskell.org>
-
-_hkgname=Agda
-pkgname=agda
-pkgver=2.5.1.1
-pkgrel=2
-pkgdesc="A dependently typed functional programming language and proof assistant"
-url="http://wiki.portal.chalmers.se/agda/"
-license=("custom")
-arch=('i686' 'x86_64')
-depends=('gmp' 'libffi' 'zlib')
-makedepends=("ghc=8.0.1" "alex" "happy" "haskell-boxes" "haskell-cpphs"
-             "haskell-data-hash" "haskell-edisonapi" "haskell-edisoncore"
-             "haskell-edit-distance" "haskell-equivalence" "haskell-filemanip"
-             "haskell-geniplate-mirror" "haskell-hashable" "haskell-hashtables"
-             "haskell-monadplus" "haskell-mtl" "haskell-parallel"
-             "haskell-quickcheck" "haskell-src-exts" "haskell-strict"
-             "haskell-text" "haskell-transformers-compat"
-             "haskell-unordered-containers" "haskell-zlib")
-optdepends=('agda-stdlib: for standard library')
-source=("http://hackage.haskell.org/packages/archive/${_hkgname}/${pkgver}/${_hkgname}-${pkgver}.tar.gz")
-sha256sums=('563b8063fc94349b56ae1867e973f1751db0e9a8997af7ede93d3c3a8c66a6b0')
-
-prepare() {
-    sed -e 's/, EdisonAPI == 1.3/, EdisonAPI >= 1.3/' \
-        -e 's/, QuickCheck >= 2.8.2 && < 2.9/, QuickCheck >= 2.8.2 \&\& < 2.10/' \
-        -i $_hkgname-$pkgver/$_hkgname.cabal
-
-    # TODO: Find a better way!
-    # Build it twice to compile the agdai file.
-    cp -a ${_hkgname}-${pkgver}{,-tmp}
-}
-
-build() {
-    cd "${srcdir}/${_hkgname}-${pkgver}"
-    
-    runhaskell Setup configure -O --enable-library-profiling --enable-shared \
-        --prefix=/usr --docdir="/usr/share/doc/${pkgname}" --datasubdir="$pkgname" \
-        --libsubdir=\$compiler/site-local/\$pkgid \
-            -fcpphs -f-uhc
-    LC_CTYPE=en_US.UTF-8 runhaskell Setup build
-
-    cd "${srcdir}/${_hkgname}-${pkgver}-tmp"
-    runhaskell Setup configure --prefix="$PWD/target" --datasubdir="$pkgname"
-    LC_CTYPE=en_US.UTF-8 runhaskell Setup build
-    runhaskell Setup copy
-
-    target/bin/agda target/share/agda/lib/prim/Agda/Primitive.agda
-    for _file in target/share/agda/lib/prim/Agda/Builtin/*.agda; do
-        target/bin/agda "$_file"
-    done
-}
-
-package() {
-    cd "${srcdir}/${_hkgname}-${pkgver}"
-    runhaskell Setup copy --destdir="${pkgdir}"
-
-    install -m644 "${srcdir}/${_hkgname}-${pkgver}-tmp"/target/share/agda/lib/prim/Agda/Primitive.agdai "$pkgdir"/usr/share/agda/lib/prim/Agda/Primitive.agdai  
-    install -m644 "${srcdir}/${_hkgname}-${pkgver}-tmp"/target/share/agda/lib/prim/Agda/Builtin/*.agdai "$pkgdir"/usr/share/agda/lib/prim/Agda/Builtin/
-
-    rm -r "$pkgdir"/usr/{lib,share/doc}
-    install -D -m644 "LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
-}

Copied: agda/repos/community-x86_64/PKGBUILD (from rev 206787, agda/trunk/PKGBUILD)
===================================================================
--- community-x86_64/PKGBUILD	                        (rev 0)
+++ community-x86_64/PKGBUILD	2017-01-11 09:19:11 UTC (rev 206788)
@@ -0,0 +1,60 @@
+# $Id$
+# Maintainer: Felix Yan <felixonmars at archlinux.org>
+# Contributor: Arch Haskell Team <arch-haskell at haskell.org>
+
+_hkgname=Agda
+pkgname=agda
+pkgver=2.5.2
+pkgrel=1
+pkgdesc="A dependently typed functional programming language and proof assistant"
+url="http://wiki.portal.chalmers.se/agda/"
+license=("custom")
+arch=('i686' 'x86_64')
+depends=('gmp' 'libffi' 'zlib')
+makedepends=("ghc=8.0.1" "alex" "happy" "haskell-boxes" "haskell-cpphs" "haskell-data-hash"
+             "haskell-edisonapi" "haskell-edisoncore" "haskell-edit-distance" "haskell-equivalence"
+             "haskell-filepath" "haskell-geniplate-mirror" "haskell-gitrev" "haskell-hashable"
+             "haskell-hashtables" "haskell-ieee754" "haskell-monadplus" "haskell-mtl"
+             "haskell-murmur-hash" "haskell-parallel" "haskell-regex-tdfa" "haskell-strict"
+             "haskell-text" "haskell-transformers-compat" "haskell-unordered-containers"
+             "haskell-zlib")
+optdepends=('agda-stdlib: for standard library')
+source=("http://hackage.haskell.org/packages/archive/${_hkgname}/${pkgver}/${_hkgname}-${pkgver}.tar.gz")
+sha256sums=('d812cec3bf7f03c4b27248572475c7e060154102771a8434cc11ba89f5691439')
+
+prepare() {
+    # TODO: Find a better way!
+    # Build it twice to compile the agdai file.
+    cp -a ${_hkgname}-${pkgver}{,-tmp}
+}
+
+build() {
+    cd "${srcdir}/${_hkgname}-${pkgver}"
+    
+    runhaskell Setup configure -O \
+        --prefix=/usr --docdir="/usr/share/doc/${pkgname}" --datasubdir="$pkgname" \
+        --libsubdir=\$compiler/site-local/\$pkgid \
+            -fcpphs -f-uhc -f-debug
+    LC_CTYPE=en_US.UTF-8 runhaskell Setup build
+
+    cd "${srcdir}/${_hkgname}-${pkgver}-tmp"
+    runhaskell Setup configure --prefix="$PWD/target" --datasubdir="$pkgname"
+    LC_CTYPE=en_US.UTF-8 runhaskell Setup build
+    runhaskell Setup copy
+
+    target/bin/agda target/share/agda/lib/prim/Agda/Primitive.agda
+    for _file in target/share/agda/lib/prim/Agda/Builtin/*.agda; do
+        target/bin/agda "$_file"
+    done
+}
+
+package() {
+    cd "${srcdir}/${_hkgname}-${pkgver}"
+    runhaskell Setup copy --destdir="${pkgdir}"
+
+    install -m644 "${srcdir}/${_hkgname}-${pkgver}-tmp"/target/share/agda/lib/prim/Agda/Primitive.agdai "$pkgdir"/usr/share/agda/lib/prim/Agda/Primitive.agdai  
+    install -m644 "${srcdir}/${_hkgname}-${pkgver}-tmp"/target/share/agda/lib/prim/Agda/Builtin/*.agdai "$pkgdir"/usr/share/agda/lib/prim/Agda/Builtin/
+
+    rm -r "$pkgdir"/usr/{lib,share/doc}
+    install -D -m644 "LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
+}

Deleted: community-x86_64/unordered-containers-0.2.6.patch
===================================================================
--- community-x86_64/unordered-containers-0.2.6.patch	2017-01-11 09:18:41 UTC (rev 206787)
+++ community-x86_64/unordered-containers-0.2.6.patch	2017-01-11 09:19:11 UTC (rev 206788)
@@ -1,40 +0,0 @@
-diff --git a/src/full/Agda/Utils/HashMap.hs b/src/full/Agda/Utils/HashMap.hs
-index 5e1da8b..bd14fac 100644
---- a/src/full/Agda/Utils/HashMap.hs
-+++ b/src/full/Agda/Utils/HashMap.hs
-@@ -1,29 +1,14 @@
- module Agda.Utils.HashMap
-   ( module HashMap
--  , mapMaybe
--  , alter
-   ) where
- 
--import Data.Hashable
- import Data.HashMap.Strict as HashMap
--import qualified Data.Maybe as Maybe
- 
---- | Like 'Data.Map.Strict.mapMaybe'.
-+-- ASR (20 January 2016) Issue 1779: I removed the @mapMaybe@ and
-+-- @alter@ functions because them currently aren't used and
-+-- them were added in unordered-containers 0.2.6.0.
- 
---- This code has not been benchmarked. Other implementations may be
---- more efficient.
-+-- mapMaybe :: (a -> Maybe b) -> HashMap k a -> HashMap k b
- 
--mapMaybe :: (a -> Maybe b) -> HashMap k a -> HashMap k b
--mapMaybe f = fmap Maybe.fromJust . HashMap.filter Maybe.isJust . fmap f
--
---- | Like 'Data.Map.Strict.alter'.
--
--alter :: (Eq k, Hashable k) =>
--         (Maybe a -> Maybe a) -> k -> HashMap k a -> HashMap k a
--alter f k m = case HashMap.lookup k m of
--  Nothing -> case f Nothing of
--    Nothing -> m
--    Just v  -> HashMap.insert k v m
--  Just v  -> case f (Just v) of
--    Nothing -> HashMap.delete k m
--    Just v  -> HashMap.insert k v m
-+-- alter :: (Eq k, Hashable k) =>
-+--          (Maybe a -> Maybe a) -> k -> HashMap k a -> HashMap k a

Copied: agda/repos/community-x86_64/unordered-containers-0.2.6.patch (from rev 206787, agda/trunk/unordered-containers-0.2.6.patch)
===================================================================
--- community-x86_64/unordered-containers-0.2.6.patch	                        (rev 0)
+++ community-x86_64/unordered-containers-0.2.6.patch	2017-01-11 09:19:11 UTC (rev 206788)
@@ -0,0 +1,40 @@
+diff --git a/src/full/Agda/Utils/HashMap.hs b/src/full/Agda/Utils/HashMap.hs
+index 5e1da8b..bd14fac 100644
+--- a/src/full/Agda/Utils/HashMap.hs
++++ b/src/full/Agda/Utils/HashMap.hs
+@@ -1,29 +1,14 @@
+ module Agda.Utils.HashMap
+   ( module HashMap
+-  , mapMaybe
+-  , alter
+   ) where
+ 
+-import Data.Hashable
+ import Data.HashMap.Strict as HashMap
+-import qualified Data.Maybe as Maybe
+ 
+--- | Like 'Data.Map.Strict.mapMaybe'.
++-- ASR (20 January 2016) Issue 1779: I removed the @mapMaybe@ and
++-- @alter@ functions because them currently aren't used and
++-- them were added in unordered-containers 0.2.6.0.
+ 
+--- This code has not been benchmarked. Other implementations may be
+--- more efficient.
++-- mapMaybe :: (a -> Maybe b) -> HashMap k a -> HashMap k b
+ 
+-mapMaybe :: (a -> Maybe b) -> HashMap k a -> HashMap k b
+-mapMaybe f = fmap Maybe.fromJust . HashMap.filter Maybe.isJust . fmap f
+-
+--- | Like 'Data.Map.Strict.alter'.
+-
+-alter :: (Eq k, Hashable k) =>
+-         (Maybe a -> Maybe a) -> k -> HashMap k a -> HashMap k a
+-alter f k m = case HashMap.lookup k m of
+-  Nothing -> case f Nothing of
+-    Nothing -> m
+-    Just v  -> HashMap.insert k v m
+-  Just v  -> case f (Just v) of
+-    Nothing -> HashMap.delete k m
+-    Just v  -> HashMap.insert k v m
++-- alter :: (Eq k, Hashable k) =>
++--          (Maybe a -> Maybe a) -> k -> HashMap k a -> HashMap k a



More information about the arch-commits mailing list