Skip to content

Commit

Permalink
Merge pull request #437 from haskell/release/vector-0.13
Browse files Browse the repository at this point in the history
Prepare vector 0.13.0.0 release
  • Loading branch information
lehins committed Jun 19, 2022
2 parents 42f92f3 + 3358ca5 commit 967159d
Show file tree
Hide file tree
Showing 27 changed files with 179 additions and 65 deletions.
3 changes: 3 additions & 0 deletions vector-stream/LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
Copyright (c) 2008-2012, Roman Leshchinskiy
2020-2022, Alexey Kuleshevich
2020-2022, Aleksey Khudyakov
2020-2022, Andrew Lelechenko
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
5 changes: 4 additions & 1 deletion vector-stream/src/Data/Stream/Monadic.hs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,12 @@
-- |
-- Module : Data.Stream.Monadic
-- Copyright : (c) Roman Leshchinskiy 2008-2010
-- Alexey Kuleshevich 2020-2022
-- Aleksey Khudyakov 2020-2022
-- Andrew Lelechenko 2020-2022
-- License : BSD-style
--
-- Maintainer : Roman Leshchinskiy <rl@cse.unsw.edu.au>
-- Maintainer : Haskell Libraries Team <libraries@haskell.org>
-- Stability : experimental
-- Portability : non-portable
--
Expand Down
9 changes: 7 additions & 2 deletions vector-stream/vector-stream.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ License-File: LICENSE
Author: Roman Leshchinskiy <rl@cse.unsw.edu.au>
Maintainer: Haskell Libraries Team <libraries@haskell.org>
Copyright: (c) Roman Leshchinskiy 2008-2012
Alexey Kuleshevich 2020-2022,
Aleksey Khudyakov 2020-2022,
Andrew Lelechenko 2020-2022
Homepage: https://github.com/haskell/vector
Bug-Reports: https://github.com/haskell/vector/issues
Category: Data, Data Structures
Expand All @@ -20,8 +23,9 @@ Tested-With:
GHC == 8.4.4,
GHC == 8.6.5,
GHC == 8.8.4,
GHC == 8.10.4
GHC == 9.0.1
GHC == 8.10.4,
GHC == 9.0.1,
GHC == 9.2.3

Cabal-Version: >=1.10
Build-Type: Simple
Expand All @@ -45,3 +49,4 @@ Library
source-repository head
type: git
location: https://github.com/haskell/vector.git
subdir: vector-stream
3 changes: 3 additions & 0 deletions vector/LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
Copyright (c) 2008-2012, Roman Leshchinskiy
2020-2022, Alexey Kuleshevich
2020-2022, Aleksey Khudyakov
2020-2022, Andrew Lelechenko
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
73 changes: 42 additions & 31 deletions vector/changelog.md
Original file line number Diff line number Diff line change
@@ -1,62 +1,73 @@
# Changes in version 0.13.0.0

