summaryrefslogtreecommitdiff
path: root/packages/base/src
diff options
context:
space:
mode:
authorAlberto Ruiz <aruiz@um.es>2017-12-26 14:05:35 +0100
committerGitHub <noreply@github.com>2017-12-26 14:05:35 +0100
commit0d4018b09f1d38bbc05fdc0d8197d0f8a6ce5571 (patch)
treef7aae740fa7129c4641cf05a9e00260e48cd92bb /packages/base/src
parent87c7682bbfd17308749d5e9568f1ffa25390ce79 (diff)
parente83e2023da77ecaa9aaba15bc9bd48757f73b3a9 (diff)
Merge pull request #245 from konn/ghc84
Workaround for GHC-8.4.x
Diffstat (limited to 'packages/base/src')
-rw-r--r--packages/base/src/Internal/Container.hs5
-rw-r--r--packages/base/src/Internal/Convolution.hs4
-rw-r--r--packages/base/src/Internal/Modular.hs8
-rw-r--r--packages/base/src/Internal/Util.hs4
-rw-r--r--packages/base/src/Numeric/LinearAlgebra.hs4
-rw-r--r--packages/base/src/Numeric/LinearAlgebra/HMatrix.hs4
-rw-r--r--packages/base/src/Numeric/LinearAlgebra/Static.hs4
-rw-r--r--packages/base/src/Numeric/Matrix.hs8
8 files changed, 40 insertions, 1 deletions
diff --git a/packages/base/src/Internal/Container.hs b/packages/base/src/Internal/Container.hs
index b379530..1520489 100644
--- a/packages/base/src/Internal/Container.hs
+++ b/packages/base/src/Internal/Container.hs
@@ -1,3 +1,4 @@
1{-# LANGUAGE CPP #-}
1{-# LANGUAGE FlexibleContexts #-} 2{-# LANGUAGE FlexibleContexts #-}
2{-# LANGUAGE FlexibleInstances #-} 3{-# LANGUAGE FlexibleInstances #-}
3{-# LANGUAGE MultiParamTypeClasses #-} 4{-# LANGUAGE MultiParamTypeClasses #-}
@@ -29,7 +30,9 @@ import Internal.Matrix
29import Internal.Element 30import Internal.Element
30import Internal.Numeric 31import Internal.Numeric
31import Internal.Algorithms(Field,linearSolveSVD,Herm,mTm) 32import Internal.Algorithms(Field,linearSolveSVD,Herm,mTm)
32 33#if MIN_VERSION_base(4,11,0)
34import Prelude hiding ((<>))
35#endif
33------------------------------------------------------------------ 36------------------------------------------------------------------
34 37
35{- | Creates a real vector containing a range of values: 38{- | Creates a real vector containing a range of values:
diff --git a/packages/base/src/Internal/Convolution.hs b/packages/base/src/Internal/Convolution.hs
index 384fdf8..004e1ff 100644
--- a/packages/base/src/Internal/Convolution.hs
+++ b/packages/base/src/Internal/Convolution.hs
@@ -1,3 +1,4 @@
1{-# LANGUAGE CPP #-}
1{-# LANGUAGE FlexibleContexts #-} 2{-# LANGUAGE FlexibleContexts #-}
2----------------------------------------------------------------------------- 3-----------------------------------------------------------------------------
3{- | 4{- |
@@ -23,6 +24,9 @@ import Internal.Numeric
23import Internal.Element 24import Internal.Element
24import Internal.Conversion 25import Internal.Conversion
25import Internal.Container 26import Internal.Container
27#if MIN_VERSION_base(4,11,0)
28import Prelude hiding ((<>))
29#endif
26 30
27 31
28vectSS :: Element t => Int -> Vector t -> Matrix t 32vectSS :: Element t => Int -> Vector t -> Matrix t
diff --git a/packages/base/src/Internal/Modular.hs b/packages/base/src/Internal/Modular.hs
index f3c59a8..9d51444 100644
--- a/packages/base/src/Internal/Modular.hs
+++ b/packages/base/src/Internal/Modular.hs
@@ -1,3 +1,4 @@
1{-# LANGUAGE CPP #-}
1{-# LANGUAGE DataKinds #-} 2{-# LANGUAGE DataKinds #-}
2{-# LANGUAGE KindSignatures #-} 3{-# LANGUAGE KindSignatures #-}
3{-# LANGUAGE GeneralizedNewtypeDeriving #-} 4{-# LANGUAGE GeneralizedNewtypeDeriving #-}
@@ -38,13 +39,20 @@ import Internal.Util(Normed(..),Indexable(..),
38 gaussElim, gaussElim_1, gaussElim_2, 39 gaussElim, gaussElim_1, gaussElim_2,
39 luST, luSolve', luPacked', magnit, invershur) 40 luST, luSolve', luPacked', magnit, invershur)
40import Internal.ST(mutable) 41import Internal.ST(mutable)
42#if MIN_VERSION_base(4,11,0)
43import GHC.TypeLits hiding (Mod)
44#else
41import GHC.TypeLits 45import GHC.TypeLits
46#endif
42import Data.Proxy(Proxy) 47import Data.Proxy(Proxy)
43import Foreign.ForeignPtr(castForeignPtr) 48import Foreign.ForeignPtr(castForeignPtr)
44import Foreign.Storable 49import Foreign.Storable
45import Data.Ratio 50import Data.Ratio
46import Data.Complex 51import Data.Complex
47import Control.DeepSeq ( NFData(..) ) 52import Control.DeepSeq ( NFData(..) )
53#if MIN_VERSION_base(4,11,0)
54import Prelude hiding ((<>))
55#endif
48 56
49 57
50 58
diff --git a/packages/base/src/Internal/Util.hs b/packages/base/src/Internal/Util.hs
index ec21fe4..8c8a31e 100644
--- a/packages/base/src/Internal/Util.hs
+++ b/packages/base/src/Internal/Util.hs
@@ -1,3 +1,4 @@
1{-# LANGUAGE CPP #-}
1{-# LANGUAGE FlexibleContexts #-} 2{-# LANGUAGE FlexibleContexts #-}
2{-# LANGUAGE FlexibleInstances #-} 3{-# LANGUAGE FlexibleInstances #-}
3{-# LANGUAGE MultiParamTypeClasses #-} 4{-# LANGUAGE MultiParamTypeClasses #-}
@@ -80,6 +81,9 @@ import Control.Arrow((&&&),(***))
80import Data.Complex 81import Data.Complex
81import Data.Function(on) 82import Data.Function(on)
82import Internal.ST 83import Internal.ST
84#if MIN_VERSION_base(4,11,0)
85import Prelude hiding ((<>))
86#endif
83 87
84type ℝ = Double 88type ℝ = Double
85type ℕ = Int 89type ℕ = Int
diff --git a/packages/base/src/Numeric/LinearAlgebra.hs b/packages/base/src/Numeric/LinearAlgebra.hs
index fd100e0..73d4a13 100644
--- a/packages/base/src/Numeric/LinearAlgebra.hs
+++ b/packages/base/src/Numeric/LinearAlgebra.hs
@@ -1,3 +1,4 @@
1{-# LANGUAGE CPP #-}
1{-# LANGUAGE FlexibleContexts #-} 2{-# LANGUAGE FlexibleContexts #-}
2 3
3----------------------------------------------------------------------------- 4-----------------------------------------------------------------------------
@@ -190,6 +191,9 @@ import Internal.Random
190import Internal.Sparse((!#>)) 191import Internal.Sparse((!#>))
191import Internal.CG 192import Internal.CG
192import Internal.Conversion 193import Internal.Conversion
194#if MIN_VERSION_base(4,11,0)
195import Prelude hiding ((<>))
196#endif
193 197
194{- | dense matrix product 198{- | dense matrix product
195 199
diff --git a/packages/base/src/Numeric/LinearAlgebra/HMatrix.hs b/packages/base/src/Numeric/LinearAlgebra/HMatrix.hs
index 5ce529c..3a84645 100644
--- a/packages/base/src/Numeric/LinearAlgebra/HMatrix.hs
+++ b/packages/base/src/Numeric/LinearAlgebra/HMatrix.hs
@@ -1,3 +1,4 @@
1{-# LANGUAGE CPP #-}
1-------------------------------------------------------------------------------- 2--------------------------------------------------------------------------------
2{- | 3{- |
3Module : Numeric.LinearAlgebra.HMatrix 4Module : Numeric.LinearAlgebra.HMatrix
@@ -19,6 +20,9 @@ module Numeric.LinearAlgebra.HMatrix (
19import Numeric.LinearAlgebra 20import Numeric.LinearAlgebra
20import Internal.Util 21import Internal.Util
21import Internal.Algorithms(cholSH, mbCholSH, eigSH', eigenvaluesSH', geigSH') 22import Internal.Algorithms(cholSH, mbCholSH, eigSH', eigenvaluesSH', geigSH')
23#if MIN_VERSION_base(4,11,0)
24import Prelude hiding ((<>))
25#endif
22 26
23infixr 8 <·> 27infixr 8 <·>
24(<·>) :: Numeric t => Vector t -> Vector t -> t 28(<·>) :: Numeric t => Vector t -> Vector t -> t
diff --git a/packages/base/src/Numeric/LinearAlgebra/Static.hs b/packages/base/src/Numeric/LinearAlgebra/Static.hs
index 3000dcb..e328904 100644
--- a/packages/base/src/Numeric/LinearAlgebra/Static.hs
+++ b/packages/base/src/Numeric/LinearAlgebra/Static.hs
@@ -1,3 +1,4 @@
1{-# LANGUAGE CPP #-}
1{-# LANGUAGE DataKinds #-} 2{-# LANGUAGE DataKinds #-}
2{-# LANGUAGE KindSignatures #-} 3{-# LANGUAGE KindSignatures #-}
3{-# LANGUAGE GeneralizedNewtypeDeriving #-} 4{-# LANGUAGE GeneralizedNewtypeDeriving #-}
@@ -80,6 +81,9 @@ import Control.Arrow((***))
80import Text.Printf 81import Text.Printf
81import Data.Type.Equality ((:~:)(Refl)) 82import Data.Type.Equality ((:~:)(Refl))
82import qualified Data.Bifunctor as BF (first) 83import qualified Data.Bifunctor as BF (first)
84#if MIN_VERSION_base(4,11,0)
85import Prelude hiding ((<>))
86#endif
83 87
84ud1 :: R n -> Vector ℝ 88ud1 :: R n -> Vector ℝ
85ud1 (R (Dim v)) = v 89ud1 (R (Dim v)) = v
diff --git a/packages/base/src/Numeric/Matrix.hs b/packages/base/src/Numeric/Matrix.hs
index 5400f26..06da150 100644
--- a/packages/base/src/Numeric/Matrix.hs
+++ b/packages/base/src/Numeric/Matrix.hs
@@ -32,8 +32,11 @@ import Internal.Element
32import Internal.Numeric 32import Internal.Numeric
33import qualified Data.Monoid as M 33import qualified Data.Monoid as M
34import Data.List(partition) 34import Data.List(partition)
35import qualified Data.Foldable as F
36import qualified Data.Semigroup as S
35import Internal.Chain 37import Internal.Chain
36 38
39
37------------------------------------------------------------------- 40-------------------------------------------------------------------
38 41
39instance Container Matrix a => Eq (Matrix a) where 42instance Container Matrix a => Eq (Matrix a) where
@@ -84,6 +87,11 @@ adaptScalarM f1 f2 f3 x y
84 | isScalar y = f3 x (y @@>(0,0) ) 87 | isScalar y = f3 x (y @@>(0,0) )
85 | otherwise = f2 x y 88 | otherwise = f2 x y
86 89
90instance (Container Vector t, Eq t, Num (Vector t), Product t) => S.Semigroup (Matrix t)
91 where
92 (<>) = mappend
93 sconcat = mconcat . F.toList
94
87instance (Container Vector t, Eq t, Num (Vector t), Product t) => M.Monoid (Matrix t) 95instance (Container Vector t, Eq t, Num (Vector t), Product t) => M.Monoid (Matrix t)
88 where 96 where
89 mempty = 1 97 mempty = 1