vector-instances 3.0 → 3.1
raw patch · 2 files changed
+17/−5 lines, 2 filesdep +lensdep ~vector
Dependencies added: lens
Dependency ranges changed: vector
Files
- Data/Vector/Instances.hs +14/−3
- vector-instances.cabal +3/−2
Data/Vector/Instances.hs view
@@ -1,4 +1,5 @@ {-# LANGUAGE TypeFamilies #-}+{-# LANGUAGE MultiParamTypeClasses #-} ----------------------------------------------------------------------------- -- | -- Module : Data.Vector.Instances@@ -28,11 +29,21 @@ import Data.Vector.Fusion.Stream.Size import Data.Vector (Vector,(++),drop,length,imap,ifoldr, ifoldl, izipWith,(!?),(//), generate) import qualified Data.Vector as Vector+import Control.Lens hiding (Indexable) type instance Key Vector = Int +instance FunctorWithIndex Int Vector where+ imap = Vector.imap++instance FoldableWithIndex Int Vector where+ ifoldMap f = Vector.ifoldr (\i -> mappend . f i) mempty++instance TraversableWithIndex Int Vector where+ itraverse = withIndex (indexed traverse)+ instance Keyed Vector where- mapWithKey = imap+ mapWithKey = Vector.imap {-# INLINE mapWithKey #-} instance Zip Vector where@@ -61,9 +72,9 @@ {-# INLINE replace #-} instance FoldableWithKey Vector where- foldrWithKey = ifoldr+ foldrWithKey = Vector.ifoldr {-# INLINE foldrWithKey #-}- foldlWithKey = ifoldl+ foldlWithKey = Vector.ifoldl {-# INLINE foldlWithKey #-} instance Apply Vector where
vector-instances.cabal view
@@ -1,5 +1,5 @@ name: vector-instances-version: 3.0+version: 3.1 synopsis: Orphan Instances for 'Data.Vector' homepage: http://github.com/ekmett/vector-instances bug-reports: http://github.com/ekmett/vector-instances/issues@@ -25,9 +25,10 @@ build-depends: base >= 4 && < 5,- vector >= 0.9 && < 0.10,+ vector >= 0.10 && < 0.11, semigroupoids >= 3.0 && < 3.1, semigroups >= 0.8.3.1 && < 0.9,+ lens >= 3.2 && < 3.4, comonad >= 3.0 && < 3.1, pointed >= 3.0 && < 3.1, keys >= 3.0 && < 3.1