From c0d0e57257fe8dee1f9d37a6d49b6322af985a69 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 11 Nov 2016 17:29:11 -0400 Subject: Clean up build warnings about redundant constraints when built with ghc 8.0. Only a couple of the constraints were really redundant. The rest are essential to propellor's tracking of Info propigation, so I silenced the warning for those. It would be better to only silence the warning for the functions with the extra constraints, but IIRC warnings can only be silenced on an entire file basis. This commit was sponsored by Andreas on Patreon. --- src/Propellor/EnsureProperty.hs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/Propellor/EnsureProperty.hs') diff --git a/src/Propellor/EnsureProperty.hs b/src/Propellor/EnsureProperty.hs index c4666722..e8602047 100644 --- a/src/Propellor/EnsureProperty.hs +++ b/src/Propellor/EnsureProperty.hs @@ -3,6 +3,7 @@ {-# LANGUAGE PolyKinds #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE UndecidableInstances #-} +{-# OPTIONS_GHC -fno-warn-redundant-constraints #-} module Propellor.EnsureProperty ( ensureProperty @@ -37,6 +38,9 @@ import Prelude -- with the property to be lost. ensureProperty :: + -- -Wredundant-constraints is turned off because + -- this constraint appears redundant, but is actually + -- crucial. ( Cannot_ensureProperty_WithInfo inner ~ 'True , (Targets inner `NotSuperset` Targets outer) ~ 'CanCombine ) @@ -45,7 +49,7 @@ ensureProperty -> Propellor Result ensureProperty _ = catchPropellor . getSatisfy --- The name of this was chosen to make type errors a more understandable. +-- The name of this was chosen to make type errors a bit more understandable. type family Cannot_ensureProperty_WithInfo (l :: [a]) :: Bool type instance Cannot_ensureProperty_WithInfo '[] = 'True type instance Cannot_ensureProperty_WithInfo (t ': ts) = -- cgit v1.2.3