linear 1.18.3 → 1.19
raw patch · 3 files changed
+9/−3 lines, 3 filesdep ~basedep ~transformers
Dependency ranges changed: base, transformers
Files
- CHANGELOG.markdown +4/−0
- linear.cabal +1/−1
- src/Linear/V.hs +4/−2
CHANGELOG.markdown view
@@ -1,3 +1,7 @@+1.19+----+* Change the Ixed instance for `Linear.V` to use `Int` as the index type. This makes `V n` a _lot_ easier to use.+ 1.18.3 ------ * Compile warning-free on GHC 7.10.
linear.cabal view
@@ -1,6 +1,6 @@ name: linear category: Math, Algebra-version: 1.18.3+version: 1.19 license: BSD3 cabal-version: >= 1.8 license-file: LICENSE
src/Linear/V.hs view
@@ -343,11 +343,13 @@ index (V xs) i = xs V.! i {-# INLINE index #-} -type instance Index (V n a) = E (V n)+type instance Index (V n a) = Int type instance IxValue (V n a) = a instance Ixed (V n a) where- ix = el+ ix i f (V as)+ | i < 0 || i >= V.length as = pure $ V as+ | otherwise = f (as ! i) <&> \a -> V $ as V.// [(i, a)] {-# INLINE ix #-} instance Dim n => MonadZip (V n) where