packages feed

set-extra 1.2 → 1.3

raw patch · 7 files changed

+18/−130 lines, 7 files

Files

Data/Set/Extra.hs view
@@ -1,24 +1,26 @@ module Data.Set.Extra     ( module Data.Set-    , catMaybes -    , flatten-    , concatMap     , mapM+    , mapM_     , filterM+    , catMaybes+    , mapMaybe+    , flatten+    , concatMap     , concatMapM     , any     , all-    , distrib     , or     , and     , ss-    , ssMapM     , toSS     , fromSS+    , ssMapM+    , distrib     , cartesianProduct-    -- , anyM     , groupBy     , partitionM+    , unzip     , gFind     ) where @@ -35,12 +37,18 @@ mapM :: (Monad m, Ord b) => (a -> m b) -> Set a -> m (Set b) mapM f s = List.mapM f (toList s) >>= return . fromList +mapM_ :: (Monad m, Ord b) => (a -> m b) -> Set a -> m ()+mapM_ f s = List.mapM_ f (toList s)+ filterM :: (Ord a, Monad m) => (a -> m Bool) -> Set a -> m (Set a) filterM p s = List.filterM p (toList s) >>= return . fromList  catMaybes :: Ord a => Set (Maybe a) -> Set a catMaybes sm = fold (\ mx s -> maybe s (`insert` s) mx) empty sm +mapMaybe :: (a -> Maybe b) -> Set a -> Set b+mapMaybe f s = catMaybes (Data.Set.map f s)+ flatten :: Ord a => Set (Set a) -> Set a flatten ss' = fold union empty ss' --flatten = unions . toList@@ -99,3 +107,6 @@ partitionM p xs =     List.foldM f (empty, empty) (toList xs)     where f (ts, fs) x = p x >>= \ flag -> return $ if flag then (insert x ts, fs) else (ts, insert x fs)++unzip :: Set (a, b) -> (Set a, Set b)+unzip s = fold (\ (l, r) (ls, rs) -> (Set.insert l ls, Set.insert r rs))
− debian/changelog
@@ -1,18 +0,0 @@-haskell-set-extra (1.2) unstable; urgency=low--  * Fix gFind.-- -- David Fox <dsf@seereason.com>  Wed, 24 Aug 2011 22:29:50 -0700--haskell-set-extra (1.1) unstable; urgency=low--  * Add gFind for sets.-- -- David Fox <dsf@seereason.com>  Wed, 24 Aug 2011 13:16:35 -0700--haskell-set-extra (1.0-1~hackage1) unstable; urgency=low--  * Debianization generated by cabal-debian-- -- David Fox <dsf@seereason.com>  Wed, 24 Aug 2011 10:26:35 -0700-
− debian/compat
@@ -1,1 +0,0 @@-7
− debian/control
@@ -1,62 +0,0 @@-Source: haskell-set-extra-Priority: extra-Section: haskell-Maintainer: David Fox <dsf@seereason.com>-Build-Depends: debhelper (>= 7.0),-               haskell-devscripts (>= 0.8),-               cdbs,-               ghc,-               ghc-prof,-               libghc-mtl-prof,-               libghc-syb-prof-Build-Depends-Indep: ghc-doc,-                     libghc-mtl-doc,-                     libghc-syb-doc-Standards-Version: 3.9.1-Homepage: http://src.seereason.com/set-extra--Package: libghc-set-extra-dev-Architecture: any-Depends: ${shlibs:Depends},-         ${haskell:Depends},-         ${misc:Depends}-Recommends: ${haskell:Recommends}-Suggests: ${haskell:Suggests}-Provides: ${haskell:Provides}-Description: Functions that could be added to Data.Set.- Functions that could be added to Data.Set.- .-  Author: David Fox-  Upstream-Maintainer: David Fox <dsf@seereason.com>- .- This package contains the normal library files.--Package: libghc-set-extra-prof-Architecture: any-Depends: ${haskell:Depends},-         ${misc:Depends}-Recommends: ${haskell:Recommends}-Suggests: ${haskell:Suggests}-Provides: ${haskell:Provides}-Description: Functions that could be added to Data.Set.- Functions that could be added to Data.Set.- .-  Author: David Fox-  Upstream-Maintainer: David Fox <dsf@seereason.com>- .- This package contains the libraries compiled with profiling enabled.--Package: libghc-set-extra-doc-Architecture: all-Section: doc-Depends: ${haskell:Depends},-         ${misc:Depends}-Recommends: ${haskell:Recommends}-Suggests: ${haskell:Suggests}-Description: Functions that could be added to Data.Set.- Functions that could be added to Data.Set.- .-  Author: David Fox-  Upstream-Maintainer: David Fox <dsf@seereason.com>- .- This package contains the documentation files.
− debian/copyright
@@ -1,34 +0,0 @@-This package was cabalized by David Fox-<dsf@seereason.com> on August 24, 2011.--Copyright (c) 2011, David Fox--All rights reserved.--Redistribution and use in source and binary forms, with or without-modification, are permitted provided that the following conditions are-met:--    * Redistributions of source code must retain the above copyright-      notice, this list of conditions and the following disclaimer.--    * Redistributions in binary form must reproduce the above-      copyright notice, this list of conditions and the following-      disclaimer in the documentation and/or other materials provided-      with the distribution.--    * The names of contributors may not be used to endorse or promote-      products derived from this software without specific prior-      written permission. --THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS-"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR-A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT-OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,-SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT-LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY-THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
− debian/rules
@@ -1,8 +0,0 @@-#!/usr/bin/make -f-include /usr/share/cdbs/1/rules/debhelper.mk-include /usr/share/cdbs/1/class/hlibrary.mk---# How to install an extra file into the documentation package-#binary-fixup/libghc-set-extra-doc::-#	echo "Some informative text" > debian/libghc-set-extra-doc/usr/share/doc/libghc-set-extra-doc/AnExtraDocFile
set-extra.cabal view
@@ -1,5 +1,5 @@ Name:           set-extra-Version:        1.2+Version:        1.3 License:        BSD3 License-File:	COPYING Author:         David Fox