diagrams-core 1.3.0.7 → 1.3.0.8
raw patch · 9 files changed
+33/−30 lines, 9 filesdep ~base
Dependency ranges changed: base
Files
- CHANGELOG.md +5/−0
- diagrams-core.cabal +3/−3
- src/Diagrams/Core/Compile.hs +7/−7
- src/Diagrams/Core/Envelope.hs +1/−1
- src/Diagrams/Core/HasOrigin.hs +4/−4
- src/Diagrams/Core/Measure.hs +1/−1
- src/Diagrams/Core/Style.hs +5/−5
- src/Diagrams/Core/Transform.hs +3/−3
- src/Diagrams/Core/Types.hs +4/−6
CHANGELOG.md view
@@ -1,3 +1,8 @@+## [v1.3.0.8](https://github.com/diagrams/diagrams-core/tree/v1.3.0.8) (2016-06-05)++- allow `base-4.9`+- build warning-free on GHC 8.0.1+ ## [v1.3.0.7](https://github.com/diagrams/diagrams-core/tree/v1.3.0.7) (2016-05-01) - allow `lens-4.14`
diagrams-core.cabal view
@@ -1,5 +1,5 @@ Name: diagrams-core-Version: 1.3.0.7+Version: 1.3.0.8 Synopsis: Core libraries for diagrams EDSL Description: The core modules underlying diagrams, an embedded domain-specific language@@ -15,7 +15,7 @@ Cabal-version: >=1.10 Extra-source-files: CHANGELOG.md, README.markdown, diagrams/*.svg extra-doc-files: diagrams/*.svg-Tested-with: GHC == 7.4.2, GHC == 7.6.3, GHC == 7.8.4, GHC == 7.10.1+Tested-with: GHC == 7.6.3, GHC == 7.8.4, GHC == 7.10.1, GHC == 8.0.1 Source-repository head type: git location: git://github.com/diagrams/diagrams-core.git@@ -36,7 +36,7 @@ Diagrams.Core.Types, Diagrams.Core.V - Build-depends: base >= 4.2 && < 4.9,+ Build-depends: base >= 4.2 && < 4.10, containers >= 0.4.2 && < 0.6, unordered-containers >= 0.2 && < 0.3, semigroups >= 0.8.4 && < 0.19,
src/Diagrams/Core/Compile.hs view
@@ -34,7 +34,6 @@ ) where -import Data.Typeable import qualified Data.List.NonEmpty as NEL import Data.Maybe (fromMaybe) import Data.Monoid.Coproduct@@ -43,13 +42,14 @@ import Data.Semigroup import Data.Tree import Data.Tree.DUAL+import Data.Typeable import Diagrams.Core.Envelope (OrderedField, diameter)+import Diagrams.Core.Style import Diagrams.Core.Transform import Diagrams.Core.Types-import Diagrams.Core.Style -import Linear.Metric hiding (qd)+import Linear.Metric hiding (qd) -- Typeable1 is a depreciated synonym in ghc > 707 #if __GLASGOW_HASKELL__ >= 707@@ -117,7 +117,7 @@ => DTree b v n Annotation -> RTree b v n Annotation fromDTree = fromDTree' mempty where- fromDTree' :: HasLinearMap v => Transformation v n -> DTree b v n Annotation -> RTree b v n Annotation+ fromDTree' :: Transformation v n -> DTree b v n Annotation -> RTree b v n Annotation -- We put the accumulated transformation (accTr) and the prim -- into an RPrim node. fromDTree' accTr (Node (DPrim p) _)@@ -151,7 +151,7 @@ -- transformation used to convert the diagram from local to output -- units. toRTree- :: (HasLinearMap v, Metric v, Typeable1 v, Typeable n,+ :: (HasLinearMap v, Metric v, Typeable n, OrderedField n, Monoid m, Semigroup m) => Transformation v n -> QDiagram b v n m -> RTree b v n Annotation toRTree globalToOutput d@@ -183,7 +183,7 @@ -- transformation can be used, for example, to convert output/screen -- coordinates back into diagram coordinates. See also 'adjustDia'. renderDiaT- :: (Backend b v n , HasLinearMap v, Metric v, Typeable1 v,+ :: (Backend b v n , HasLinearMap v, Metric v, Typeable n, OrderedField n, Monoid' m) => b -> Options b v n -> QDiagram b v n m -> (Transformation v n, Result b v n) renderDiaT b opts d = (g2o, renderRTree b opts' . toRTree g2o $ d')@@ -191,7 +191,7 @@ -- | Render a diagram. renderDia- :: (Backend b v n , HasLinearMap v, Metric v, Typeable1 v,+ :: (Backend b v n , HasLinearMap v, Metric v, Typeable n, OrderedField n, Monoid' m) => b -> Options b v n -> QDiagram b v n m -> Result b v n renderDia b opts d = snd (renderDiaT b opts d)
src/Diagrams/Core/Envelope.hs view
@@ -257,7 +257,7 @@ -- Note that the 'envelopeV' / 'envelopeP' functions above should be -- preferred, as this requires a call to norm. However, it is more -- efficient than calling norm on the results of those functions.-envelopeS :: (V a ~ v, N a ~ n, Enveloped a, Num n) => v n -> a -> n+envelopeS :: (V a ~ v, N a ~ n, Enveloped a) => v n -> a -> n envelopeS v = fromMaybe 0 . envelopeSMay v -- | Compute the diameter of a enveloped object along a particular
src/Diagrams/Core/HasOrigin.hs view
@@ -23,11 +23,11 @@ ( HasOrigin(..), moveOriginBy, moveTo, place ) where -import qualified Data.Map as M-import qualified Data.Set as S+import qualified Data.Map as M+import qualified Data.Set as S import Diagrams.Core.Measure-import Diagrams.Core.Points ()+import Diagrams.Core.Points () import Diagrams.Core.V import Linear.Affine@@ -59,7 +59,7 @@ moveOriginTo :: Point (V t) (N t) -> t -> t -- | Move the local origin by a relative vector.-moveOriginBy :: (V t ~ v, N t ~ n, Num n, HasOrigin t) => v n -> t -> t+moveOriginBy :: (V t ~ v, N t ~ n, HasOrigin t) => v n -> t -> t moveOriginBy = moveOriginTo . P -- | Translate the object by the translation that sends the origin to
src/Diagrams/Core/Measure.hs view
@@ -49,7 +49,7 @@ fromMeasured g n (Measured m) = m (1,g,n) -- | Output units don't change.-output :: Num n => n -> Measure n+output :: n -> Measure n output = pure -- | Local units are scaled by the average scale of a transform.
src/Diagrams/Core/Style.hs view
@@ -139,7 +139,7 @@ -- | Shows the kind of attribute and the type contained in the -- attribute.-instance Typeable n => Show (Attribute v n) where+instance Show (Attribute v n) where showsPrec d attr = showParen (d > 10) $ case attr of Attribute a -> showString "Attribute " . showsPrec 11 (typeOf a) MAttribute a -> showString "MAttribute " . showsPrec 11 (mType a)@@ -178,7 +178,7 @@ -- | Turn an 'MAttribute' into an 'Attribute' using the given 'global' -- and 'normalized' scale.-unmeasureAttribute :: (Num n, Typeable n)+unmeasureAttribute :: (Num n) => n -> n -> Attribute v n -> Attribute v n unmeasureAttribute g n (MAttribute m) = Attribute (fromMeasured g n m) unmeasureAttribute _ _ a = a@@ -257,7 +257,7 @@ instance A.Action (Style v n) m -- | Show the attributes in the style.-instance Typeable n => Show (Style v n) where+instance Show (Style v n) where showsPrec d sty = showParen (d > 10) $ showString "Style " . showsPrec d (sty ^.. each) @@ -289,7 +289,7 @@ -- | Replace all 'MAttribute's with 'Attribute's using the 'global' and -- 'normalized' scales.-unmeasureAttrs :: (Num n, Typeable n) => n -> n -> Style v n -> Style v n+unmeasureAttrs :: (Num n) => n -> n -> Style v n -> Style v n unmeasureAttrs g n = over each (unmeasureAttribute g n) -- style lenses --------------------------------------------------------@@ -361,7 +361,7 @@ -- diagram or a style). If the object already has an attribute of -- the same type, the new attribute is combined on the left with the -- existing attribute, according to their semigroup structure.-applyMAttr :: (AttributeClass a, N d ~ n, HasStyle d, Typeable n) => Measured n a -> d -> d+applyMAttr :: (AttributeClass a, N d ~ n, HasStyle d) => Measured n a -> d -> d applyMAttr = applyStyle . attributeToStyle . MAttribute -- | Apply a transformable attribute to an instance of 'HasStyle'
src/Diagrams/Core/Transform.hs view
@@ -219,8 +219,8 @@ -- | Get the dimension of an object whose vector space is an instance of -- @HasLinearMap@, e.g. transformations, paths, diagrams, etc.-dimension :: forall a v. (V a ~ v, Additive v, Traversable v) => a -> Int-dimension _ = length (basis :: [v Int])+dimension :: forall a. (Additive (V a), Traversable (V a)) => a -> Int+dimension _ = length (basis :: [V a Int]) -- | Get the matrix equivalent of the linear transform, -- (as a list of columns) and the translation vector. This@@ -404,7 +404,7 @@ translation = Transformation mempty mempty -- | Translate by a vector.-translate :: (Num (N t), Transformable t) => Vn t -> t -> t+translate :: (Transformable t) => Vn t -> t -> t translate = transform . translation -- | Create a uniform scaling transformation.
src/Diagrams/Core/Types.hs view
@@ -627,7 +627,7 @@ -- @mkSubdiagram . pointDiagram@, which would result in a subdiagram -- with local origin at the parent origin, rather than at the given -- point.-subPoint :: (Metric v, OrderedField n, Semigroup m)+subPoint :: (Metric v, OrderedField n) => Point v n -> Subdiagram b v n m subPoint p = Subdiagram (pointDiagram origin)@@ -648,8 +648,7 @@ => HasOrigin (Subdiagram b v n m) where moveOriginTo = translate . (origin .-.) -instance (Metric v, Floating n)- => Transformable (Subdiagram b v n m) where+instance Transformable (Subdiagram b v n m) where transform t (Subdiagram d a) = Subdiagram d (transfToAnnot t <> a) -- | Get the location of a subdiagram; that is, the location of its@@ -716,8 +715,7 @@ => HasOrigin (SubMap b v n m) where moveOriginTo = over _Wrapped' . moveOriginTo -instance (Metric v, Floating n)- => Transformable (SubMap b v n m) where+instance Transformable (SubMap b v n m) where transform = over _Wrapped' . transform -- | 'SubMap's are qualifiable: if @ns@ is a 'SubMap', then @a |>@@ -777,7 +775,7 @@ data Prim b v n where Prim :: (Transformable p, Typeable p, Renderable p b) => p -> Prim b (V p) (N p) -_Prim :: (Transformable p, Typeable p, Renderable p b) => Prism' (Prim b (V p) (N p)) p+_Prim :: (Typeable p, Renderable p b) => Prism' (Prim b (V p) (N p)) p _Prim = prism' Prim (\(Prim p) -> cast p) type instance V (Prim b v n) = v