summaryrefslogtreecommitdiff
path: root/src/Propellor/Property/DiskImage
diff options
context:
space:
mode:
authorJoey Hess2018-04-23 13:20:13 -0400
committerJoey Hess2018-04-23 13:20:13 -0400
commit9228bda32f0a3f6d52e7cc5eb444376e7b024d8c (patch)
treee3ada017b0f625db8b39a2212ab82c8e32a62b7c /src/Propellor/Property/DiskImage
parent5ecbec11127449fefe4812fd6b374801ce8499c1 (diff)
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.
Diffstat (limited to 'src/Propellor/Property/DiskImage')
-rw-r--r--src/Propellor/Property/DiskImage/PartSpec.hs8
1 files changed, 6 insertions, 2 deletions
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)