packages feed

vector-sized 1.0.3.1 → 1.0.4.0

raw patch · 3 files changed

+15/−1 lines, 3 files

Files

changelog.md view
@@ -1,5 +1,9 @@ # Change Log +## [1.0.4.0] - 2018-07-14++- Add Monad instance for boxed vectors.+ ## [1.0.3.1] - 2018-07-10  - Loosen upper bound on `distributive`
src/Data/Vector/Generic/Sized.hs view
@@ -303,6 +303,16 @@   (*>) = seq   (<*) = flip seq +-- | Treats a @'Data.Vector.Sized.Vector' n a@ as, essentially, a @'Finite'+-- n -> a@, and emulates the 'Monad' instance for that function.+--+-- @'join' :: Vector n (Vector n a) -> Vector n a@ gets the /diagonal/ from+-- a square "matrix".+instance KnownNat n => Monad (Vector Boxed.Vector n) where+  return   = replicate+  xs >>= f = imap (\i x -> f x `index` i) xs+  (>>)     = seq+ -- | The 'Semigroup' instance for sized vectors does not have the same -- behaviour as the 'Semigroup' instance for the unsized vectors found in the -- 'vectors' package. This instance has @(<>) = zipWith (<>)@, but 'vectors'
vector-sized.cabal view
@@ -1,5 +1,5 @@ name:                vector-sized-version:             1.0.3.1+version:             1.0.4.0 synopsis:            Size tagged vectors description:         Please see README.md homepage:            http://github.com/expipiplus1/vector-sized#readme