Skip to content

Commit b463a19

Browse files
Get rid of some orphan VectorSpace instances.
The instances `VectorSpace (V2 n)` etc. are now defined in the `free-vector-spaces` package.
1 parent 4894c35 commit b463a19

File tree

2 files changed

+2
-24
lines changed

2 files changed

+2
-24
lines changed

Graphics/Dynamic/Plot/Internal/Types.hs

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ import Data.List (sort)
5656
import Data.VectorSpace
5757
import Data.Basis
5858
import Data.AffineSpace
59+
import Data.VectorSpace.Free ()
5960
import Data.LinearMap.HerMetric
6061
import Data.Manifold.PseudoAffine
6162
import Data.Manifold.TreeCover
@@ -67,26 +68,6 @@ import Control.DeepSeq
6768
type R2 = Dia.V2 Double
6869
type P2 = Dia.P2 Double
6970

70-
instance AffineSpace R2 where
71-
type Diff R2 = R2
72-
(.-.) = (Dia.^-^)
73-
(.+^) = (Dia.^+^)
74-
instance AdditiveGroup R2 where
75-
(^+^) = (Dia.^+^)
76-
zeroV = Dia.zero
77-
negateV = Dia.negated
78-
instance VectorSpace R2 where
79-
type Scalar R2 = Double
80-
(*^) = (Dia.*^)
81-
instance HasBasis R2 where
82-
type Basis R2 = Either () ()
83-
basisValue (Left ()) = 1^&0
84-
basisValue (Right ()) = 0^&1
85-
decompose v = [(Left(), v^._x), (Right(), v^._y)]
86-
decompose' v (Left ()) = v^._x
87-
decompose' v (Right ()) = v^._y
88-
instance InnerSpace R2 where
89-
(<.>) = Dia.dot
9071
instance FiniteDimensional R2 where
9172
dimension = Tagged 2
9273
basisIndex = Tagged bi where bi b = if (basisValue b::R2)^._x > 0.5 then 0 else 1
@@ -112,10 +93,6 @@ instance LocallyCoercible R2 (R,R) where
11293
instance LocallyCoercible (R,R) R2 where
11394
locallyTrivialDiffeomorphism = DiaTypes.r2
11495

115-
instance AffineSpace P2 where
116-
type Diff P2 = R2
117-
(.-.) = (Dia..-.)
118-
(.+^) = (Dia..+^)
11996
instance Semimanifold P2 where
12097
type Needle P2 = R2
12198
fromInterior = id

dynamic-plot.cabal

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ Library
5353
, deepseq
5454
, process
5555
, constrained-categories >= 0.2
56+
, free-vector-spaces >= 0.1 && < 0.2
5657
, diagrams-core
5758
, diagrams-lib >= 1.3 && < 1.4
5859
, diagrams-cairo > 1.3.0.5 && < 1.4

0 commit comments

Comments
 (0)