@@ -15,6 +15,7 @@ import Distribution.Parsec (CabalParsing, Parsec (..))
1515import Prelude ()
1616
1717import Data.Bool (bool )
18+ import Distribution.Simple.Flag (NoFlagValue (.. ))
1819
1920-- ------------------------------------------------------------
2021
@@ -35,25 +36,17 @@ instance Binary OptimisationLevel
3536instance NFData OptimisationLevel
3637instance Structured OptimisationLevel
3738
39+ instance NoFlagValue OptimisationLevel where
40+ noFlagValue :: OptimisationLevel
41+ noFlagValue = NormalOptimisation
42+
3843instance Parsec OptimisationLevel where
3944 parsec :: CabalParsing m => m OptimisationLevel
4045 parsec = boolParser <|> intParser
4146 where
4247 boolParser = bool NoOptimisation NormalOptimisation <$> parsec
4348 intParser = intToOptimisationLevel <$> integral
4449
45- instance Ord OptimisationLevel where
46- compare :: OptimisationLevel -> OptimisationLevel -> Ordering
47- compare = comparing fromEnum
48-
49- instance Semigroup OptimisationLevel where
50- (<>) :: OptimisationLevel -> OptimisationLevel -> OptimisationLevel
51- (<>) = max
52-
53- instance Monoid OptimisationLevel where
54- mempty :: OptimisationLevel
55- mempty = NormalOptimisation
56-
5750instance IsString OptimisationLevel where
5851 fromString :: String -> OptimisationLevel
5952 fromString s = case reads s of
0 commit comments