From 9228bda32f0a3f6d52e7cc5eb444376e7b024d8c Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 23 Apr 2018 13:20:13 -0400 Subject: semigroup monoid change fallout; drop ghc 7 support Fix build with ghc 8.4, which broke due to the Semigroup Monoid change. See https://prime.haskell.org/wiki/Libraries/Proposals/SemigroupMonoid Dropped support for building propellor with ghc 7 (as in debian oldstable), to avoid needing to depend on the semigroups transitional package, but also because it's just too old to be worth supporting. If we indeed drop ghc 7 support entirely, some code to support "jessie" can be removed; concurrent-output can be de-embedded, and the Singletons code can be simplified. This commit was sponsored by Jack Hill on Patreon. --- src/Propellor/Property/DiskImage/PartSpec.hs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/Propellor/Property/DiskImage/PartSpec.hs') diff --git a/src/Propellor/Property/DiskImage/PartSpec.hs b/src/Propellor/Property/DiskImage/PartSpec.hs index b78e4280..0698d806 100644 --- a/src/Propellor/Property/DiskImage/PartSpec.hs +++ b/src/Propellor/Property/DiskImage/PartSpec.hs @@ -43,6 +43,7 @@ import Propellor.Property.Mount import Data.List (sortBy) import Data.Ord +import qualified Data.Semigroup as Sem -- | Specifies a partition with a given filesystem. -- @@ -110,7 +111,7 @@ data PartInfoVal | AdjustPartSpecInfo MountPoint (PartSpec PartLocation -> PartSpec PartLocation) newtype PartInfo = PartInfo [PartInfoVal] - deriving (Monoid, Typeable) + deriving (Monoid, Sem.Semigroup, Typeable) instance IsInfo PartInfo where propagateInfo _ = PropagateInfo False @@ -183,9 +184,12 @@ adjustPartition mp f = pureInfoProperty data PartLocation = Beginning | Middle | End deriving (Eq, Ord) +instance Sem.Semigroup PartLocation where + _ <> b = b + instance Monoid PartLocation where mempty = Middle - mappend _ b = b + mappend = (<>) partLocation :: PartSpec PartLocation -> PartLocation -> PartSpec PartLocation partLocation (mp, o, p, _) l = (mp, o, p, l) -- cgit v1.3-2-g0d8e