summaryrefslogtreecommitdiff
path: root/src/Propellor/Property/DiskImage/PartSpec.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Propellor/Property/DiskImage/PartSpec.hs')
-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)