summaryrefslogtreecommitdiff
path: root/src/Propellor/Types.hs
diff options
context:
space:
mode:
authorJoey Hess2018-04-30 09:03:46 -0400
committerJoey Hess2018-04-30 09:03:46 -0400
commit14fe4c4d6b5a29be94ecfc0572e0f9a9a081e795 (patch)
tree38ad23b09bd21a8569568335a13bfde9c16e79c1 /src/Propellor/Types.hs
parent96ea8e04251bc23dd27faf1f486a2a9f9c29ff98 (diff)
fix broken SemigroupMonoid transition <<loop>>
Turns out that with ghc 8.2.2, the instructions given on the page don't work. And the cppless variant that I had compiles, but into effectively mappend = mappend so it loops. The only way I can see to make it work without cpp is to use mappend = (Sem.<>) which is ugly and a land mine waiting to explode if someone changes it to a nicer mappend = (<>) with a newer version of ghc which will compile it and work ok, while breaking it with 8.2.2. Sigh. I posted to haskell-cafe about this.
Diffstat (limited to 'src/Propellor/Types.hs')
-rw-r--r--src/Propellor/Types.hs12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/Propellor/Types.hs b/src/Propellor/Types.hs
index 4b4378a9..7cbe9f13 100644
--- a/src/Propellor/Types.hs
+++ b/src/Propellor/Types.hs
@@ -235,7 +235,7 @@ instance SingI metatypes => Monoid (Property (MetaTypes metatypes))
where
-- | A property that does nothing.
mempty = Property sing "noop property" Nothing mempty mempty
- mappend = (<>)
+ mappend = (Sem.<>)
-- | Any type of RevertableProperty is a Semigroup. When revertable
-- properties x and y are appended together, the resulting revertable
@@ -253,10 +253,12 @@ instance
RevertableProperty (s1 <> s2) (u2 <> u1)
instance
- ( Monoid (Property setupmetatypes)
- , Monoid (Property undometatypes)
+ ( Monoid (Property (MetaTypes setupmetatypes))
+ , Monoid (Property (MetaTypes undometatypes))
+ , SingI setupmetatypes
+ , SingI undometatypes
)
- => Monoid (RevertableProperty setupmetatypes undometatypes)
+ => Monoid (RevertableProperty (MetaTypes setupmetatypes) (MetaTypes undometatypes))
where
mempty = RevertableProperty mempty mempty
- mappend = (<>)
+ mappend = (Sem.<>)