linear 1.18.1.1 → 1.18.3
raw patch · 26 files changed
+144/−51 lines, 26 filesdep ~basePVP ok
version bump matches the API change (PVP)
Dependency ranges changed: base
API changes (from Hackage documentation)
+ Linear.Affine: instance NFData (f a) => NFData (Point f a)
Files
- .travis.yml +30/−14
- CHANGELOG.markdown +9/−0
- LICENSE +1/−1
- linear.cabal +2/−2
- src/Linear.hs +1/−1
- src/Linear/Affine.hs +3/−0
- src/Linear/Algebra.hs +8/−0
- src/Linear/Binary.hs +8/−1
- src/Linear/Conjugate.hs +1/−1
- src/Linear/Covector.hs +9/−0
- src/Linear/Epsilon.hs +1/−1
- src/Linear/Instances.hs +6/−2
- src/Linear/Matrix.hs +3/−1
- src/Linear/Metric.hs +1/−1
- src/Linear/Plucker.hs +8/−3
- src/Linear/Plucker/Coincides.hs +1/−1
- src/Linear/Projection.hs +1/−1
- src/Linear/Quaternion.hs +8/−3
- src/Linear/Trace.hs +2/−2
- src/Linear/V.hs +5/−1
- src/Linear/V0.hs +3/−3
- src/Linear/V1.hs +1/−1
- src/Linear/V2.hs +8/−3
- src/Linear/V3.hs +8/−3
- src/Linear/V4.hs +8/−3
- src/Linear/Vector.hs +8/−2
.travis.yml view
@@ -1,18 +1,37 @@-language: haskell-before_install:- # Uncomment whenever hackage is down.- # - mkdir -p ~/.cabal && cp travis/config ~/.cabal/config && cabal update+env:+ - GHCVER=7.4.2 CABALVER=1.16+ - GHCVER=7.6.3 CABALVER=1.16+ - GHCVER=7.8.4 CABALVER=1.18+ - GHCVER=7.10.1 CABALVER=1.22+ - GHCVER=head CABALVER=1.22 - # Try installing some of the build-deps with apt-get for speed.- - travis/cabal-apt-install $mode+matrix:+ allow_failures:+ - env: GHCVER=head CABALVER=1.22 +before_install:+ - travis_retry sudo add-apt-repository -y ppa:hvr/ghc+ - travis_retry sudo apt-get update+ - travis_retry sudo apt-get install cabal-install-$CABALVER ghc-$GHCVER+ - export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$PATH+ - cabal --version+ install:- - cabal configure $mode- - cabal build+ - travis_retry cabal update+ - cabal install --enable-tests --only-dependencies script:- - $script- - hlint src --cpp-define HLINT+ - cabal configure -v2 --enable-tests+ - cabal build+ - cabal sdist+ - export SRC_TGZ=$(cabal info . | awk '{print $2 ".tar.gz";exit}') ;+ cd dist/;+ if [ -f "$SRC_TGZ" ]; then+ cabal install "$SRC_TGZ";+ else+ echo "expected '$SRC_TGZ' not found";+ exit 1;+ fi notifications: irc:@@ -20,7 +39,4 @@ - "irc.freenode.org#haskell-lens" skip_join: true template:- - "\x0313linear\x03/\x0306%{branch}\x03 \x0314%{commit}\x03 %{build_url} %{message}"--env:- - mode="--enable-tests" script="cabal test"+ - "\x0313linear\x0f/\x0306%{branch}\x0f \x0314%{commit}\x0f %{message} \x0302\x1f%{build_url}\x0f"
CHANGELOG.markdown view
@@ -1,3 +1,12 @@+1.18.3+------+* Compile warning-free on GHC 7.10.+++1.18.2+------+* Added `NFData` instance for `Point`+ 1.18.1 ------ * Added an `-f-template-haskell` option to allow disabling `template-haskell` support. This is an unsupported configuration but may be useful for expert users in sandbox configurations.
LICENSE view
@@ -1,4 +1,4 @@-Copyright 2011-14 Edward Kmett+Copyright 2011-2015 Edward Kmett All rights reserved.
linear.cabal view
@@ -1,6 +1,6 @@ name: linear category: Math, Algebra-version: 1.18.1.1+version: 1.18.3 license: BSD3 cabal-version: >= 1.8 license-file: LICENSE@@ -9,7 +9,7 @@ stability: provisional homepage: http://github.com/ekmett/linear/ bug-reports: http://github.com/ekmett/linear/issues-copyright: Copyright (C) 2012-2014 Edward A. Kmett+copyright: Copyright (C) 2012-2015 Edward A. Kmett synopsis: Linear Algebra description: Types and combinators for linear algebra on free vector spaces build-type: Custom
src/Linear.hs view
@@ -1,6 +1,6 @@ ----------------------------------------------------------------------------- -- |--- Copyright : (C) 2012-2013 Edward Kmett,+-- Copyright : (C) 2012-2015 Edward Kmett -- License : BSD-style (see the file LICENSE) -- -- Maintainer : Edward Kmett <ekmett@gmail.com>
src/Linear/Affine.hs view
@@ -28,6 +28,7 @@ module Linear.Affine where import Control.Applicative+import Control.DeepSeq import Control.Monad (liftM) import Control.Lens import Data.Binary as Binary@@ -145,6 +146,8 @@ #endif ) +instance NFData (f a) => NFData (Point f a) where+ rnf (P x) = rnf x instance Serial1 f => Serial1 (Point f) where serializeWith f (P p) = serializeWith f p
src/Linear/Algebra.hs view
@@ -1,6 +1,14 @@ {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-}+-----------------------------------------------------------------------------+-- |+-- License : BSD-style (see the file LICENSE)+-- Maintainer : Edward Kmett <ekmett@gmail.com>+-- Stability : provisional+-- Portability : portable+--+----------------------------------------------------------------------------- module Linear.Algebra ( Algebra(..) , Coalgebra(..)
src/Linear/Binary.hs view
@@ -1,6 +1,7 @@+{-# LANGUAGE CPP #-} ----------------------------------------------------------------------------- -- |--- Copyright : (C) 2013-2014 Edward Kmett and Anthony Cowley+-- Copyright : (C) 2013-2015 Edward Kmett and Anthony Cowley -- License : BSD-style (see the file LICENSE) -- -- Maintainer : Edward Kmett <ekmett@gmail.com>@@ -15,10 +16,16 @@ , getLinear ) where +#if __GLASGOW_HASKELL__ < 710 import Control.Applicative+#endif import Data.Binary+#if __GLASGOW_HASKELL__ < 710 import Data.Foldable (Foldable, traverse_) import Data.Traversable (Traversable, sequenceA)+#else+import Data.Foldable (traverse_)+#endif -- | Serialize a linear type. putLinear :: (Binary a, Foldable t) => t a -> Put
src/Linear/Conjugate.hs view
@@ -2,7 +2,7 @@ {-# LANGUAGE DefaultSignatures #-} ----------------------------------------------------------------------------- -- |--- Copyright : (C) 2012-2013 Edward Kmett,+-- Copyright : (C) 2012-2015 Edward Kmett -- License : BSD-style (see the file LICENSE) -- -- Maintainer : Edward Kmett <ekmett@gmail.com>
src/Linear/Covector.hs view
@@ -1,4 +1,13 @@ {-# LANGUAGE MultiParamTypeClasses, FlexibleInstances, FlexibleContexts #-}+-----------------------------------------------------------------------------+-- |+-- License : BSD-style (see the file LICENSE)+-- Maintainer : Edward Kmett <ekmett@gmail.com>+-- Stability : provisional+-- Portability : portable+--+-- Operations on affine spaces.+----------------------------------------------------------------------------- module Linear.Covector ( Covector(..) , ($*)
src/Linear/Epsilon.hs view
@@ -1,6 +1,6 @@ ----------------------------------------------------------------------------- -- |--- Copyright : (C) 2012 Edward Kmett+-- Copyright : (C) 2012-2015 Edward Kmett -- License : BSD-style (see the file LICENSE) -- Maintainer : Edward Kmett <ekmett@gmail.com> -- Stability : provisional
src/Linear/Instances.hs view
@@ -1,11 +1,11 @@ {-# OPTIONS_GHC -fno-warn-orphans #-} {-# LANGUAGE CPP #-}-#if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ >= 702+#if __GLASGOW_HASKELL__ >= 702 && __GLASGOW_HASKELL__ < 710 {-# LANGUAGE Trustworthy #-} #endif ----------------------------------------------------------------------------- -- |--- Copyright : (C) 2012 Edward Kmett+-- Copyright : (C) 2012-2015 Edward Kmett -- License : BSD-style (see the file LICENSE) -- Maintainer : Edward Kmett <ekmett@gmail.com> -- Stability : provisional@@ -19,14 +19,18 @@ import Control.Monad.Fix import Control.Monad.Zip import Data.Complex+#if __GLASGOW_HASKELL__ < 710 import Data.Foldable+#endif import Data.Functor.Bind import Data.HashMap.Lazy as HashMap import Data.Hashable import Data.Semigroup import Data.Semigroup.Foldable import Data.Semigroup.Traversable+#if __GLASGOW_HASKELL__ < 710 import Data.Traversable+#endif instance (Hashable k, Eq k) => Apply (HashMap k) where (<.>) = HashMap.intersectionWith id
src/Linear/Matrix.hs view
@@ -7,7 +7,7 @@ --------------------------------------------------------------------------- -- |--- Copyright : (C) 2012-2013 Edward Kmett,+-- Copyright : (C) 2012-2015 Edward Kmett -- License : BSD-style (see the file LICENSE) -- -- Maintainer : Edward Kmett <ekmett@gmail.com>@@ -35,7 +35,9 @@ , _m42, _m43, _m44 ) where +#if __GLASGOW_HASKELL__ < 710 import Control.Applicative+#endif import Control.Lens hiding (index) import Control.Lens.Internal.Context import Control.Monad (guard)
src/Linear/Metric.hs view
@@ -5,7 +5,7 @@ #endif ----------------------------------------------------------------------------- -- |--- Copyright : (C) 2012-2013 Edward Kmett,+-- Copyright : (C) 2012-2015 Edward Kmett -- License : BSD-style (see the file LICENSE) -- -- Maintainer : Edward Kmett <ekmett@gmail.com>
src/Linear/Plucker.hs view
@@ -10,7 +10,7 @@ #endif ----------------------------------------------------------------------------- -- |--- Copyright : (C) 2012-2013 Edward Kmett,+-- Copyright : (C) 2012-2015 Edward Kmett -- License : BSD-style (see the file LICENSE) -- -- Maintainer : Edward Kmett <ekmett@gmail.com>@@ -567,8 +567,13 @@ rnf (Plucker a b c d e f) = rnf a `seq` rnf b `seq` rnf c `seq` rnf d `seq` rnf e `seq` rnf f -instance Serial1 Plucker-instance Serial a => Serial (Plucker a)+instance Serial1 Plucker where+ serializeWith = traverse_+ deserializeWith k = Plucker <$> k <*> k <*> k <*> k <*> k <*> k++instance Serial a => Serial (Plucker a) where+ serialize = serializeWith serialize+ deserialize = deserializeWith deserialize instance Binary a => Binary (Plucker a) where put = serializeWith Binary.put
src/Linear/Plucker/Coincides.hs view
@@ -1,7 +1,7 @@ {-# LANGUAGE GADTs #-} --------------------------------------------------------------------------------- -- |--- Copyright : (C) 2012-2014 Edward Kmett,+-- Copyright : (C) 2012-2015 Edward Kmett -- License : BSD-style (see the file LICENSE) -- -- Maintainer : Edward Kmett <ekmett@gmail.com>
src/Linear/Projection.hs view
@@ -1,7 +1,7 @@ {-# LANGUAGE CPP #-} --------------------------------------------------------------------------- -- |--- Copyright : (C) 2014 Edward Kmett+-- Copyright : (C) 2015 Edward Kmett -- License : BSD-style (see the file LICENSE) -- -- Maintainer : Edward Kmett <ekmett@gmail.com>
src/Linear/Quaternion.hs view
@@ -11,7 +11,7 @@ #endif ----------------------------------------------------------------------------- -- |--- Copyright : (C) 2012-2013 Edward Kmett,+-- Copyright : (C) 2012-2015 Edward Kmett -- License : BSD-style (see the file LICENSE) -- -- Maintainer : Edward Kmett <ekmett@gmail.com>@@ -559,8 +559,13 @@ instance NFData a => NFData (Quaternion a) where rnf (Quaternion a b) = rnf a `seq` rnf b -instance Serial1 Quaternion-instance Serial a => Serial (Quaternion a)+instance Serial1 Quaternion where+ serializeWith f (Quaternion a b) = f a >> serializeWith f b+ deserializeWith f = Quaternion <$> f <*> deserializeWith f++instance Serial a => Serial (Quaternion a) where+ serialize = serializeWith serialize+ deserialize = deserializeWith deserialize instance Binary a => Binary (Quaternion a) where put = serializeWith Binary.put
src/Linear/Trace.hs view
@@ -1,12 +1,12 @@ {-# LANGUAGE CPP #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE DefaultSignatures #-}-#if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ >= 702+#if __GLASGOW_HASKELL__ >= 702 && __GLASGOW_HASKELL__ < 710 {-# LANGUAGE Trustworthy #-} #endif --------------------------------------------------------------------------- -- |--- Copyright : (C) 2012-2013 Edward Kmett,+-- Copyright : (C) 2012-2015 Edward Kmett -- License : BSD-style (see the file LICENSE) -- -- Maintainer : Edward Kmett <ekmett@gmail.com>
src/Linear/V.hs view
@@ -22,7 +22,7 @@ ----------------------------------------------------------------------------- -- |--- Copyright : (C) 2012-2013 Edward Kmett,+-- Copyright : (C) 2012-2015 Edward Kmett -- License : BSD-style (see the file LICENSE) -- -- Maintainer : Edward Kmett <ekmett@gmail.com>@@ -44,7 +44,9 @@ , fromVector ) where +#if __GLASGOW_HASKELL__ < 710 import Control.Applicative+#endif import Control.DeepSeq (NFData) import Control.Monad.Fix import Control.Monad.Zip@@ -62,7 +64,9 @@ #endif import Data.Reflection as R import Data.Serialize as Cereal+#if __GLASGOW_HASKELL__ < 710 import Data.Traversable (sequenceA)+#endif import Data.Vector as V import Foreign.Ptr import Foreign.Storable
src/Linear/V0.hs view
@@ -14,7 +14,7 @@ #endif ----------------------------------------------------------------------------- -- |--- Copyright : (C) 2012-2013 Edward Kmett+-- Copyright : (C) 2012-2015 Edward Kmett -- License : BSD-style (see the file LICENSE) -- -- Maintainer : Edward Kmett <ekmett@gmail.com>@@ -80,8 +80,8 @@ ) instance Serial1 V0 where- serializeWith f = serialize- deserializeWith f = deserialize+ serializeWith _ = serialize+ deserializeWith _ = deserialize instance Serial (V0 a) where serialize V0 = return ()
src/Linear/V1.hs view
@@ -19,7 +19,7 @@ #endif ----------------------------------------------------------------------------- -- |--- Copyright : (C) 2012-2013 Edward Kmett,+-- Copyright : (C) 2012-2015 Edward Kmett -- License : BSD-style (see the file LICENSE) -- -- Maintainer : Edward Kmett <ekmett@gmail.com>
src/Linear/V2.hs view
@@ -12,7 +12,7 @@ #endif ----------------------------------------------------------------------------- -- |--- Copyright : (C) 2012-2013 Edward Kmett,+-- Copyright : (C) 2012-2015 Edward Kmett -- License : BSD-style (see the file LICENSE) -- -- Maintainer : Edward Kmett <ekmett@gmail.com>@@ -375,8 +375,13 @@ instance NFData a => NFData (V2 a) where rnf (V2 a b) = rnf a `seq` rnf b -instance Serial1 V2-instance Serial a => Serial (V2 a)+instance Serial1 V2 where+ serializeWith = traverse_+ deserializeWith k = V2 <$> k <*> k++instance Serial a => Serial (V2 a) where+ serialize = serializeWith serialize+ deserialize = deserializeWith deserialize instance Binary a => Binary (V2 a) where put = serializeWith Binary.put
src/Linear/V3.hs view
@@ -11,7 +11,7 @@ #endif ----------------------------------------------------------------------------- -- |--- Copyright : (C) 2012-2013 Edward Kmett,+-- Copyright : (C) 2012-2015 Edward Kmett -- License : BSD-style (see the file LICENSE) -- -- Maintainer : Edward Kmett <ekmett@gmail.com>@@ -398,8 +398,13 @@ instance NFData a => NFData (V3 a) where rnf (V3 a b c) = rnf a `seq` rnf b `seq` rnf c -instance Serial1 V3-instance Serial a => Serial (V3 a)+instance Serial1 V3 where+ serializeWith = traverse_+ deserializeWith k = V3 <$> k <*> k <*> k++instance Serial a => Serial (V3 a) where+ serialize = serializeWith serialize+ deserialize = deserializeWith deserialize instance Binary a => Binary (V3 a) where put = serializeWith Binary.put
src/Linear/V4.hs view
@@ -11,7 +11,7 @@ #endif ----------------------------------------------------------------------------- -- |--- Copyright : (C) 2012-2013 Edward Kmett,+-- Copyright : (C) 2012-2015 Edward Kmett -- License : BSD-style (see the file LICENSE) -- -- Maintainer : Edward Kmett <ekmett@gmail.com>@@ -545,8 +545,13 @@ instance NFData a => NFData (V4 a) where rnf (V4 a b c d) = rnf a `seq` rnf b `seq` rnf c `seq` rnf d -instance Serial1 V4-instance Serial a => Serial (V4 a)+instance Serial1 V4 where+ serializeWith = traverse_+ deserializeWith k = V4 <$> k <*> k <*> k <*> k++instance Serial a => Serial (V4 a) where+ serialize = serializeWith serialize+ deserialize = deserializeWith deserialize instance Binary a => Binary (V4 a) where put = serializeWith Binary.put
src/Linear/Vector.hs view
@@ -10,7 +10,7 @@ #endif ----------------------------------------------------------------------------- -- |--- Copyright : (C) 2012 Edward Kmett+-- Copyright : (C) 2012-2015 Edward Kmett -- License : BSD-style (see the file LICENSE) -- Maintainer : Edward Kmett <ekmett@gmail.com> -- Stability : provisional@@ -36,12 +36,18 @@ import Control.Applicative import Control.Lens import Data.Complex+#if __GLASGOW_HASKELL__ < 710 import Data.Foldable as Foldable (Foldable, forM_, foldl')+#else+import Data.Foldable as Foldable (forM_, foldl')+#endif import Data.HashMap.Lazy as HashMap import Data.Hashable import Data.IntMap as IntMap import Data.Map as Map+#if __GLASGOW_HASKELL__ < 710 import Data.Monoid (mempty)+#endif import Data.Vector as Vector import Data.Vector.Mutable as Mutable #ifdef USE_GHC_GENERICS@@ -133,7 +139,7 @@ -- | Compute the difference between two vectors --- -- >>> V2 4 5 - V2 3 1+ -- >>> V2 4 5 ^-^ V2 3 1 -- V2 1 4 (^-^) :: Num a => f a -> f a -> f a #ifdef USE_GHC_GENERICS