indexed-traversable-instances 0.1.1 → 0.1.1.1
raw patch · 4 files changed
+10/−187 lines, 4 filesdep −criteriondep ~basedep ~indexed-traversabledep ~unordered-containers
Dependencies removed: criterion
Dependency ranges changed: base, indexed-traversable, unordered-containers, vector
Files
- Changelog.md +4/−0
- bench/folds.hs +0/−72
- bench/traversals.hs +0/−78
- indexed-traversable-instances.cabal +6/−37
Changelog.md view
@@ -1,3 +1,7 @@+# 0.1.1 [2021-10-30]++- Add `Solo` instances+ # 0.1 [2020-12-15] - Split out and combine this package functionality from `lens` and `optics`
− bench/folds.hs
@@ -1,72 +0,0 @@-{-# LANGUAGE CPP #-}-{-# LANGUAGE DeriveFunctor #-}-{-# LANGUAGE FlexibleContexts #-}-{-# LANGUAGE RankNTypes #-}-module Main (main) where--import Criterion.Main (bench, bgroup, defaultMain, nf)--import qualified Data.Foldable as F-import qualified Data.HashMap.Lazy as HM-import qualified Data.Map as Map-import qualified Data.Sequence as Seq-import qualified Data.Vector as V--import Data.Foldable.WithIndex-import Data.Functor.WithIndex.Instances ()--main :: IO ()-main = defaultMain- [ bgroup "vector"- [ bgroup "itoList"- [ bench "native" $ nf (V.toList . V.indexed) v- , bench "itoList" $ nf itoList v- ]- ]-#if MIN_VERSION_containers(0,5,0)- , bgroup "sequence"- [ bgroup "itoList"- [ bench "native" $ nf (F.toList . Seq.mapWithIndex (,)) s- , bench "itoList" $ nf itoList s- ]- ]-#endif- , bgroup "list"- [ bgroup "itoList"- [ bench "native" $ nf (zip [(0::Int)..]) l- , bench "itoList" $ nf itoList l- ]- ]- , bgroup "map"- [ bgroup "itoList"- [ bench "native" $ nf Map.toList m- , bench "itoList" $ nf itoList m- ]- ]- , bgroup "hashmap"- [ bgroup "itoList"- [ bench "native" $ nf HM.toList h- , bench "itoList" $ nf itoList h- ]- ]- ]--l :: [Int]-l = [0..10000]-{-# NOINLINE l #-}--h :: HM.HashMap Int Int-h = HM.fromList $ zip l l-{-# NOINLINE h #-}--m :: Map.Map Int Int-m = Map.fromList $ zip l l-{-# NOINLINE m #-}--s :: Seq.Seq Int-s = Seq.fromList l-{-# NOINLINE s #-}--v :: V.Vector Int-v = V.fromList l-{-# NOINLINE v #-}
− bench/traversals.hs
@@ -1,78 +0,0 @@-{-# LANGUAGE CPP #-}-{-# LANGUAGE DeriveFunctor #-}-{-# LANGUAGE FlexibleContexts #-}-{-# LANGUAGE RankNTypes #-}-{-# OPTIONS_GHC -fno-warn-orphans #-}-module Main (main) where--import Criterion.Main (bench, bgroup, defaultMain, nf)--import qualified Data.HashMap.Lazy as HM-import qualified Data.Map as Map-import qualified Data.Sequence as Seq-import qualified Data.Vector as V--import Data.Functor.WithIndex (imap)-import Data.Functor.WithIndex.Instances ()-import Data.Traversable.WithIndex (imapDefault)--main :: IO ()-main = defaultMain- [ bgroup "vector"- [ bgroup "imap"- [ bench "native" $ nf (V.imap (\i x -> x + i + 100)) v- , bench "imap" $ nf (imap (\i x -> x + i + 100)) v- , bench "default" $ nf (imapDefault (\i x -> x + i + 100)) v- ]- ]-#if MIN_VERSION_containers(0,5,0)- , bgroup "sequence"- [ bgroup "imap"- [ bench "native" $ nf (Seq.mapWithIndex (\i x -> x + i + 100)) s- , bench "imap" $ nf (imap (\i x -> x + i + 100)) s- , bench "default" $ nf (imapDefault (\i x -> x + i + 100)) s- ]- ]-#endif- , bgroup "list"- [ bgroup "imap"- [ bench "native" $ nf (zipWith (\i x -> x + i + 100) [0..]) l- , bench "imap" $ nf (imap (\i x -> x + i + 100)) l- , bench "default" $ nf (imapDefault (\i x -> x + i + 100)) l- ]- ]- , bgroup "map"- [ bgroup "imap"- [ bench "native" $ nf (Map.mapWithKey (\i x -> x + i + 100)) m- , bench "imap" $ nf (imap (\i x -> x + i + 100)) m- , bench "default" $ nf (imapDefault (\i x -> x + i + 100)) m- ]- ]- , bgroup "hashmap"- [ bgroup "imap"- [ bench "native" $ nf (HM.mapWithKey (\i x -> x + i + 100)) h- , bench "imap" $ nf (imap (\i x -> x + i + 100)) h- , bench "default" $ nf (imapDefault (\i x -> x + i + 100)) h- ]- ]- ]--l :: [Int]-l = [0..10000]-{-# NOINLINE l #-}--h :: HM.HashMap Int Int-h = HM.fromList $ zip l l-{-# NOINLINE h #-}--m :: Map.Map Int Int-m = Map.fromList $ zip l l-{-# NOINLINE m #-}--s :: Seq.Seq Int-s = Seq.fromList l-{-# NOINLINE s #-}--v :: V.Vector Int-v = V.fromList l-{-# NOINLINE v #-}
indexed-traversable-instances.cabal view
@@ -1,6 +1,6 @@ cabal-version: 1.12 name: indexed-traversable-instances-version: 0.1.1+version: 0.1.1.1 build-type: Simple license: BSD2 license-file: LICENSE@@ -31,8 +31,9 @@ || ==8.6.5 || ==8.8.4 || ==8.10.7- || ==9.0.1- || ==9.2.1+ || ==9.0.2+ || ==9.2.4+ || ==9.4.1 source-repository head type: git@@ -44,12 +45,12 @@ ghc-options: -Wall hs-source-dirs: src build-depends:- base >=4.5 && <4.17+ base >=4.5 && <4.18 , indexed-traversable >=0.1 && <0.2 , OneTuple >=0.3 && <0.4 , tagged >=0.8.6 && <0.9 , unordered-containers >=0.2.8.0 && <0.3- , vector >=0.12.1.2 && <0.13+ , vector >=0.12.1.2 && <0.14 exposed-modules: Data.Functor.WithIndex.Instances @@ -85,35 +86,3 @@ , quickcheck-instances >=0.3.26 && <0.4 , tasty >=1.2.3 && <1.5 , tasty-quickcheck >=0.10.1.1 && <0.11--benchmark folds- type: exitcode-stdio-1.0- main-is: folds.hs- default-language: Haskell2010- hs-source-dirs: bench- ghc-options: -Wall- build-depends:- base- , containers- , indexed-traversable- , indexed-traversable-instances- , unordered-containers- , vector-- build-depends: criterion >=1.5.9.0 && <1.6--benchmark traversals- type: exitcode-stdio-1.0- main-is: traversals.hs- default-language: Haskell2010- hs-source-dirs: bench- ghc-options: -Wall- build-depends:- base- , containers- , indexed-traversable- , indexed-traversable-instances- , unordered-containers- , vector-- build-depends: criterion >=1.5.9.0 && <1.6