{-# LANGUAGE NoImplicitPrelude #-}

module Stack.Types.UnusedFlags
  ( UnusedFlags (..)
  , FlagSource (..)
  ) where

import           Stack.Prelude

data FlagSource
  = FSCommandLine
  | FSStackYaml
  deriving (FlagSource -> FlagSource -> Bool
(FlagSource -> FlagSource -> Bool)
-> (FlagSource -> FlagSource -> Bool) -> Eq FlagSource
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: FlagSource -> FlagSource -> Bool
== :: FlagSource -> FlagSource -> Bool
$c/= :: FlagSource -> FlagSource -> Bool
/= :: FlagSource -> FlagSource -> Bool
Eq, Eq FlagSource
Eq FlagSource
-> (FlagSource -> FlagSource -> Ordering)
-> (FlagSource -> FlagSource -> Bool)
-> (FlagSource -> FlagSource -> Bool)
-> (FlagSource -> FlagSource -> Bool)
-> (FlagSource -> FlagSource -> Bool)
-> (FlagSource -> FlagSource -> FlagSource)
-> (FlagSource -> FlagSource -> FlagSource)
-> Ord FlagSource
FlagSource -> FlagSource -> Bool
FlagSource -> FlagSource -> Ordering
FlagSource -> FlagSource -> FlagSource
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: FlagSource -> FlagSource -> Ordering
compare :: FlagSource -> FlagSource -> Ordering
$c< :: FlagSource -> FlagSource -> Bool
< :: FlagSource -> FlagSource -> Bool
$c<= :: FlagSource -> FlagSource -> Bool
<= :: FlagSource -> FlagSource -> Bool
$c> :: FlagSource -> FlagSource -> Bool
> :: FlagSource -> FlagSource -> Bool
$c>= :: FlagSource -> FlagSource -> Bool
>= :: FlagSource -> FlagSource -> Bool
$cmax :: FlagSource -> FlagSource -> FlagSource
max :: FlagSource -> FlagSource -> FlagSource
$cmin :: FlagSource -> FlagSource -> FlagSource
min :: FlagSource -> FlagSource -> FlagSource
Ord, Int -> FlagSource -> ShowS
[FlagSource] -> ShowS
FlagSource -> String
(Int -> FlagSource -> ShowS)
-> (FlagSource -> String)
-> ([FlagSource] -> ShowS)
-> Show FlagSource
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> FlagSource -> ShowS
showsPrec :: Int -> FlagSource -> ShowS
$cshow :: FlagSource -> String
show :: FlagSource -> String
$cshowList :: [FlagSource] -> ShowS
showList :: [FlagSource] -> ShowS
Show)

data UnusedFlags
  = UFNoPackage FlagSource PackageName
  | UFFlagsNotDefined
      FlagSource
      PackageName
      (Set FlagName) -- defined in package

      (Set FlagName) -- not defined

  | UFSnapshot PackageName
  deriving (UnusedFlags -> UnusedFlags -> Bool
(UnusedFlags -> UnusedFlags -> Bool)
-> (UnusedFlags -> UnusedFlags -> Bool) -> Eq UnusedFlags
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: UnusedFlags -> UnusedFlags -> Bool
== :: UnusedFlags -> UnusedFlags -> Bool
$c/= :: UnusedFlags -> UnusedFlags -> Bool
/= :: UnusedFlags -> UnusedFlags -> Bool
Eq, Eq UnusedFlags
Eq UnusedFlags
-> (UnusedFlags -> UnusedFlags -> Ordering)
-> (UnusedFlags -> UnusedFlags -> Bool)
-> (UnusedFlags -> UnusedFlags -> Bool)
-> (UnusedFlags -> UnusedFlags -> Bool)
-> (UnusedFlags -> UnusedFlags -> Bool)
-> (UnusedFlags -> UnusedFlags -> UnusedFlags)
-> (UnusedFlags -> UnusedFlags -> UnusedFlags)
-> Ord UnusedFlags
UnusedFlags -> UnusedFlags -> Bool
UnusedFlags -> UnusedFlags -> Ordering
UnusedFlags -> UnusedFlags -> UnusedFlags
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: UnusedFlags -> UnusedFlags -> Ordering
compare :: UnusedFlags -> UnusedFlags -> Ordering
$c< :: UnusedFlags -> UnusedFlags -> Bool
< :: UnusedFlags -> UnusedFlags -> Bool
$c<= :: UnusedFlags -> UnusedFlags -> Bool
<= :: UnusedFlags -> UnusedFlags -> Bool
$c> :: UnusedFlags -> UnusedFlags -> Bool
> :: UnusedFlags -> UnusedFlags -> Bool
$c>= :: UnusedFlags -> UnusedFlags -> Bool
>= :: UnusedFlags -> UnusedFlags -> Bool
$cmax :: UnusedFlags -> UnusedFlags -> UnusedFlags
max :: UnusedFlags -> UnusedFlags -> UnusedFlags
$cmin :: UnusedFlags -> UnusedFlags -> UnusedFlags
min :: UnusedFlags -> UnusedFlags -> UnusedFlags
Ord, Int -> UnusedFlags -> ShowS
[UnusedFlags] -> ShowS
UnusedFlags -> String
(Int -> UnusedFlags -> ShowS)
-> (UnusedFlags -> String)
-> ([UnusedFlags] -> ShowS)
-> Show UnusedFlags
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> UnusedFlags -> ShowS
showsPrec :: Int -> UnusedFlags -> ShowS
$cshow :: UnusedFlags -> String
show :: UnusedFlags -> String
$cshowList :: [UnusedFlags] -> ShowS
showList :: [UnusedFlags] -> ShowS
Show)