packages feed

diagrams-contrib 1.4.1 → 1.4.2

raw patch · 4 files changed

+27/−7 lines, 4 files

Files

CHANGES.markdown view
@@ -1,3 +1,9 @@+1.4.2 (4 Feb 2018)+------------------++- New function `Diagrams.TwoD.Layout.Constrained.runLayout` (thanks to+  Sandy Maguire)+ 1.4.1 (3 July 2017) --------------------- @@ -5,6 +11,10 @@ - allow base-4.10 (for GHC-8.2) - allow MonadRandom-0.5 - export some things inadvertently unexported from Diagrams.TwoD.Grid (#68)++Hackage revisions:+- r1:+    - allow `QuickCheck-2.11`  1.4.0.1 (13 November 2016) --------------------------
diagrams-contrib.cabal view
@@ -1,5 +1,5 @@ name:                diagrams-contrib-version:             1.4.1+version:             1.4.2 synopsis:            Collection of user contributions to diagrams EDSL description:         A collection of user contributions for diagrams,                      an embedded domain-specific language for generation@@ -12,7 +12,7 @@ Bug-reports:         http://github.com/diagrams/diagrams-contrib/issues category:            Graphics build-type:          Simple-cabal-version:       >=1.10+cabal-version:       >=1.18 extra-source-files:  README.markdown, CHANGES.markdown, diagrams/*.svg, CONTRIBUTORS extra-doc-files:     diagrams/*.svg tested-with:         GHC == 7.8.4, GHC == 7.10.2, GHC == 8.0.1, GHC == 8.2.1@@ -87,7 +87,7 @@   other-modules:       Diagrams.TwoD.Path.Turtle.Tests    build-depends:       HUnit                      >= 1.2 && < 1.7,-                       QuickCheck                 >= 2.4 && < 2.11,+                       QuickCheck                 >= 2.4 && < 2.12,                        containers                 >= 0.3 && < 0.6,                        test-framework             >= 0.4 && < 0.9,                        test-framework-hunit       >= 0.2 && < 0.4,
src/Diagrams/TwoD/Layout/Constrained.hs view
@@ -2,6 +2,7 @@ {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE Rank2Types       #-} {-# LANGUAGE TemplateHaskell  #-}+{-# LANGUAGE TupleSections    #-} {-# LANGUAGE ViewPatterns     #-}  -----------------------------------------------------------------------------@@ -109,6 +110,7 @@           -- * Layout        , layout+       , runLayout           -- * Creating constrainable things @@ -620,12 +622,20 @@   :: (Monoid' m, Hashable n, Floating n, RealFrac n, Show n)   => (forall s. Constrained s b n m a)   -> QDiagram b V2 n m-layout constr =+layout constr = snd $ runLayout constr++-- | Like 'layout', but also allows the caller to retrieve the result of the+--   'Constrained' computation.+runLayout+  :: (Monoid' m, Hashable n, Floating n, RealFrac n, Show n)+  => (forall s. Constrained s b n m a)+  -> (a, QDiagram b V2 n m)+runLayout constr =   case MFS.execSolver (MFS.ignore $ s ^. equations) MFS.noDeps of     Left _depError -> error "overconstrained"     Right deps    ->       let deps' = resolve (map fst dias) deps-      in  mconcat . flip map dias $ \(d, dia) ->+      in  (a, ) . mconcat . flip map dias $ \(d, dia) ->         let vars = getDiaVars deps' d             expectedRes ty = vars ^?! L.at ty . _Just . resolution . _Just         in@@ -641,7 +651,7 @@                  -- a diagram if they aren't already constrained, so getDiaVars                  -- should return three resolved variables   where-    s = execState constr initConstrainedState+    (a, s) = runState constr initConstrainedState     dias = M.assocs (s ^. diagrams)  resolve
src/Diagrams/TwoD/Path/Follow.hs view
@@ -61,7 +61,7 @@ -- newtype Following n   = Following { unFollowing :: Semi (Trail' Line V2 n) (Angle n) }-  deriving (Monoid)+  deriving (Monoid, Semigroup)  -- | Note this is only an iso when considering trails equivalent up to --   rotation.