From 84052596f0bf7ed23a897fb52cdf7e28d61b239b Mon Sep 17 00:00:00 2001 From: Dan Svoboda Date: Sun, 24 Nov 2019 14:27:46 -0500 Subject: [PATCH] split Semigroup/Monoid instances of Model since OpenSCAD.cabal doesn't explicitely call for a version of base which predates the semigroup/monoid split --- Graphics/OpenSCAD.hs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Graphics/OpenSCAD.hs b/Graphics/OpenSCAD.hs index dd667b3..d06c47d 100644 --- a/Graphics/OpenSCAD.hs +++ b/Graphics/OpenSCAD.hs @@ -619,13 +619,13 @@ diam :: Double -> Double diam = (/ 2) -- Now, let Haskell work it's magic +instance Vector v => Semigroup (Model v) where + (Solid (Box 0 0 0)) <> b = b + a <> (Solid (Box 0 0 0)) = a + a <> b = union [a, b] + instance Vector v => Monoid (Model v) where mempty = Solid $ Box 0 0 0 - mappend (Solid (Box 0 0 0)) b = b - mappend a (Solid (Box 0 0 0)) = a - mappend a b = union [a, b] - mconcat [a] = a - mconcat as = union as -- | You can use '(#)' to write transformations in a more readable postfix form,