packages feed

diagrams-input 0.1.3 → 0.1.3.1

raw patch · 6 files changed

+20/−11 lines, 6 filesPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

API changes (from Hackage documentation)

- Diagrams.SVG.Attributes: applyTr :: (V a ~ V2, Transformable a, RealFloat (N a), Additive (V a), R2 (V a)) => [Transform (N a)] -> a -> a
+ Diagrams.SVG.Attributes: applyTr :: (V a ~ V2, Transformable a, RealFloat (N a)) => [Transform (N a)] -> a -> a
- Diagrams.SVG.Attributes: type Place = Double " A value between 0 and 1, where 0 is the minimal value and 1 the maximal value"
+ Diagrams.SVG.Attributes: type Place = -- | A value between 0 and 1, where 0 is the minimal value and 1 the maximal value Double
- Diagrams.SVG.ReadSVG: preserveAspectRatio :: (V a ~ V2, N a ~ Place, Fractional (N a), Transformable a, Alignable a, HasOrigin a, Additive (V a), R2 (V a)) => Place -> Place -> Place -> Place -> PreserveAR -> a -> a
+ Diagrams.SVG.ReadSVG: preserveAspectRatio :: (V a ~ V2, N a ~ Place, Transformable a, Alignable a, HasOrigin a) => Place -> Place -> Place -> Place -> PreserveAR -> a -> a
- Diagrams.SVG.ReadSVG: type Place = Double " A value between 0 and 1, where 0 is the minimal value and 1 the maximal value"
+ Diagrams.SVG.ReadSVG: type Place = -- | A value between 0 and 1, where 0 is the minimal value and 1 the maximal value Double
- Diagrams.SVG.Tree: preserveAspectRatio :: (V a ~ V2, N a ~ Place, Fractional (N a), Transformable a, Alignable a, HasOrigin a, Additive (V a), R2 (V a)) => Place -> Place -> Place -> Place -> PreserveAR -> a -> a
+ Diagrams.SVG.Tree: preserveAspectRatio :: (V a ~ V2, N a ~ Place, Transformable a, Alignable a, HasOrigin a) => Place -> Place -> Place -> Place -> PreserveAR -> a -> a
- Diagrams.SVG.Tree: type Place = Double " A value between 0 and 1, where 0 is the minimal value and 1 the maximal value"
+ Diagrams.SVG.Tree: type Place = -- | A value between 0 and 1, where 0 is the minimal value and 1 the maximal value Double

Files

CHANGELOG.md view
@@ -1,3 +1,8 @@+# v0.1.3.1 (24 Sep 2024)++- Test up to GHC 9.10+- Fix a few warnings+ # v0.1.3 (20 June 2023)  - Add new function `readSVGLBS` to read an SVG directly from a lazy
diagrams-input.cabal view
@@ -1,5 +1,5 @@ Name:                diagrams-input-Version:             0.1.3+Version:             0.1.3.1 Synopsis:            Parse raster and SVG files for diagrams Description:         Parse raster and SVG images for the diagrams DSL. License:             BSD3@@ -11,7 +11,7 @@ Build-type:          Simple Cabal-version:       >=1.10 Extra-source-files:  CHANGELOG.md, README.md-tested-with:         GHC ==8.4.4 || ==8.6.5 || ==8.8.4 || ==8.10.7 || ==9.0.2 || ==9.2.7 || ==9.4.5 || ==9.6.1+tested-with:         GHC ==8.4.4 || ==8.6.5 || ==8.8.4 || ==8.10.7 || ==9.0.2 || ==9.2.8 || ==9.4.8 || ==9.6.5 || ==9.8.2 || ==9.10.1 Source-repository head   type:     git   location: http://github.com/diagrams/diagrams-input.git
src/Diagrams/SVG/Path.hs view
@@ -21,6 +21,7 @@     ) where +import qualified Data.List.NonEmpty as NE import Data.Attoparsec.Combinator import Data.Attoparsec.Text import qualified Data.Attoparsec.Text as AT@@ -68,7 +69,7 @@                       }  -- Although it makes no sense, some programs produce several M in sucession-parse_m = do { AT.string "m"; t <- many' tuple2; return (Just $ (M Rel $ head t): (map (L Rel) (tail t)) ) } -- that's why we need many'+parse_m = do { AT.string "m"; (ht:tt) <- many' tuple2; return (Just $ (M Rel ht): (map (L Rel) tt) ) } -- that's why we need many' parse_M = do { AT.string "M"; t <- many' tuple2; return (Just $ map (M Abs) t) } parse_z = do { AT.choice [AT.string "z", AT.string "Z"]; return (Just [Z]) } parse_l = do { AT.string "l"; t <- many' tuple2; return (Just $ map (L Rel) t) }@@ -190,11 +191,14 @@    (ctrlPoint, startPoint, trail) = foldl' nextSegment ((x,y), (x,y), O []) cs -  (trx,try) | null cs   = (0,0)-            | otherwise = sel2 $ nextSegment ((x,y), (x,y), O []) (head cs) -- cs usually always starts with a M-command,-                                                                            -- because we splitted the commands like that-  (x,y) | null paths = (0,0)-        | otherwise  = snd (last paths)+  (trx,try) = case cs of+    [] -> (0,0)+    (c:_) -> sel2 $ nextSegment ((x,y), (x,y), O []) c -- cs usually always starts with a M-command,+                                                       -- because we splitted the commands like that+  (x,y) = case NE.nonEmpty paths of+    Nothing -> (0,0)+    Just nePaths -> snd (NE.last nePaths)+   sel2 (a,b,c) = a  
src/Diagrams/SVG/ReadSVG.hs view
@@ -1,5 +1,5 @@ {-# LANGUAGE ConstraintKinds, DeriveDataTypeable, ExistentialQuantification, FlexibleContexts, FlexibleInstances, GADTs,-             MultiParamTypeClasses, NoMonomorphismRestriction, OverloadedStrings, TypeFamilies, UndecidableInstances #-}+             MultiParamTypeClasses, NoMonomorphismRestriction, OverloadedStrings, TypeFamilies, UndecidableInstances, TypeOperators #-}  ------------------------------------------------------------------- -- |
src/Diagrams/SVG/Tree.hs view
@@ -1,4 +1,4 @@-{-# LANGUAGE TypeFamilies, OverloadedStrings, FlexibleContexts #-}+{-# LANGUAGE TypeFamilies, OverloadedStrings, FlexibleContexts, TypeOperators #-} -------------------------------------------------------------------- -- | -- Module    : Diagrams.SVG.Tree
src/Diagrams/TwoD/Input.hs view
@@ -1,4 +1,4 @@-{-# LANGUAGE FlexibleContexts, TypeFamilies #-}+{-# LANGUAGE FlexibleContexts, TypeFamilies, TypeOperators #-}  ----------------------------------------------------------------------------- -- |