Skip to content

Commit

Permalink
Enabled native groupBy for vector
Browse files Browse the repository at this point in the history
groupBy been available since vector-0.13.0.0
closes snoyberg#251
  • Loading branch information
BebeSparkelSparkel committed Nov 28, 2024
1 parent 95c991b commit dce5501
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 5 deletions.
5 changes: 5 additions & 0 deletions mono-traversable/ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# ChangeLog for mono-traversable

## 1.0.21.1

* Enabled native `groupBy` for Vector, U.Vector, VS.Vector since they have been available since vector-0.13.0.0
[#251](https://github.com/snoyberg/mono-traversable/issues/251)

## 1.0.21.0

* Support for vector 0.13.2.0, adding instances for [`Data.Vector.Strict`](https://hackage.haskell.org/package/vector-0.13.2.0/docs/Data-Vector-Strict.html) data structure.
Expand Down
2 changes: 1 addition & 1 deletion mono-traversable/mono-traversable.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ cabal-version: 1.12
-- see: https://github.com/sol/hpack

name: mono-traversable
version: 1.0.21.0
version: 1.0.21.1
synopsis: Type classes for mapping, folding, and traversing monomorphic containers
description: Please see the README at <https://www.stackage.org/package/mono-traversable>
category: Data
Expand Down
2 changes: 1 addition & 1 deletion mono-traversable/package.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: mono-traversable
version: 1.0.21.0
version: 1.0.21.1
synopsis: Type classes for mapping, folding, and traversing monomorphic containers
description: Please see the README at <https://www.stackage.org/package/mono-traversable>
category: Data
Expand Down
18 changes: 15 additions & 3 deletions mono-traversable/src/Data/Sequences.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1067,7 +1067,11 @@ instance IsSequence (V.Vector a) where
unsnoc v
| V.null v = Nothing
| otherwise = Just (V.init v, V.last v)
--groupBy = V.groupBy
#if MIN_VERSION_vector(0,13,0)
-- | since 1.0.21.1
groupBy = V.groupBy
{-# INLINE groupBy #-}
#endif
tailEx = V.tail
initEx = V.init
unsafeTail = V.unsafeTail
Expand Down Expand Up @@ -1218,7 +1222,11 @@ instance U.Unbox a => IsSequence (U.Vector a) where
unsnoc v
| U.null v = Nothing
| otherwise = Just (U.init v, U.last v)
--groupBy = U.groupBy
#if MIN_VERSION_vector(0,13,0)
-- | since 1.0.21.1
groupBy = U.groupBy
{-# INLINE groupBy #-}
#endif
tailEx = U.tail
initEx = U.init
unsafeTail = U.unsafeTail
Expand Down Expand Up @@ -1291,7 +1299,11 @@ instance VS.Storable a => IsSequence (VS.Vector a) where
unsnoc v
| VS.null v = Nothing
| otherwise = Just (VS.init v, VS.last v)
--groupBy = U.groupBy
#if MIN_VERSION_vector(0,13,0)
-- | since 1.0.21.1
groupBy = VS.groupBy
{-# INLINE groupBy #-}
#endif
tailEx = VS.tail
initEx = VS.init
unsafeTail = VS.unsafeTail
Expand Down

0 comments on commit dce5501

Please sign in to comment.