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/Debootstrap.hs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/Propellor/Property/Debootstrap.hs') diff --git a/src/Propellor/Property/Debootstrap.hs b/src/Propellor/Property/Debootstrap.hs index 7c8e9618..c6e5c373 100644 --- a/src/Propellor/Property/Debootstrap.hs +++ b/src/Propellor/Property/Debootstrap.hs @@ -19,12 +19,13 @@ import Utility.FileMode import Data.List import Data.Char +import qualified Data.Semigroup as Sem import System.Posix.Directory import System.Posix.Files type Url = String --- | A monoid for debootstrap configuration. +-- | A data type for debootstrap configuration. -- mempty is a default debootstrapped system. data DebootstrapConfig = DefaultConfig @@ -35,9 +36,12 @@ data DebootstrapConfig | DebootstrapConfig :+ DebootstrapConfig deriving (Show) +instance Sem.Semigroup DebootstrapConfig where + (<>) = (:+) + instance Monoid DebootstrapConfig where mempty = DefaultConfig - mappend = (:+) + mappend = (<>) toParams :: DebootstrapConfig -> [CommandParam] toParams DefaultConfig = [] -- cgit v1.3-2-g0d8e