summaryrefslogtreecommitdiff
path: root/src/Propellor/Property/Installer/Target.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Propellor/Property/Installer/Target.hs')
-rw-r--r--src/Propellor/Property/Installer/Target.hs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/Propellor/Property/Installer/Target.hs b/src/Propellor/Property/Installer/Target.hs
index 80e660ad..54e9075e 100644
--- a/src/Propellor/Property/Installer/Target.hs
+++ b/src/Propellor/Property/Installer/Target.hs
@@ -112,6 +112,7 @@ import Data.List
import Data.Char
import Data.Ord
import Data.Ratio
+import qualified Data.Semigroup as Sem
import System.Process (readProcess)
-- | Partition table for the target disk.
@@ -438,9 +439,12 @@ getMountsSizes = mapMaybe (parse . words) . lines <$> readProcess "findmnt" ps "
data TargetFilled = TargetFilled (Ratio Integer)
deriving (Show, Eq)
+instance Sem.Semigroup TargetFilled where
+ TargetFilled n <> TargetFilled m = TargetFilled (n+m)
+
instance Monoid TargetFilled where
mempty = TargetFilled (0 % 1)
- mappend (TargetFilled n) (TargetFilled m) = TargetFilled (n+m)
+ mappend = (<>)
newtype TargetFilledHandle = TargetFilledHandle Integer