list-extras 0.2.0 → 0.2.1
raw patch · 4 files changed
+18/−8 lines, 4 files
Files
- Data/List/Extras/Argmax.hs +2/−3
- Data/List/Extras/LazyLength.hs +4/−2
- Data/List/Extras/Pair.hs +10/−1
- list-extras.cabal +2/−2
Data/List/Extras/Argmax.hs view
@@ -2,7 +2,7 @@ {-# OPTIONS_GHC -Wall -Werror #-} ------------------------------------------------------------------- ~ 2008.07.25+-- ~ 2008.08.17 -- | -- Module : Data.List.Extras.ArgMax -- Copyright : Copyright (c) 2007--2008 wren ng thornton@@ -49,9 +49,8 @@ -- | Minimize the number of string literals-{-# NOINLINE emptyListError #-} emptyListError :: String -> a-emptyListError fun = error $ "Data.List.Extras.ArgMax."++fun++": empty list"+emptyListError fun = error $ "Data.List.Extras.Argmax."++fun++": empty list" -- | Apply a list function unsafely. For internal use.
Data/List/Extras/LazyLength.hs view
@@ -1,8 +1,10 @@ {-# OPTIONS_GHC -Wall -Werror #-}+-- We need this in order to ensure the rules are picked up+{-# OPTIONS_GHC -O2 -fglasgow-exts #-} ------------------------------------------------------------------- ~ 2008.07.25+-- ~ 2008.08.17 -- | -- Module : Data.List.Extras.LazyLength -- Copyright : Copyright (c) 2007--2008 wren ng thornton@@ -122,7 +124,7 @@ "lengthCompare/(<)" forall xs ys. length xs < length ys = lengthCompare xs ys == LT -"lengthCompare/compare" forall n xs.+"lengthCompare/compare" forall xs ys. compare (length xs) (length ys) = lengthCompare xs ys #-}
Data/List/Extras/Pair.hs view
@@ -2,7 +2,7 @@ {-# OPTIONS_GHC -Wall -Werror #-} ------------------------------------------------------------------- ~ 2008.07.11+-- ~ 2008.08.12 -- | -- Module : Data.List.Extras.Pair -- Copyright : Copyright (c) 2007--2008 wren ng thornton@@ -30,6 +30,15 @@ ---------------------------------------------------------------- ----------------------------------------------------------------+-- TODO: benchmark fusion performance of:+--+-- foldr cons nil ... zipWith (,)+-- zipWithBy (,) cons nil+--+-- ...That is, the latter is a manual fusion of the former, but+-- does zip/zipWith have a special ability to fuse with the incoming+-- lists? Or can foldr fuse with consumers in ways zipWithBy can't?+ -- | An unsafe variant of 'pairWithBy' to fill out the interface. zipWithBy :: (a -> b -> c) -- tuple homomorphism -> (c -> d -> d) -> d -- list homomorphism
list-extras.cabal view
@@ -1,9 +1,9 @@ ------------------------------------------------------------------- wren ng thornton <wren@cpan.org> ~ 2008.07.25+-- wren ng thornton <wren@community.haskell.org> ~ 2008.08.17 ---------------------------------------------------------------- Name: list-extras-Version: 0.2.0+Version: 0.2.1 Cabal-Version: >= 1.2 Build-Type: Simple Stability: stable