Rasterific 0.7.2.2 → 0.7.2.3
raw patch · 4 files changed
+16/−10 lines, 4 filesdep ~basePVP ok
version bump matches the API change (PVP)
Dependency ranges changed: base
API changes (from Hackage documentation)
Files
- Rasterific.cabal +2/−2
- changelog +2/−2
- src/Graphics/Rasterific/Command.hs +5/−1
- src/Graphics/Rasterific/PlaneBoundable.hs +7/−5
Rasterific.cabal view
@@ -1,7 +1,7 @@ -- Initial Rasterific.cabal generated by cabal init. For further -- documentation, see http://haskell.org/cabal/users-guide/ name: Rasterific -version: 0.7.2.2 +version: 0.7.2.3 synopsis: A pure haskell drawing engine. -- A longer description of the package. description: @@ -40,7 +40,7 @@ Source-Repository this Type: git Location: git://github.com/Twinside/Rasterific.git - Tag: v0.7.2.2 + Tag: v0.7.2.3 flag embed_linear description: Embed a reduced version of Linear avoiding a (huge) dep
changelog view
@@ -1,8 +1,8 @@ Change log ========== -v0.7.2.2 --------- +v0.7.2.2/0.7.2.3 +---------------- * Fix: adding Semigroup instances for GHC 8.4
src/Graphics/Rasterific/Command.hs view
@@ -15,6 +15,7 @@ , dumpTexture ) where +import Data.Semigroup( Semigroup( .. ) ) import Control.Monad.ST( ST ) import Control.Monad.State( StateT ) import Control.Monad.Primitive( PrimState ) @@ -215,7 +216,10 @@ fmap f (MeshPatchRender i mesh next) = MeshPatchRender i mesh $ f next +instance Semigroup (Drawing px ()) where + (<>) a b = a >> b + instance Monoid (Drawing px ()) where mempty = return () - mappend a b = a >> b + mappend = (<>)
src/Graphics/Rasterific/PlaneBoundable.hs view
@@ -9,7 +9,7 @@ , boundLowerLeftCorner ) where -import Data.Monoid( (<>) ) +import Data.Semigroup( Semigroup( .. ) ) import Graphics.Rasterific.Linear( V2( .. ) ) import Graphics.Rasterific.Types @@ -42,15 +42,17 @@ boundLowerLeftCorner :: PlaneBound -> Point boundLowerLeftCorner (PlaneBound (V2 x _) (V2 _ y)) = V2 x y +instance Semigroup PlaneBound where + (<>) (PlaneBound mini1 maxi1) (PlaneBound mini2 maxi2) = + PlaneBound (min <$> mini1 <*> mini2) + (max <$> maxi1 <*> maxi2) + instance Monoid PlaneBound where + mappend = (<>) mempty = PlaneBound infPoint negInfPoint where infPoint = V2 (1 / 0) (1 / 0) negInfPoint = V2 (negate 1 / 0) (negate 1 / 0) - - mappend (PlaneBound mini1 maxi1) (PlaneBound mini2 maxi2) = - PlaneBound (min <$> mini1 <*> mini2) - (max <$> maxi1 <*> maxi2) -- | Class used to calculate bounds of various geometrical -- primitives. The calculated is precise, the bounding should