* Methods of type classes `Data.Vector.Generic.Mutable.MVector` and
`Data.Vector.Generic.Vector` use concrete monads (ST,etc) being
polymorphic. This allows use of GND and deriving via to define
instances. Rest of API is unchanged and most existing instances should
compiler fine with new definitions.
* `mkType` from `Data.Vector.Generic` is deprecated in favor of
`Data.Data.mkNoRepType`
* The role signatures on several `Vector` types were too permissive, so they
have been tightened up:
* The role signature for `Data.Vector.Mutable.MVector` is now
`type role MVector nominal representational` (previously, both arguments
were `phantom`).
were `phantom`). [#224](https://github.com/haskell/vector/pull/224)
* The role signature for `Data.Vector.Primitive.Vector` is now
`type role Vector nominal` (previously, it was `phantom`).
The role signature for `Data.Vector.Primitive.Mutable.MVector` is now
`type role MVector nominal nominal` (previously, both arguments were
`phantom`).
`phantom`). [#316](https://github.com/haskell/vector/pull/316)
* The role signature for `Data.Vector.Storable.Vector` is now
`type role Vector nominal` (previous, it was `phantom`), and the signature
for `Data.Vector.Storable.Mutable.MVector` is now
`type role MVector nominal nominal` (previous, both arguments were
`phantom`).
`phantom`). [#235](https://github.com/haskell/vector/pull/235)

We pick `nominal` for the role of the last argument instead of
`representational` since the internal structure of a `Storable` vector
is determined by the `Storable` instance of the element type, and it is
not guaranteed that the `Storable` instances between two
representationally equal types will preserve this internal structure.
One consequence of this choice is that it is no longer possible to
`coerce` between `Storable.Vector a` and `Storable.Vector b` if `a` and
`b` are nominally distinct but representationally equal types. We now
provide `unsafeCoerce{M}Vector` functions in
`Data.Vector.Storable{.Mutable}` to allow this (the onus is on the user
to ensure that no `Storable` invariants are broken when using these
functions).
`representational` since the internal structure of a `Storable` vector is
determined by the `Storable` instance of the element type, and it is not
guaranteed that the `Storable` instances between two representationally
equal types will preserve this internal structure. One consequence of this
choice is that it is no longer possible to `coerce` between
`Storable.Vector a` and `Storable.Vector b` if `a` and `b` are nominally
distinct but representationally equal types. We now provide
`unsafeCoerce{M}Vector` and `unsafeCast` functions to allow this (the onus
is on the user to ensure that no `Storable` invariants are broken when
using these functions).
* Methods of type classes `Data.Vector.Generic.Mutable.MVector` and
`Data.Vector.Generic.Vector` use concrete monads (`ST`, etc) istead of being
polymorphic (`PrimMonad`, etc). [#335](https://github.com/haskell/vector/pull/335).
This makes it possible to derive `Unbox` with:
* `GeneralizedNewtypeDeriving`
* via `UnboxViaPrim` and `Prim` instance
* via `As` and `IsoUnbox` instance: [#378](https://github.com/haskell/vector/pull/378)
* Add `MonadFix` instance for boxed vectors: [#312](https://github.com/haskell/vector/pull/312)
* Re-export `PrimMonad` and `RealWorld` from mutable vectors:
[#320](https://github.com/haskell/vector/pull/320)
* Add `maximumOn` and `minimumOn`: [#356](https://github.com/haskell/vector/pull/356)
* The functions `scanl1`, `scanl1'`, `scanr1`, and `scanr1'` for immutable
vectors are now defined when given empty vectors as arguments,
in which case they return empty vectors. This new behavior is consistent
with the one of the corresponding functions in `Data.List`.
Prior to this change, applying an empty vector to any of those functions
resulted in an error. This change was introduced in:
[#382](https://github.com/haskell/vector/pull/382)
* Remove redundant `Storable` constraints on to/from `ForeignPtr` conversions
* Add `unsafeCast` to `Primitive` vectors
* Add `groupBy` and `group` for `Data.Vector.Generic` and the specialized
version in `Data.Vector`, `Data.Vector.Unboxed`, `Data.Vector.Storable` and
`Data.Vector.Primitive`.
* Add `toArraySlice` and `unsafeFromArraySlice` functions for conversion to and
from the underlying boxed `Array`.
* Change allocation strategy for `unfoldrN`: [#387](https://github.com/haskell/vector/pull/387)
* Remove `CPP` driven error reporting in favor of `HasCallStack`:
[#397](https://github.com/haskell/vector/pull/397)
* Remove redundant `Storable` constraints on to/from `ForeignPtr` conversions:
[#394](https://github.com/haskell/vector/pull/394)
* Add `unsafeCast` to `Primitive` vectors: [#401](https://github.com/haskell/vector/pull/401)
* Make `(!?)` operator strict: [#402](https://github.com/haskell/vector/pull/402)
* Add `readMaybe`: [#425](https://github.com/haskell/vector/pull/425)
* Add `groupBy` and `group` for `Data.Vector.Generic` and the specialized
version in `Data.Vector`, `Data.Vector.Unboxed`, `Data.Vector.Storable` and
`Data.Vector.Primitive`. [#427](https://github.com/haskell/vector/pull/427)
* Add `toArraySlice` and `unsafeFromArraySlice` functions for conversion to and
from the underlying boxed `Array`: [#434](https://github.com/haskell/vector/pull/434)

# Changes in version 0.12.3.1

* Bugfix for ghcjs and `Double` memset for `Storable` vector:
[#410](https://github.com/haskell/vector/issues/410)
* Avoid haddock bug: [#383](https://github.com/haskell/vector/issues/383)
* Improve haddock and doctests
* Disable problematic tests with -boundschecks [#407](https://github.com/haskell/vector/pull/407)
* Bugfix for ghcjs and `Double` memset for `Storable` vector:
[#410](https://github.com/haskell/vector/issues/410)
* Avoid haddock bug: [#383](https://github.com/haskell/vector/issues/383)
* Improve haddock and doctests
* Disable problematic tests with -boundschecks [#407](https://github.com/haskell/vector/pull/407)

# Changes in version 0.12.3.0

Expand Down
9 changes: 8 additions & 1 deletion vector/src/Data/Vector.hs
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,12 @@
-- |
-- Module : Data.Vector
-- Copyright : (c) Roman Leshchinskiy 2008-2010
-- Alexey Kuleshevich 2020-2022
-- Aleksey Khudyakov 2020-2022
-- Andrew Lelechenko 2020-2022
-- License : BSD-style
--
-- Maintainer : Roman Leshchinskiy <rl@cse.unsw.edu.au>
-- Maintainer : Haskell Libraries Team <libraries@haskell.org>
-- Stability : experimental
-- Portability : non-portable
--
Expand Down Expand Up @@ -1713,6 +1716,8 @@ maximumBy = G.maximumBy
-- (2,'a')
-- >>> V.maximumOn fst $ V.fromList [(1,'a'), (1,'b')]
-- (1,'a')
--
-- @since 0.13.0.0
maximumOn :: Ord b => (a -> b) -> Vector a -> a
{-# INLINE maximumOn #-}
maximumOn = G.maximumOn
Expand Down Expand Up @@ -1761,6 +1766,8 @@ minimumBy = G.minimumBy
-- (1,'b')
-- >>> V.minimumOn fst $ V.fromList [(1,'a'), (1,'b')]
-- (1,'a')
--
-- @since 0.13.0.0
minimumOn :: Ord b => (a -> b) -> Vector a -> a
{-# INLINE minimumOn #-}
minimumOn = G.minimumOn
Expand Down
5 changes: 4 additions & 1 deletion vector/src/Data/Vector/Fusion/Bundle.hs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@
-- |
-- Module : Data.Vector.Fusion.Bundle
-- Copyright : (c) Roman Leshchinskiy 2008-2010
-- Alexey Kuleshevich 2020-2022
-- Aleksey Khudyakov 2020-2022
-- Andrew Lelechenko 2020-2022
-- License : BSD-style
--
-- Maintainer : Roman Leshchinskiy <rl@cse.unsw.edu.au>
-- Maintainer : Haskell Libraries Team <libraries@haskell.org>
-- Stability : experimental
-- Portability : non-portable
--
Expand Down
5 changes: 4 additions & 1 deletion vector/src/Data/Vector/Fusion/Bundle/Monadic.hs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,12 @@
-- |
-- Module : Data.Vector.Fusion.Bundle.Monadic
-- Copyright : (c) Roman Leshchinskiy 2008-2010
-- Alexey Kuleshevich 2020-2022
-- Aleksey Khudyakov 2020-2022
-- Andrew Lelechenko 2020-2022
-- License : BSD-style
--
-- Maintainer : Roman Leshchinskiy <rl@cse.unsw.edu.au>
-- Maintainer : Haskell Libraries Team <libraries@haskell.org>
-- Stability : experimental
-- Portability : non-portable
--
Expand Down
5 changes: 4 additions & 1 deletion vector/src/Data/Vector/Fusion/Bundle/Size.hs
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
-- |
-- Module : Data.Vector.Fusion.Bundle.Size
-- Copyright : (c) Roman Leshchinskiy 2008-2010
-- Alexey Kuleshevich 2020-2022
-- Aleksey Khudyakov 2020-2022
-- Andrew Lelechenko 2020-2022
-- License : BSD-style
--
-- Maintainer : Roman Leshchinskiy <rl@cse.unsw.edu.au>
-- Maintainer : Haskell Libraries Team <libraries@haskell.org>
-- Stability : experimental
-- Portability : portable
--
Expand Down
5 changes: 4 additions & 1 deletion vector/src/Data/Vector/Fusion/Stream/Monadic.hs
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
-- |
-- Module : Data.Vector.Fusion.Stream.Monadic
-- Copyright : (c) Roman Leshchinskiy 2008-2010
-- Alexey Kuleshevich 2020-2022
-- Aleksey Khudyakov 2020-2022
-- Andrew Lelechenko 2020-2022
-- License : BSD-style
--
-- Maintainer : Roman Leshchinskiy <rl@cse.unsw.edu.au>
-- Maintainer : Haskell Libraries Team <libraries@haskell.org>
-- Stability : experimental
-- Portability : non-portable
--
Expand Down
5 changes: 4 additions & 1 deletion vector/src/Data/Vector/Fusion/Util.hs
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
-- |
-- Module : Data.Vector.Fusion.Util
-- Copyright : (c) Roman Leshchinskiy 2009
-- Alexey Kuleshevich 2020-2022
-- Aleksey Khudyakov 2020-2022
-- Andrew Lelechenko 2020-2022
-- License : BSD-style
--
-- Maintainer : Roman Leshchinskiy <rl@cse.unsw.edu.au>
-- Maintainer : Haskell Libraries Team <libraries@haskell.org>
-- Stability : experimental
-- Portability : portable
--
Expand Down
9 changes: 8 additions & 1 deletion vector/src/Data/Vector/Generic.hs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,12 @@
-- |
-- Module : Data.Vector.Generic
-- Copyright : (c) Roman Leshchinskiy 2008-2010
-- Alexey Kuleshevich 2020-2022
-- Aleksey Khudyakov 2020-2022
-- Andrew Lelechenko 2020-2022
-- License : BSD-style
--
-- Maintainer : Roman Leshchinskiy <rl@cse.unsw.edu.au>
-- Maintainer : Haskell Libraries Team <libraries@haskell.org>
-- Stability : experimental
-- Portability : non-portable
--
Expand Down Expand Up @@ -1873,6 +1876,8 @@ maximumBy cmpr = Bundle.foldl1' maxBy . stream
-- (2,'a')
-- >>> V.maximumOn fst $ V.fromList [(1,'a'), (1,'b')]
-- (1,'a')
--
-- @since 0.13.0.0
maximumOn :: (Ord b, Vector v a) => (a -> b) -> v a -> a
{-# INLINE maximumOn #-}
maximumOn f = fst . Bundle.foldl1' maxBy . Bundle.map (\a -> (a, f a)) . stream
Expand Down Expand Up @@ -1931,6 +1936,8 @@ minimumBy cmpr = Bundle.foldl1' minBy . stream
-- (1,'b')
-- >>> V.minimumOn fst $ V.fromList [(1,'a'), (1,'b')]
-- (1,'a')
--
-- @since 0.13.0.0
minimumOn :: (Ord b, Vector v a) => (a -> b) -> v a -> a
{-# INLINE minimumOn #-}
minimumOn f = fst . Bundle.foldl1' minBy . Bundle.map (\a -> (a, f a)) . stream
Expand Down
5 changes: 4 additions & 1 deletion vector/src/Data/Vector/Generic/Base.hs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,12 @@
-- |
-- Module : Data.Vector.Generic.Base
-- Copyright : (c) Roman Leshchinskiy 2008-2010
-- Alexey Kuleshevich 2020-2022
-- Aleksey Khudyakov 2020-2022
-- Andrew Lelechenko 2020-2022
-- License : BSD-style
--
-- Maintainer : Roman Leshchinskiy <rl@cse.unsw.edu.au>
-- Maintainer : Haskell Libraries Team <libraries@haskell.org>
-- Stability : experimental
-- Portability : non-portable
--
Expand Down
5 changes: 4 additions & 1 deletion vector/src/Data/Vector/Generic/Mutable.hs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,12 @@
-- |
-- Module : Data.Vector.Generic.Mutable
-- Copyright : (c) Roman Leshchinskiy 2008-2010
-- Alexey Kuleshevich 2020-2022
-- Aleksey Khudyakov 2020-2022
-- Andrew Lelechenko 2020-2022
-- License : BSD-style
--
-- Maintainer : Roman Leshchinskiy <rl@cse.unsw.edu.au>
-- Maintainer : Haskell Libraries Team <libraries@haskell.org>
-- Stability : experimental
-- Portability : non-portable
--
Expand Down
5 changes: 4 additions & 1 deletion vector/src/Data/Vector/Generic/Mutable/Base.hs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@
-- |
-- Module : Data.Vector.Generic.Mutable.Base
-- Copyright : (c) Roman Leshchinskiy 2008-2011
-- Alexey Kuleshevich 2020-2022
-- Aleksey Khudyakov 2020-2022
-- Andrew Lelechenko 2020-2022
-- License : BSD-style
--
-- Maintainer : Roman Leshchinskiy <rl@cse.unsw.edu.au>
-- Maintainer : Haskell Libraries Team <libraries@haskell.org>
-- Stability : experimental
-- Portability : non-portable
--
Expand Down
5 changes: 4 additions & 1 deletion vector/src/Data/Vector/Generic/New.hs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@
-- |
-- Module : Data.Vector.Generic.New
-- Copyright : (c) Roman Leshchinskiy 2008-2010
-- Alexey Kuleshevich 2020-2022
-- Aleksey Khudyakov 2020-2022
-- Andrew Lelechenko 2020-2022
-- License : BSD-style
--
-- Maintainer : Roman Leshchinskiy <rl@cse.unsw.edu.au>
-- Maintainer : Haskell Libraries Team <libraries@haskell.org>
-- Stability : experimental
-- Portability : non-portable
--
Expand Down
9 changes: 6 additions & 3 deletions vector/src/Data/Vector/Internal/Check.hs
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
{-# LANGUAGE CPP #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE MagicHash #-}
{-# OPTIONS_HADDOCK hide #-}

-- |
-- Module : Data.Vector.Internal.Check
-- Copyright : (c) Roman Leshchinskiy 2009
-- Alexey Kuleshevich 2020-2022
-- Aleksey Khudyakov 2020-2022
-- Andrew Lelechenko 2020-2022
-- License : BSD-style
--
-- Maintainer : Roman Leshchinskiy <rl@cse.unsw.edu.au>
-- Maintainer : Haskell Libraries Team <libraries@haskell.org>
-- Stability : experimental
-- Portability : non-portable
--
Expand All @@ -22,8 +26,7 @@ module Data.Vector.Internal.Check (
inRange
) where

import GHC.Base( Int(..) )
import GHC.Prim( Int# )
import GHC.Exts (Int(..), Int#)
import Prelude hiding( error, (&&), (||), not )
import qualified Prelude as P
import GHC.Stack (HasCallStack)
Expand Down
5 changes: 4 additions & 1 deletion vector/src/Data/Vector/Mutable.hs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,12 @@
-- |
-- Module : Data.Vector.Mutable
-- Copyright : (c) Roman Leshchinskiy 2008-2010
-- Alexey Kuleshevich 2020-2022
-- Aleksey Khudyakov 2020-2022
-- Andrew Lelechenko 2020-2022
-- License : BSD-style
--
-- Maintainer : Roman Leshchinskiy <rl@cse.unsw.edu.au>
-- Maintainer : Haskell Libraries Team <libraries@haskell.org>
-- Stability : experimental
-- Portability : non-portable
--
Expand Down
Loading

0 comments on commit 967159d

Please sign in to comment.